#Started having an issue with the go SDK
1 messages ยท Page 1 of 1 (latest)
@full flicker any code that we can use to reproduce?
It happens consistently Brian?
I'll have to extract the code out, shouldn't be too bad.
@obsidian urchin It's happening almost 100% of the time.
Tried updating the sdk and dagger engine to no avail.
Oooh looks like it might be related to cache volumes.
func WithAptCaching(c *dagger.Container, aptCache, aptLibCache *dagger.CacheVolume) *dagger.Container {
// We don't want these files to persist in the rootfs, so we create them in a tempdir and mount them in.
dir := c.Directory("/etc/apt/apt.conf.d").
WithNewFile("docker-clean", ""). // overwrite the default docker-clean file
WithNewFile("docker-gzip-indexes", ""). // overwrite the default docker-gzip-indexes file
WithNewFile("keep-cache", "Binary::apt::APT::Keep-Downloaded-Packages \"true\";").
WithNewFile("update-success", fmt.Sprintf(`APT::Update::Post-Invoke-Success { "mkdir -p %s; touch %s"; };`, filepath.Dir(aptUpdatedPath), aptUpdatedPath))
return c.WithMountedFile("/etc/apt/apt.conf.d/docker-clean", dir.File("docker-clean")).
WithMountedFile("/etc/apt/apt.conf.d/docker-gzip-indexes", dir.File("docker-gzip-indexes")).
WithMountedFile("/etc/apt/apt.conf.d/keep-cache", dir.File("keep-cache")).
WithMountedFile("/etc/apt/apt.conf.d/update-success", dir.File("update-success")).
WithMountedCache("/var/cache/apt", aptCache).
WithMountedCache("/var/lib/apt", aptLibCache)
}
Commenting out the call to this fixes it, which is strange because it was working just fine.
And it's not even running those commands it just gets stuck after resolving the base image's config
Not the cache volumes, it just seems to not like the quantity of mounts.
Maybe the query is too big?
Changing that the 2nd half of that to just mount the directory above it directly instead of each file + the caches seems to resolve it.
it'd be surprised about that. Maybe buildkit is becoming numb about that. I'll try to do a small repro
Maybe triggered something with the weird mounts (write files to dir then mount those files to the same-ish dir).
But it was absolutely ๐ฏ working yesterday so I'm not sure.
The work-around is not terribly different, just less of it.
This does seem to be related to the number of chained items.
๐ will investigate next week for sure. I'll open an issue so I don't forget
@full flicker now a different chain operation seems be affecting it?
@obsidian urchin Yes we had to simplify some execs to get unstuck again.
Working on a repro... it's not purely the number of chained items perhaps but there's some apparent correlation.
I can hit 5 iterations with that.
If I remove 2 of the mounted files from WithAptCaching I can get 6.
If I change WithAptCaching to mount the directory instead of each individual file I can get 7.
Makes me think something isn't working the way I expect it to with the directory reference.
Changing WithAptCaching to use WithDirectory instead of WithMountedDirectory it's better.
And with that change there's no real difference with or without WithAptCaching called.
hmm good to know. Now I'll try to do the same with a Dockerfile and see if it seems to be a buildkit or Dagger limitation of some sort.
cc @glacial mulch @sour fossil @flint tide you'll find this interesting as well.