-
Notifications
You must be signed in to change notification settings - Fork 2
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
RUN command is not supported in cache probe mode #68
Comments
Hi @MartinLoeper, can you provide the versions of both the envbuilder image and the terraform provider you're using? |
Hi @johnstcn, I used envbuilder |
Hey @MartinLoeper, would you be able to provide a minimal Dockerfile or devcontainer.json that reproduces the issue for you? Our integration tests pass with that specific combination of envbuilder + provider, which suggests to me that there's an underlying issue that we haven't managed to capture in our tests yet. |
Hey @johnstcn, Thanks for looking into it. Here is my sample devcontainer repo which I open in Coder via envbuilder: https://github.com/MartinLoeper/devcontainer-test/blob/main/.devcontainer/devcontainer.json |
Hey Martin, just wanted to give you an update. I've narrowed it down to a couple of the devcontainer features busting the cache, but I need to spend some more time to figure out exactly which feature and/or which parts of the feature. My notes so far: https://gist.github.com/johnstcn/385700a755b10028844609af28014a6e |
Wow, that is a very detailed analysis! Thanks @johnstcn I see that docker-outside-of-docker is included in my test repo. I think this feature is not really required when running in coder since I am using a remote builder. It is definitely required when developing locally outside of coder since the developers are using their local docker socket in that case. Appreciate your effort @johnstcn since I know how difficult it is to analyse things like that and I would definitely not have the skills to do that so well. |
I don't think it's necessarily related to that particular feature @MartinLoeper -- I was also able to replicate it with the We have a theory that it may be related to how the Terraform provider runs the cache probe. Normally we have to "lie" about the paths of some files in order to ensure that the cache probe works, and we may not be lying correctly about the paths of feature install scripts :-) The next step would be to validate this theory with an integration test in the provider that builds an image with a "no-op" feature. |
Ah I understand. If there is something I can help you with, e.g. testing something on my cluster, feel free to reach out. |
TL;DR features are not cacheable at the moment. When envbuilder builds devcontainer features, they are extracted to a temporary folder and executed. Example:
When performing a cache probe ( Example (not using provider, but using a test that replicates the behaviour):
Possible fix: Use a chroot-like filesystem abstraction to run the cache probe, where all reads and writes are redirected to a temporary directory. For example, reading We currently do a sort of 'hacky' workaround for this right now as part of the cache probe: before running the cache probe, we extract the envbuilder binary from the builder image and place it in the build context in an expected location (as we embed the envbuilder binary inside the built image). |
I am using the envbuilder terraform provider to cache my workspace image in coder.
Could somebody help me understand why I always see the following error which results in a cache miss?
Are there devcontainer elements that cannot be cached such as devcontainer features?
Or what does "uncached RUN command is not supported in cache probe mode" mean?
The text was updated successfully, but these errors were encountered: