-
Notifications
You must be signed in to change notification settings - Fork 2k
Add --force-rm flag #9727
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
base: master
Are you sure you want to change the base?
Add --force-rm flag #9727
Conversation
… layers This commit makes it possible to turn off the removal of intermediate docker layers when building the tfb containers by adding a `--force-rm` flag to the tfb script. This is useful in situations where you want to inspect the intermediate layers for debugging purposes, or for caching builds of dependencies as a docker layer to speed up the build process. Note that the default behavior is to remove the intermediate layers to avoid filling up the disk with unused layers on the citrine server. Fixes: TechEmpower#9718
This change reduces the time it takes to build the hyper Docker image by caching the dependency builds. This is done by building a dummy binary before copying the source code into the image.
The following frameworks were updated, pinging maintainers: |
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 we also prepend [CI fw-only Rust/hyper]
to the next commits?
parser.add_argument( | ||
'--force-rm', | ||
default=True, | ||
help='Remove intermediate docker containers after running.') |
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 think that if we're going to do this in the aim of improving ergonomics for contributors who need to quickly iterate implementations again and again and want those layers to persist between attempts, then this should be False
by default, and we need to update our CI scripts to forcibly set to True
(and our continuous scripts).
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 don't really know docker and so cannot review this PR.
No problem - you were auto tagged because I previously added you to the maintainers config on the hyper test, and because I included the hyper change to show how / why this makes sense as a change. If you're interested a bit in how this works, each command run from a docker file creates a saved layer which can be used by future calls to docker to jump straight to that point rather than running that command again when building an image. Those intermediate layers take up space though, and tend to exhaust the benchmarking storage, so the benchmark turned that saving off. It's useful to turn it on however for speeding up development activities. The trick to doing so in Rust projects is to compile an empty main.rs against all the dependencies listed in your manifest and lock file and then delete binary that you just created. This saves a docker layer that has a cache of all the compiled dependencies, which speeds up future compilation times. |
feat: add --force-rm flag to configure removing intermediate docker layers
This commit makes it possible to turn off the removal of intermediate
docker layers when building the tfb containers by adding a
--force-rm
flag to the tfb script. This is useful in situations where you want to
inspect the intermediate layers for debugging purposes, or for caching
builds of dependencies as a docker layer to speed up the build process.
Note that the default behavior is to remove the intermediate layers to
avoid filling up the disk with unused layers on the citrine server.
Fixes: #9718
hyper: cache dependencies to reduce build time
This change reduces the time it takes to build the hyper Docker image by
caching the dependency builds. This is done by building a dummy binary
before copying the source code into the image.