Repository navigation
solver: add compatibility-version support - #6681
Conversation
e0c7dff to
427b3da
Compare
c82db21 to
2168893
Compare
Add solve-wide compatibility-version support for image and oci exports, with historical goldens and release compatibility tests. Backfill version 10 for v0.13-v0.14 git artifact behavior, keep version 20 as current, and reject unsupported zstd on v10. Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
5f71f4d to
e06aab8
Compare
|
@AkihiroSuda @apyrgio These were the only two cases I found starting from v0.13 :
Are you aware of any more? If so, we can add extra coverage. Note that this ignores changes based on the Dockerfile frontend. For these changes, we should save the version of Dockerfile frontend in provenance and to reproduce, one needs to use gateway frontend with the same dockerfile version instead. |
e06aab8 to
3b3d323
Compare
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
3b3d323 to
9e1a2df
Compare
|
Thanks for the heads up Tonis! I've started looking into Buildkit reproducibility since 0.19.0, and all I've found is the change in the Dockerfile frontend that you mentioned. I still have a CI test that runs nightly and builds a golden image, but it hasn't picked up any other discrepancies. |
Move compatibility-releases to a single job that reuses the integration test image flow from the main test workflow. Add hack/test support for injecting a buildkitd binary and add a dedicated hack/test-compatibility-releases wrapper for the release sweep. Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
| defer repo.Release() | ||
|
|
||
| ref, err := gs.checkout(ctx, repo, g) | ||
| ref, err := gs.checkout(ctx, repo, g, compatibilityVersion) |
There was a problem hiding this comment.
Now that the git snapshot contents depend on compatibilityVersion, I think the source cache key needs to depend on it too no?
CacheKey() and snapshotKey are still derived only from the git ref/subdir, so a solve that populates the git source cache under the current compatibility mode can be reused by a v10 solve, and vice versa iiuc. In that case we would skip this compatibility-specific checkout normalization and return the wrong tree from cache.
Maybe we can fold compatibilityVersion into the git source cache identity here (either in shaToCacheKey or in snapshotKey)?
| compatibilityVersion := 0 | ||
| if jobCtx != nil { | ||
| var err error | ||
| compatibilityVersion, err = jobCtx.CompatibilityVersion() | ||
| if err != nil { | ||
| return nil, err | ||
| } | ||
| } |
There was a problem hiding this comment.
I think there is a second issue here beyond the persisted git snapshot key.
Seems CompatibilityVersion() errors on mixed versions, and gitSourceHandler.Snapshot() reads compatibility from the shared jobCtx.
That might be an edge case but solver active states are still keyed by the normal vertex digest, so two concurrent solves of the same git source under different compatibility versions can still merge into one active state and fail or I'm missing smth?
There was a problem hiding this comment.
The LLB op itself should guarantee that the cache key is stable and new attributes are needed for behavior change. This is a bugfix case.
Compatibility version needs to be per build so it can be stored in provenance as a single value and used as a parameter for subsequent builds.
Add solve-wide compatibility-version support for image and oci exports, with historical goldens and release compatibility tests.
Backfill version 10 for v0.13-v0.14 git artifact behavior, keep version 20 as current, and reject unsupported zstd on v10.