Repository navigation
Conversation
Signed-off-by: wangshun <96341168+xixi-box@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5870
Description
Every Docker skill snapshot adds a layer to the image used by the previous generation. On overlay2, this can eventually make skill installs, updates, and removals fail with
max depth exceeded.When the parent image reaches 96 filesystem layers, save the maintenance container's merged filesystem as a single-layer image. Preserve the image configuration, local skill tag, and labels used for discovery and cleanup. Existing deep snapshots can compact the next time they are used for skill maintenance. The adapter uses incremental commits for shallow skill snapshots and session forks. Compaction temporarily needs disk space on the WeKnora host for the exported filesystem.
Type of Change
Related Issue
Fixes #5870
Testing
Tests:
/bin/sh -c 'DOCKER_INTEGRATION_DEEP_IMAGE=weknora-oss-scout-deep:local go test -tags=docker_integration ./internal/sandbox -run '"'"'^TestDockerSkillSnapshotCompactsDeepImageIntegration$'"'"' -count=1 -v'.Result: go test ./internal/sandbox -count=1 exited 0 on the original sources (16.928s).
Result: DOCKER_INTEGRATION_DEEP_IMAGE=weknora-oss-scout-deep:local go test -tags=docker_integration ./internal/sandbox -run '^TestDockerSkillSnapshotCompactsDeepImageIntegration$' -count=1 -v exited 1 on base with 126 layers and 0 with the fix (3.566s for the patched package run).
Result: DOCKER_INTEGRATION_HOST=unix:///tmp/weknora-oss-docker.kNrLiI/docker.sock DOCKER_INTEGRATION_DEEP_IMAGE=weknora-oss-scout-deep:local go test -tags=docker_integration ./internal/sandbox -run '^TestDockerSkillSnapshotCompactsDeepImageIntegration$' -count=1 -v exited 1 on base with max depth exceeded and 0 with the fix (2.624s for the patched package run).
Result: go build ./internal/sandbox exited 0.
Result: go test -race -tags sqlite_fts5 ./internal/sandbox/... -count=1 exited 0 for sandbox, admission, allocation and workspace.
Result: go test -tags sqlite_fts5 ./internal/application/service -run 'Test.*(Skill|Snapshot|Maintenance|RunInstall|RunRemove|Reinstall)' -count=1 exited 0 (2.995s).
Result: go vet -tags 'sqlite_fts5,docker_integration' ./internal/sandbox/... exited 0.
Result: /tmp/weknora-oss-lint.wdvCrZ/golangci-lint run --build-tags=sqlite_fts5,docker_integration --new-from-patch=/tmp/weknora-oss-review.9YIiUn/sandbox.patch ./internal/sandbox/... exited 0 and reported 0 issues.
Regression coverage:
internal/sandbox/docker_integration_test.go.Checklist
git diff --check origin/main...HEADpassesgolangci-lint run --new-from-rev=origin/main ./...)website-docs/, Swagger annotations, etc.)Screenshots / Recordings