-
Notifications
You must be signed in to change notification settings - Fork 397
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
WITH DOCKER --cache-id
does not expand the --cache-id
value
#4136
Comments
Thanks for the report. It looks like your code example defines If it's changed to
it appears that the
(note the |
WITH DOCKER --cache-id
does not expand the --cache-id
value
I should mention that when the |
I did it in that way on purpose given that the 3 tests executors are going to use the exact same docker context I thought that it would be a good place to use the cache-id and avoid pulling and loading the very same image layers N times |
We still perform a pull each time to make sure the image hasn't changed; however the underlying image layers are cached. We chose to do this deliberately as a way to achieve speedup while still having the process repeatable. We have a test for the existing behaviour under https://github.com/earthly/earthly/blob/main/tests/with-docker-cache/Earthfile -- the second time it's called we set |
Thanks for the information! With "having the process repeatable" you mean across Earthly pipeline executions with caching right? But not within the scope of a single earthly execution. |
Yes. This also includes cases where you run a target, edit your Earthfile (e.g. changing the
easier said than done :) |
Sorry maybe I didn't express myself clear enough. I meant that if I know in advance (as a dev writing the Earthfile) that the --load and --pull are not going to change during a single earthly execution and on top of that I'm running earthly with --no-cache then if for example I have a FOR that runs the a target 100 times with its 100 WITH DOCKER. By not pulling/loading all the images again I guess that it would speedup the pipeline execution and reduce I/O a lot right? |
What went wrong?
When using WITH DOCKER --cache-id=id within a target that it is executed N times in parallel all targets are executed sequentially instead due to the locking mechanism.
Code example:
What should have happened?
Ideally I think the 1st execution should be locked and executed sequentially but once the docker context has all the required images pulled then the subsequent usages via cache should not be locked because they just need "read access" of the context to reuse the image layers.
What earthly version?
earthly8 version v0.8.11 5caed35 linux/amd64; Ubuntu 20.04.6 LTS (Focal Fossa)
Buildkit Logs
No response
Other Helpful Information
No response
The text was updated successfully, but these errors were encountered: