-
Notifications
You must be signed in to change notification settings - Fork 7
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
Update docker-compose #386
Conversation
Delaying review request because I realized the wrong configuration file is mounted. |
When the file does not exist on the host machine, docker-compose will create the "file" as a directory when mounting. This is harmless so long as we handle that case correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me and very useful! 🙂
The only confusing part to me is the name AIOD_MOUNT and the way of defining the value (anything vs something). However, it is well described in the documentation and only used for development purposes, so I don't see it as a big problem.
I don't mind changing the name. I just wanted it to indicate that 1) it mounts the source code and 2) it's AIOD specific. Probably |
I am not exactly sure what you mean by AIoD specific. Perhaps I would emphasize the development aspect, so something like |
Good remarks. Will update tomorrow. |
Also require set to "true" rather than any value, to avoid accidental usage.
@andrejridzik I renamed the environment variable and moved the I think that in the future we should fix the non-dev docker-compose to use published images only (e.g., |
I'll go ahead and merge this. Feel free to leave your thoughts, if there's work resulting from it, we can address it in a follow-up PR. |
Change
Update the docker compose file to:
PYTHONPATH
in the image always, since it's needed to function if there is no mounted source.version
top level element which is obsoleteBetween the
override.env
introduced in #383, the develop compose file, and the different profiles, running common use case commands becomes very verbose (e.g.,docker compose --env-file=.env --env-file=override.env -f docker-compose.yaml -f docker-compose.dev.yaml --profile openml --profile huggingface-datasets up -d
). I introduced two scripts to provide shorthands:scripts/up.sh
: takes as arguments any number of profile names and will automatically specify the override environment, as well as the dev compose file ifAIOD_MOUNT
environment variable is set.scripts/down.sh
: brings down all services (i.e., it uses--profiles "*"
)How to Test
These changes fall outside the scope of unit tests, as they only touch auxiliary scripts and docker.
Since Dockerfiles are modified, images need to be rebuilt:
docker compose --profile "*" build ./scripts/clean.sh
then start the containers, optionally with profiles, e.g.,:
This should bring up all containers, honoring the overrides in
override.env
but without mounting your local version of the source code.Modify the local source code, e.g., leave a comment in
src/main.py
and verify it isn't present in a running containerTo test the containers with mounted source code, simply set
AIOD_MOUNT=1
inoverride.env
. Then re-up the containers, e.g.:When you check the container's content, you should see it now reflects your local changes.
Checklist
Related Issues