lichess-bot-devs / lichess-bot

A bridge between Lichess bots and chess engines
GNU Affero General Public License v3.0
715 stars 434 forks source link

Add docker image for ARM #989

Closed eduherminio closed 1 week ago

eduherminio commented 1 week ago

Type of pull request:

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:

Screenshots/logs (if applicable):

AttackingOrDefending commented 1 week ago

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 commented 1 week ago

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 commented 1 week ago

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 commented 1 week ago

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

AttackingOrDefending commented 1 week ago

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

eduherminio commented 1 week ago

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 https://github.com/lichess-bot-devs/lichess-bot/blob/6aff6a96ffe5bc25b801c8aa967a8d819cb0a2bd/lichess-bot.py#L1191

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'