Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docker image for ARM #989

Merged
merged 2 commits into from
Jun 29, 2024
Merged

Conversation

eduherminio
Copy link
Contributor

Type of pull request:

  • Bug fix
  • Feature
  • Other

Description:

This change should be enough to cross-compile to both AMD and ARM.
It's complex for me to set up all the tokens and registries in my fork to test it though, so let's come up with a testing strategy.
I've been doing this successfully in my BOT's repo

Related Issues:

Closes #988

Checklist:

  • I have read and followed the contribution guidelines.
  • I have added necessary documentation (if applicable).
  • The changes pass all existing tests.

Screenshots/logs (if applicable):

@AttackingOrDefending
Copy link
Member

We can run the workflow in a branch and create a docker with a special name (e.g. lichess-bot-devs/lichess-bot:arm). Would that be enough for you to test it?

@eduherminio
Copy link
Contributor Author

We can run the workflow in a branch and create a docker with a special name (e.g. lichess-bot-devs/lichess-bot:arm). Would that be enough for you to test it?

Sure, something like that sounds great, I have both amd and arm linux vms available so I should be able to compare both versions from the same branch. Feel free to mingle with this branch to add the required name changes to ensure images aren't confused with the master ones.

@AttackingOrDefending
Copy link
Member

AttackingOrDefending commented Jun 27, 2024

The workflow failed (see the run here) with error:

ERROR: Multi-platform build is not supported for the docker driver.
Switch to a different driver, or turn on the containerd image store, and try again.
Learn more at https://docs.docker.com/go/build-multi-platform/
Reference
  Warning: No build ref found
Error: buildx failed with: Learn more at https://docs.docker.com/go/build-multi-platform/

If you can't fix the multi-platform build (I don't know how hard it is to fix), then creating different dockers for amd and arm seems fine.

@eduherminio
Copy link
Contributor Author

Can you try again @AttackingOrDefending? I added two missing steps to prepare the multi-platform build.

@AttackingOrDefending
Copy link
Member

Done. They were created and uploaded to GHCR and docker hub.

@eduherminio
Copy link
Contributor Author

The one tagged with arm works for me!

image

There's only one change I had to make, because originally I got this error about the version: harcoding a numeric version in

this_lichess_bot_version = version_numeric(__version__)

But that has to do with your change in versioning.yml to test, so I'd say all good!

[06/28/24 14:47:29] INFO     Engine configuration OK         lichess-bot.py:1149
                    ERROR    Quitting lichess-bot due to an  lichess-bot.py:1212
                             error:
                             Traceback (most recent call
                             last):
                               File
                             "/lichess-bot/lichess-bot.py",
                             line 1209, in <module>
                                 start_lichess_bot()
                               File
                             "/lichess-bot/lichess-bot.py",
                             line 1152, in start_lichess_bot
                                 check_python_version()
                               File
                             "/lichess-bot/lichess-bot.py",
                             line 1191, in
                             check_python_version
                                 this_lichess_bot_version =
                             version_numeric(__version__)

                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                               File
                             "/lichess-bot/lichess-bot.py",
                             line 1174, in version_numeric
                                 return [int(n) for n in
                             version_str.split(".")]
                                         ^^^^^^
                             ValueError: invalid literal for
                             int() with base 10: 'arm'

@MarkZH MarkZH merged commit 3e43621 into lichess-bot-devs:master Jun 29, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide ARM Docker images
3 participants