-
Notifications
You must be signed in to change notification settings - Fork 3
cache probe failure on coder/dogfood image #43
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
Comments
Turns out this is because we're using resource parameters directly here: terraform-provider-envbuilder/internal/provider/cached_image_resource.go Lines 595 to 646 in cd1599f
However, another way to feed these options are via |
Relates to #43 Our previous logic did not pass options from extra_env to envbuilder.RunCacheProbe. This fixes the logic and adds more comprehensive tests around the overriding logic. Future commits will refactor this logic some more.
I think I've found a minimal Dockerfile example that succeeds with
When added as an integration test case, the error is:
|
In the terraform provider we override envbuilder's
A separate fix to envbuilder will be necessary to allow overriding these properly at runtime, preferably without needing to import |
Getting closer now, but still getting a cache miss on a specific instruction with the provider, but running the envbuilder image with Provider:
Envbuilder image:
terraform-provider-envbuilder-43-docker_run.log.gz |
Ok, after adding some additional logging in Kaniko: Provider:
Envbuilder:
I hacked our ownership workaround for the injected envbuilder binary to apply to all files, and sure enough, the cache miss disappeared! So it seems like cache probe, at minimum, needs to detect if it is not running as UID/GID 0 and conditionally adjust its behaviour to pretend that all local files are owned by root when calculating hashes. Downside of this is that we could potentially end up pulling a cached layer with incorrect ownership information if the desired permissions are not |
Fix for caching when context files permissions change. This is irrelevant for a COPY operation since the they are either copied as root:root, or a specific owner/group depending on COPY --chown= argument. Relates to coder/terraform-provider-envbuilder#43 Co-authored-by: Cian Johnston <[email protected]>
Fixed by coder/kaniko#29 Verified with the template contained inside |
Dockerfile: https://github.com/coder/coder/blob/main/dogfood/contents/Dockerfile
devcontainer.json: https://github.com/coder/coder/blob/main/dogfood/contents/devcontainer.json
Error:
Reproducible with envbuilder provider v0.0.5
The text was updated successfully, but these errors were encountered: