Envbuilder in Coder not using caches at all despite configuring CACHE_REPO
Hello, I am using coder with envbuilder but I seem to be getting 0 cache hits even when restarting the same workspace with 0 changes. I have configured
CACHE_REPO
to use an empty AWS ECR image repository and I see evbuilder successfully checking for caches and, supposedly,
Every single Dockerfile
step is ran even though I seem to be pushing layers to the cache repo every image build. Am I missing anything?5 Replies
<#1218291841145765949>
Category
Help needed
Product
Coder OSS (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
cc: @kyle
Can you give me the full output of two runs?
If possible, the image as well.
Yep, the image is
ghcr.io/coder/envbuilder:0.2.6
Shared the full logs with @kyle via dm. If needed for others can also go that route or create a smaller reproduceable example to share publicly
This is probably what we're all expecting but I also tested in envbuilder 0.2.9 with the same results.
My uneducated guess would be that the tagging is not behaving as intended for whatever reason. I would expect that these cache pull/push lines should all have the same image tag.
But they do seem to match between run 1 and 2 so it's curious that I seem to get 0 cache hits. 🤔
Think I might've figured this out. The tags which were reported in the logs as having been successfully pushed to the ECR repo were not actually being pushed.
I added additional permissions to the ECR repo and now I can see them. I'm about to retry to see how many cache hits I get.
It was:
It is now:
I'm not sure why I wasn't getting clearer errors from Kaniko previously when layer uploadds were presumeably failing 🤔
Yep, I am getting at least some cache hits now: #2: Found cached layer, extracting to filesystem
2m0.765828453s vs 5m13.460330402s 👍
Still getting this at the end which I'm not really sure about:
`#2: Error uploading layer to cache: open : no such file or directory
#2: :construction_site: Built image! [1m58.428319491s]
That last error is no longer happening on new workspaces 🤷♂️
I think I can consider this issue solved for my own case. Do you think it would be worth updating the docs with the ECR setup steps somewhere? If so I can create a PR and get more input there.
Not sure how much kaniko setup you wanna have in the envbuilder repoI think that'd be awesome. It's weird that the layers appeared to get pushed, but weren't actually.