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

Call the engine binaries by absolute path. #1363

Closed
wants to merge 1 commit into from

Conversation

vdbergh
Copy link
Contributor

@vdbergh vdbergh commented Jun 19, 2022

This should fix the docker image built by @Dantist. See #1360 .

The instructions for rebuilding the image are in Dockerfile. Since this PR has not been committed yet I could not test the rebuilding. However I applied the PR manually (after starting the container) and it worked!

@vdbergh
Copy link
Contributor Author

vdbergh commented Jun 19, 2022

One complication with the docker image is, that it apparently has no permanent storage to preserve the config file. So each time it is run it will have a different uuid_prefix.

@vdbergh
Copy link
Contributor Author

vdbergh commented Jun 19, 2022

It seems to be not very difficult to have the worker directory outside the container and map it to a directory inside the container

https://docs.docker.com/storage/bind-mounts/

@vdbergh
Copy link
Contributor Author

vdbergh commented Jun 19, 2022

It's not so straightforward though since you cannot mount something while building an image.

@noobpwnftw
Copy link
Contributor

Can declare a docker volume.

@vdbergh
Copy link
Contributor Author

vdbergh commented Jun 19, 2022

As I understand it you can mount something while creating the container, but not while building the image.

@vdbergh
Copy link
Contributor Author

vdbergh commented Jun 19, 2022

@noobpwnftw Actually now I understand what you are saying. Mounting an empty volume over a directory in the container causes the files in the directory to be copied to the volume. This then becomes permanent storage. Thanks!

@vdbergh
Copy link
Contributor Author

vdbergh commented Jun 19, 2022

This is the command I use to run the image by @Dantist with permanent storage

sudo docker run -it -v worker-dir:/opt/fishtest/worker -e concurrency=MAX fishtest

The volume worker-dir has been created by

sudo docker volume create worker-dir

Pretty convenient actually. Given that this will work on all OS'es that docker supports.

EDIT. It is not necessary to create the volume worker-dir beforehand.

@vdbergh
Copy link
Contributor Author

vdbergh commented Jun 20, 2022

Interestingly the same volume can be mounted by two docker containers, so that effectively two workers share the same directory. The current lockfile implementation is defeated as the two workers have the same PID (in different containers). This can be solved by including the hostname in the lockfile (besides the PID).

@vdbergh
Copy link
Contributor Author

vdbergh commented Jun 20, 2022

See #1364

@vdbergh
Copy link
Contributor Author

vdbergh commented Jun 20, 2022

There is no a cutechess-cli binary that works in the docker image and that does not need the PR. See #1362 . This is a better solution. So I am closing this PR.

@vdbergh vdbergh closed this Jun 20, 2022
@noobpwnftw
Copy link
Contributor

Containerized worker is always nice to have. PID isolation can be disabled by running the container with --pid=host, although it is hardly necessary to run multiple containers in the first place.

@vdbergh
Copy link
Contributor Author

vdbergh commented Jun 20, 2022

@noobpwnftw Thanks! The —pid option would indeed prevent two workers from running in the same directory.

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.

2 participants