-
Notifications
You must be signed in to change notification settings - Fork 462
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
Docker image #936
Docker image #936
Conversation
I haven't used docker before and I have run into some problems while trying to test your docker. I have downloaded docker desktop and downloaded your image through it.
The structure is:
It is able to read the |
Hi, The first thing is as mentioned in 'wiki/How-to-use-the-Docker-image.md': be aware that this program will run inside the container ... in a Linux Alpine OS. Nevertheless, I tried to launch Stockfish inside this image and I didn't succeed. Looking at the Stockfish web site, there are a lot of Linux different versions. I tried with POPCNT and AVX2. Both do not work in the container (but run on the Ubuntu subsystem on my PC). Maybe there's something wrong between Stockfish and Alpine Linux (it's a very light Linux system, maybe something required by Stockfish is missing?). I had a look at the Dockerfile of a Stockfish docker image based on Alpine. And it does not seem as simple as executing the compiled file contained in the package (they do a make). I will investigate more tomorrow (now it's late in France ;-)). |
Hi again, The problem is that Stockfish requires the Here we have a well-known dilemma of Docker image producers; On the one hand, the image based on My proposal is to do as others do: Several variants. I haven't pushed this into my PR yet (I will if it seems reasonable to you), but I put a new |
I downloaded SF for linux and the new image from docker hub but it still won't work because it doesn't find the executable, even though it finds
I'm still using Windows so I don't know if that is the problem, but I don't think it is since the error is
The command I am using:
If other engines can run on alpine (e.g. Leela, Berserk, Caissa, Seer), I think it is fine to have two versions. |
Hi, I think the problem is in your Here is the configuration I use:
config.yml:
And the command : If you want to inspect what is really in your container, you can launch a shell with the same configuration using: If this does not fix the problem, please send the docker container's log (you can retrieve it in the containers tab of Docker desktop). For the Alpine variant, I am pretty sure that most C engines may have some compatibility problem with it. But, fortunately, there's a lot of home made engines on Lichess for which Alpine will be a far better option. For instance ... mine ;-) |
Hi, |
Thanks for the help in setting the docker up. It works now and can play a game. Would it be possible to support homemade engines and extra game handlers? Is there any way that users can use custom
Also, can the logs in |
Yes :-) |
Ooops, I didn't noticed lichess-bot was writing logs in its file system! It's a (little) problem. Is there any way to deactivate this output? The problem is docker's file system is a copy on write system. So writing logs to it results in a lot of duplications and quickly ends with disk saturation. A Docker logging best practice is to log to the standard output stream, and configure the Docker logging system as you wish. With the default configuration, the Examples:
|
By running Users can also save the games to a local folder by enabling the option in How to use |
Sorry, I should have seen this!
I will add the
I will add this :-) |
That's ok, but I think we should recommend users to use
This is a good warning.
Could this help? |
Not really ;-). The exposed solution requires the user to remember to mount |
Hi, Since yesterday, I've been wondering about the complexity of the Docker volume mounts needed to use a custom The problem is Here are the solutions I considered (in my order of preference ... But I must admit that my opinion is not very informed). All have in common a single volume mount to a path to be chosen (inside or outside of the lichess-bot root directory), let's say
Of course, we can stay on what is currently running! |
I too prefer option 1. |
Nice :-) I tried the same with |
- Adds LICHESS_BOT_DOCKER environment variable to help Python program detecting it is running in a Docker container - Changes installation direction to /lichess-bot (instead of /lichessbot) - Changes the configuration folder path to /lichess-bot/cinfig instead of /engine - Adds a warning message if the docker container is configured to output pgn files - Makes lib/engine_wrapper.py and lib/model.py search for lib.extra_game_handlers_failover if importing extra_game_handlers fails - Prevent Python from writing to containers (set PYTHONDONTWRITEBYTECODE to 1) - Merges docker/Dockerfile and docker/Dockerfile-alpine
Hi, I've updated the pull request with the following changes:
Tell me if you want some more changes or if I made something wrong. |
In the wiki, instead of I believe we should also mention that I also think we should mention that in the Lastly, I think we can look into publishing the images also in github packages (see here). It has a maximum stotage of 500MB, but maybe we can get under it with some |
Sorry, I didn't update the wiki in the right branch of my project! Now it's fixed.
Done
I don't know Github package at all, and, to be honest, its interest for public packages is not obvious (Docker hub is the official repository that every Docker user know, like Maven central for Java packages). |
You can see the errors here. You should probably add a |
done
It didn't work. I had to put |
|
I don't understand what is the problem with ignoring |
Removing line 101 should fix the issue with
We try to limit the amount of When I tried using the homemade engines that come with
|
Yes 👍
Ok, so I've modified your proposal in
If you don't provide any |
Is there any flag that you can add to line 17, to only move the |
Unfortunately, the Dockerfile content (except the |
I've just had an idea to do that easily, and to avoid polluting your code with try/except around imports of |
I've pushed the implementation of the following idea: Instead, I implemented a proxy for the This proxy contains the ugly try/except hacks and is used wherever There's also no longer a copy of PS: The problem with missing |
That was a nice change. Now we don't have to use @MarkZH We have to first create an account on Docker Hub and the Github container registry before we can merge this. |
Some suggestions from a complete Docker noob.
I have not been able to start the Docker version of lichess-bot since the container cannot find the config file. I created a folder with the following contents:
I know that my engine is a Windows engine, but the problems start earlier. When I run the Docker command
A hex string is printed and the program immediately exits with this log:
|
Hi,
There's no need of a Docker hub account to download (pull in Docker language) and run the image. You only need one if you want to publish (push in Docker language) an image.
There's already the following sentence in the first line of the documentation : the UCI/XBoard program that runs your engine (be aware that this program will run inside the container ... in a Linux OS). I don't know what else to say.
I added a chapter about stopping, based on the run example. Nevertheless, usually, this information is not in the documentation of Docker images. In fact, how to stop a container does not depend on the image (it's a standard Docker instruction).
There's a problem with the path of your configuration folder.
|
Can you change |
@fathzer Thanks. I got it working. |
done :-) |
@MarkZH Should I merge this? |
Go ahead. |
c629b59
into
lichess-bot-devs:master
Type of pull request:
Description:
Adds a workflow that creates a minimal, easy to use, Docker image.
It also contains some documentation about the image.
Related Issues:
This PR is related to #780 issue.
Checklist:
Screenshots/logs (if applicable):
Additional work required
In order to work, the workflow requires:
DOCKER_ORGANIZATION
action repository variable containing the name of the Docker Hub organization.DOCKER_IMG
action repository variable containing the name of the Docker image (let's say lichess-bot).DOCKER_USER
andDOCKER_PWD
containing, respectively, the login of the user that has rights to push to the docker hub organization and a token of this user with read, write and delete permissions (available in https://hub.docker.com/settings/security).How it works?
Every push on master branch will trigger the
build and publish
of the image with thelatest
tag.The workflow (Docker CI) can also be executed manually in the Github interface. In this case, it will ask for the tag to apply to the built image.
Probably this process can be improved.
Some pushes (typically changes in wiki folder) may not require an image update. But I was not sure to have a safe way to distinguish those minor updates.
I also added the manual trigger because I was wondering how I could reliably obtain a release version.
How can you see work before accepting the PR?
My fork built the
fathzer/lichess-bot
image available in Docker hub. Feel free to test it!PS : Be careful, I'm a newbie in Github actions, and I don't known Python at all ... but I know a little Docker (I have been using it in a lot of professional or personal projects since 2014).