-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Enable docker cache build for images listed in docker-compose.yml #18179
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -62,13 +62,21 @@ Ninja is a build tool (like make) that prioritizes building speed. If you will b | |
|
|
||
| ## Runing Python Tests Within Docker | ||
|
|
||
| 1. To run tests inside docker run the following comamdn | ||
| ``` | ||
| ci/build.py --platform {PLATFORM} /work/runtime_functions.sh {RUNTIME_FUNCTION} | ||
| ``` | ||
| To run tests inside docker, you first need to install `docker` and `docker-compose` on your machine. | ||
|
|
||
| On Ubuntu you may install them via `sudo apt-get install docker.io docker-compose` | ||
| and set them up via `sudo usermod $(whoami) -G docker -a`. | ||
|
|
||
| Then, to run tests inside docker run the following command | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you also add
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's add it in a separate PR to unblock merging this fix. We can also consider getting rid of that dependency by moving relying on standard tools instead of using our custom scripts.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes sense. But custom scripts sort of make job easier for lazy people like me :p having to google steps for getting those standard tools. What do you reckon? Apart from taking the onus of ensuring testing is correct rather than leaving it to users to find their way out of the problems that may come up with setting up those standard tools on their own. |
||
|
|
||
| ``` | ||
| ci/build.py --platform {PLATFORM} /work/runtime_functions.sh {RUNTIME_FUNCTION} | ||
| ``` | ||
|
|
||
| An example for running python tests would be | ||
|
|
||
| ``` | ||
| ci/build.py --platform build_ubuntu_cpu_mkldnn /work/runtime_functions.sh unittest_ubuntu_python3_cpu PYTHONPATH=./python/ pytest tests/python/unittest | ||
| ci/build.py --platform build_ubuntu_cpu_mkldnn /work/runtime_functions.sh unittest_ubuntu_python3_cpu | ||
| ``` | ||
|
|
||
|
|
||
|
|
||
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.
Can you pull that into docker_cache.py to leverage parallelisation wrt non updated images and also providing one single interface?
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.
The idea is to delete
docker_cache.pylater, so thedocker-compose -f docker/docker-compose.yml build --parallel && docker-compose -f docker/docker-compose.yml pushwould be the unified interface.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.
I'm not sure what parallelism you refer to. Is
docker-compose build --parallelnot sufficient?Uh oh!
There was an error while loading. Please reload this page.
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.
I understand.
It's not sufficient in the sense of that docker-cache and docker compose are run in sequence. Alternatively, create a second parallel step so it runs on another node?
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.
docker-cachewill only be used temporarily. I think the current solution is fine given that the first step (sh "python3 ./ci/docker_cache.py) will be deleted later.