Repository navigation
Description
Problem
Managed BuildKit outputs used by one-off data synthesis jobs accumulate in the internal Registry after their tasks finish. Stopping a builder or sandbox does not reclaim these remote images. Without an explicit retention contract, repeated trials and retries can eventually fill the Registry disk.
A private deployment encountered this capacity issue. Expanding its disk restored service, and a fresh build → push → sandbox creation → execution/content verification passed. Existing images and authentication were preserved. This issue tracks the missing lifecycle mechanism, not an ongoing service outage. No existing images should be deleted as part of opening this issue.
Here, Harbor means the agent evaluation/task harness, not the Harbor container-registry product.
Source observations
Inspected AKernel develop: 753b5861.
- Managed publication pushes native Nydus OCI outputs under generated build tags and records immutable digest references.
- build_image() cleans up its temporary builder. Its returned BuiltImage has no task retention/release contract.
- The managed-runtime contract explicitly excludes automatic Registry artifact GC. Sandboxd's node-local live/checkpoint leases protect managed collections; they do not authorize remote Registry deletion.
- The pinned ADX checkpoint deletion guard checks checkpoint references and input holds. OCI image dependencies need an explicit connection to that lifecycle.
- The inspected Harbor checkout (
5d5e58a2a5d65c6f46edbd47008b38a5f5f4c1c0) retries the entire trial, with backoff between attempts. An individual environment's stop is therefore not the logical task's final completion. No built-in AKernel environment adapter was found in that checkout; integration must use the actual adapter/extension point.
These are source observations, not evidence that the proposed cleanup already exists.
Proposed minimal design
Keep the internal Registry as the temporary publication store; moving ephemeral outputs to ACR is not required.
- Task ownership: the harness/adapter assigns a stable logical task owner across attempts. Final success, exhausted retries, or cancellation releases this owner after required results/logs have been persisted. Per-attempt sandbox cleanup must not release the whole retry group.
- Durable artifact receipt: AKernel records the owner, publication identity, exact repository/digest, and retention state. Register ownership before publication and reconcile committed outputs, including partial pushes and lost responses. Keep authoritative state outside the SDK process and temporary builder. Reuse existing durable control-plane storage where appropriate rather than introducing a separate artifact platform.
- Reference protection: running, queued/preparing, paused, and restoring consumers, retained checkpoints/Snapshots, and reusable templates where applicable retain all required image dependencies, including managed Compose service images. Reuse local leases for local cleanup, but do not treat them alone as a complete remote reference inventory.
- Grace period: start a configurable grace period only after final task release and the last protected reference disappears. A suggested initial default for explicitly ephemeral tasks is 24 hours, subject to measured workloads. Explicit debug retention/pinning overrides expiry. Do not expire images merely because their build timestamp is old.
- Safe reclamation: a small periodic reconciler produces candidates and deletes eligible manifests through a narrowly scoped operator identity. Reference acquisition must be fenced against deletion; a new valid consumer cancels pending expiry. Unknown references or an unreachable owner/control plane defer deletion. A crashed client or heartbeat timeout alone is insufficient authority to delete.
- Physical space recovery: manifest deletion and Registry blob GC are separate operations. Use a supported no-writer/read-only maintenance procedure for GC, account for OCI/Nydus dependency graphs and shared blobs, and report actual reclaimed bytes. BuildKit and Dragonfly cache eviction remain separate mechanisms.
Provide a small explicit release/extend-retention API, with SDK/adapter wrappers. Exact API names and storage layout remain implementation choices. Do not hand Registry deletion credentials to task sandboxes.
Delivery stages
- Add durable task/publication ownership and reference inventory; expose read-only candidates, retention reasons, and unknown/protected states.
- Add idempotent task-finalization and explicit retention/release operations in the actual harness integration.
- Qualify reference/deletion concurrency and operator manifest deletion + Registry GC in isolation.
- Enable automatic short retention only for newly opted-in ephemeral publications, initially in dry-run mode. Preserve existing behavior for other callers and keep legacy/unowned images protected until separately reviewed.
Acceptance criteria
- Finalized, unreferenced ephemeral outputs become reclaimable after the configured grace period; deletion and physical reclamation are observable separately.
- No deletion during execution, retry backoff, preparation, pause/restore, or retained checkpoint/Snapshot/template use.
- Cover concurrent acquire versus delete, client/harness crash, control-plane restart, failed/partial publication, lost completion responses, and idempotent reconciliation.
- Two tasks sharing an image or blobs remain independent: finishing one cannot break the other.
- Retained managed checkpoints still restore and required Nydus blobs remain available; no cross-node portability claim is implied.
- Legacy images, unrelated repositories, operator-owned images, and pinned debug artifacts remain untouched.
- Validate actual disk reclamation under the supported GC procedure, preserving auth and surviving manifests; publish operational guidance and capacity metrics.
This issue requests a lifecycle enhancement. It does not authorize deleting current images, enabling age-only pruning, or changing the current Registry/ACR deployment.
Activity
rcyw commentedon Nov 17, 2026
Two linked draft PRs were opened for the initial implementation.
The scope is a general AKernel SDK and Registry lifecycle. Existing calls retain their behavior and enrollment requires an explicit opt-in. Caller holds survive SDK exit and sandbox deletion. Lost contact and partial publication keep the artifact protected. Operators can observe candidates and run a dry run while deletion is disabled. A separate operator process handles Registry requests, with separate procedures for manifest deletion and physical garbage collection.
The initial validation passed 547 SDK unit tests, 35 benchmark driver tests, 64 runtime adapter tests, Ruff, and mypy. The backend passed 43 core tests, 45 Coordinator library tests, a real Redis AOF restart, three mTLS RPC regressions, and workspace Clippy. A dedicated Redis instance and a fresh Distribution Registry verified concurrent reference protection, recovery after partial manifest deletion, denial of deletion by ordinary callers, and garbage collection with writers stopped. GC reclaimed 2,109,440 bytes, while shared blobs and an unenrolled fixture image remained readable. The isolated test containers and child processes were cleaned up.
At this stage, the remaining work was to qualify the native Nydus and sandboxd build, checkpoint, publisher release, source deletion, and restore path, then consume the matching formal ADX release and tools. Production activation and Registry maintenance require their own review. Both PRs were drafts when this update was posted, and the issue remained open.
All validation ran in isolation. Existing clusters, authentication, runtimes, images, and historical data were preserved.
rcyw commentedon Nov 17, 2026
The native qualification passed on AKernel commit
959ae6c20d112efc1f13be327bda48f7c20c7f80in a dedicated Linux/amd64 runsc environment.runtime-6run deleted 3 manifests. Physical allocation fell from 229,208,064 to 226,779,136 bytes, reclaiming 2,428,928 bytes. The surviving manifests and 6 blobs passed verification, and a fresh consumer started from the retained image. Independent checks confirmed that the test containers, network, mount, and loop device were cleaned up. Backing files and evidence were retained.acdecb0eb9077cfce5c054f23cb4ae06451a1206. The real Redis restart and three mTLS RPC regressions are now wired into the standard CI gate. The remote CodeCheck reported unit tests, system tests, and packaging as N/A. The local Rust checks and integration regressions passed. agent-dx #332Formal release integration remains pending. The native test used a complete local ADX candidate with matching static Execd and rootfs. A maintainer needs to merge the backend PR, and the CI repository's
mastermust contain the merged change. The next integration step is to verify matching Platform and Execd archives from the same formal build, update both AKernel Dockerfiles and the ADX gitlink together, and qualify the rebuilt combination. The AKernel PR remains a draft with its current release pins. AKernel #169The coordination record contains the source provenance, failed attempts, operating tradeoffs, and handoff steps. All validation ran in isolation and preserved existing clusters, authentication, images, and historical data. Production activation and garbage collection across the production storage domain require separate review.
rcyw commentedon Nov 18, 2026
The follow-up fixes are on agent-dx #332 at
6b148869and AKernel #169 at45fe40f. The implementation supports the direct AKernel SDK and Registry workflow.The new candidate passed the Redis/mTLS regressions and isolated Registry tests, including partial publication recovery and interrupted deletion. Both ordinary Nydus and two-service Compose resumed the original checkpointed processes. Privately scoped test GC released 2,428,928 bytes in the native run, and the retained image and shared blobs were verified. All 11 current AKernel CI checks passed, including Standalone E2E. CI run
The ADX PR is Ready for review. The AKernel PR remains a draft pending the upstream merge and integration of verified Platform and Execd release archives. Existing clusters, images, and historical data were preserved.
rcyw commentedon Nov 18, 2026
CodeCheck passed for agent-dx #332 at
6b148869d0f995027bd1189c8b2c21562f3d30fc. The report shows successful static analysis, blacklist scanning, anti-poisoning, open-source compliance, and Ruff checks. CodeCheck reportThe upstream PR is still open. AKernel #169 remains a draft pending the merge and verification of the matching official Platform and Execd archives. The release integration will be validated in a fresh isolated environment. Upstream PR · AKernel PR
rcyw commentedon Nov 20, 2026
The Agent DX review is complete in agent-dx #332. The Coordinator owns the Redis admission fence for execution dependencies, including native snapshot preparation. AKernel owns the builder, Registry layout, and reconciliation of interrupted writes. Completed reclamation returns active capacity while preserving the original request identity.
f7f373d350d91c2588da19b6dfd38c65678f3a5epassed the focused Redis/mTLS regressions, workspace Clippy, and exact-head CodeCheck. GitCode !256 has the same head, and #332 is ready for upstream review.71fb53220f813e1b05683537c17e01e68cb7eb87passed the isolated Nydus and two-service Compose checkpoint loop. Both restored the original processes. The Nydus case also passed after a control-plane restart. The public API refused a scheme-prefixed reference to a reclaimed repository before scheduling. Three scoped manifest deletions were followed by physical GC that released 2,478,080 bytes. Six retained blobs and a fresh survivor were verified.AKernel #169 remains a draft pending the upstream merge and integration of the matching official Platform and Execd archives. All 11 checks in the current-head AKernel CI passed, including Standalone E2E with the existing release pins. The official-archive combination will have its own isolated and CI verification. Existing clusters, images, and historical data were preserved.