-
Notifications
You must be signed in to change notification settings - Fork 3
RUN command is not supported in cache probe mode #68
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
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). |
Checking in to see what the status of this issue is, as I've run into it myself today, with one (but not all) of my features. My devcontainer.json is building (and caching) some, but not all the features – it's particularly getting stuck with the NVIDIA-CUDA feature. You can see in the logs, it'll build and cache some features (or in this case, re-use the already-built layers from the cache), but with the NVIDIA-CUDA feature, it finishes the installation phase for the feature, announces "#3: Taking snapshot of files..." and then, it would seem, never gets as far as pushing the layer to the container registry like it has for the other features. It then downloads the git repo again, pulls the other feature layers from the cache and then gets to the NVIDIA-CUDA feature, which isn't in the cache and sets about building it again... only to get to "#3: Taking snapshot of files...", not push the layer and doing the whole thing again. Over and over! I'm struggling to find anything that indicates an error has occurred. Is this related to this existing issue, or do you think it's a separate problem that I'm inducing? |
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: