Envbuilder with Kubernetes: image cache not working
Layer caching appears to work fine. And I see both the image cache and layer caches in my DockerHub private registry (see screenshoot)
I'm just using the example template in Coder called
kubernetes-devcontainer
https://github.com/coder/coder/blob/main/examples/templates/kubernetes-devcontainer/main.tf
However, when starting a workspace, I get this:
And when I stop a workspace I get this:
I did ENVBUILDER_GET_CACHED_IMAGE=1
and the workspace logs says it sees the matched image in the registry, but the build goes into an endless loop which I get since the probe should be occurring in the build, and not with a manual set of the env var.
Thanks teamGitHub
coder/examples/templates/kubernetes-devcontainer/main.tf at main ·...
Provision remote development environments via Terraform - coder/coder

7 Replies
Hey Mark, what repo are you using? I've found there can be issues with caching when using features.
(@sharkymark)
EDIT: sorry for the failed ping to the other Mark
@Cian @Phorcys Hi guys. I have a simple fork of the example repo https://github.com/sharkymark/envbuilder-starter-devcontainer with no features. I have a flask one as well. https://github.com/sharkymark/envb-flask-hw
I've tried various envbuilder images, including the preview in dogfood's template with the same result.
My K8s is on colima on a mac, but oddly I see the image and layers in my dockerhub cache repo as I said earlier and the GET env var saw the image.
thanks
GitHub
GitHub - sharkymark/envbuilder-starter-devcontainer: A sample proje...
A sample project for getting started with devcontainer.json in envbuilder - sharkymark/envbuilder-starter-devcontainer
GitHub
GitHub - sharkymark/envb-flask-hw
Contribute to sharkymark/envb-flask-hw development by creating an account on GitHub.
I'm experiencing the same issue with a template based on the
kubernetes-devcontainer
sample.
Layers are pushed as expected to cache_repo
as well. When the workspace is restarted, the cached image is never found and a rebuild is always triggered:
I've removed devcontainers' features
as it was reported that they're not cacheable:
TL;DR features are not cacheable at the moment.Ref: https://github.com/coder/terraform-provider-envbuilder/issues/68#issuecomment-2557247792 The same issue still happens, though.
GitHub
RUN command is not supported in cache probe mode · Issue #68 · co...
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? Failed to fi...
@0xg4b for the features side of things, yeah it's just not going to cache them, but not fail completely
we are looking into this
Hi, the behaviour you're seeing is expected if the envbuilder terraform provider is unable to recreate the build. This can happen for a number of reasons. It would be simplest to troubleshoot if you provided a minimal example and opened a bug in github.com/coder/terraform-provider-envbuilder
But it's likely a similar issue as Mark's that was posted above -- I have seen instances where a build cannot be recreated even without features.