Improve act4-build image caching#1365
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the ACT4 build Docker image to improve layer caching by separating dependency installation from the full repo copy, aiming to reduce rebuild cost when only source files change.
Changes:
- Copy only tool/dependency manifest files into the dependency-warm stage to improve Docker layer cache hit rate.
- Adjust dependency warm commands (
bundle install,uv sync) and only copy the resulting/act4/.venvinto the final image. - Move the full-repo
COPYto the end of the Dockerfile (with--chmod=777) so typical source changes affect only the last layer.
bc9fb9b to
3acfab5
Compare
|
#1362 caused regression for container image since the user running inside container apparently can't change permissions of files despite it it is able to read/write/delete the files, but not change permissions because of owner mismatch: DetailsIn fact I'm not sure why it is trying to modify those files unconditionally all the time, that feels wrong. If you want to avoid file changes, you can commit them to the repo and then add to |
3acfab5 to
5b285f1
Compare
|
@jordancarlin what is your preference to dealing with ^ regression? Should I just delete the filed from the image and let it re-generate with correct permissions at the execution moment or will it be fixed on some other level? |
I'm hoping #1393 should fix that. Can you give it a try? In terms of the overall Docker image, I am thinking about doing a more significant overhaul that splits things into an |
|
With this PR it mostly means moving the last line and Though I'm more generally skeptical on usefulness of building |
|
Let me know if you still prefer to have two images and I'll include corresponding changes in this PR. |
5b285f1 to
a02ba40
Compare
|
Just rebased on |
|
There are still lots of rapid enhancements happening on the latest act4 branch, so I think it is worthwhile to make it easy for people to use the latest version. I agree that constantly rebuilding the image is unnecessary though, which is why I thought the two image approach might make more sense. |
|
Let me try the split in my branch then, will probably take an hour or so to run a CI build to test it on my end and I'll push it here |
|
I think the latest revision should be doing what you suggested |
|
@jordancarlin do you have any other feedback here? |
This reduced the diff to a single layer when dependencies remain the same.
As a small piece of related feedback, it'd be nice if
/workwas the only writable directory during ELF building. Currently other directories are modified too.