#I am getting some very surprising cache
1 messages · Page 1 of 1 (latest)
Cache misses on what parts? We still invalidate the cache for function calls once per-session, so they'd be expected there specifically
This for example:
func (t *Tmate) BuildEnvUbuntu() *Container {
return dag.
Container().
From("ubuntu").
WithEnvVariable("DEBIAN_FRONTEND", "noninteractive").
WithExec([]string{"apt-get", "update"}).
WithExec([]string{"apt-get", "install", "-y", "git-core"}).
WithExec([]string{"apt-get", "install", "-y", "build-essential"}).
WithExec([]string{"apt-get", "install", "-y", "pkg-config"}).
WithExec([]string{"apt-get", "install", "-y", "libtool"}).
WithExec([]string{"apt-get", "install", "-y", "libevent-dev"}).
WithExec([]string{"apt-get", "install", "-y", "libncurses-dev"}).
WithExec([]string{"apt-get", "install", "-y", "zlib1g-dev"}).
WithExec([]string{"apt-get", "install", "-y", "automake"}).
WithExec([]string{"apt-get", "install", "-y", "libssh-dev"}).
WithExec([]string{"apt-get", "install", "-y", "libmsgpack-dev"}).
WithExec([]string{"apt-get", "install", "-y", "autoconf"}).
WithExec([]string{"apt-get", "install", "-y", "libssl-dev"}).
WithMountedDirectory("/src", t.Source()).
WithWorkdir("/src")
}
I'm seeing every apt-get install being re-executed every time
or almost every time? not sure
Hm I can't repro running just that func w/ dagger call, all cached every time after the first (using v0.9.2)
There have been ~2 other times I can remember since I joined Dagger where someone was seeing this type of behavior where cache was invalidated every run, no one else could repro, and then when they cleared buildkit's cache the problem disappeared and could never be triggered again...
I've always wondered if buildkit's cache pruning logic could enter some degenerate state where it keeps pruning cache entries that were just added (which would explain why clearing the cache fixes it), but couldn't ever repro.
If you can get the logs of your engine, that could be helpful; there's information in there about pruning. docker logs dagger-engine-e860a74cd330097f if you're on v0.9.2, docker logs dagger-engine.dev if you're running off ./hack/dev