Repository navigation
feat: add image-aware DeleteImage to dfdaemon and image to Download - #697
Merged
Merged
Conversation
Introduce the `common.v2.Image` message (canonical reference and os/arch platform) and the optional `image` field in `Download`, so a peer records the tasks it downloads for an OCI image as referenced by that image. Add `DeleteImage` to the `DfdaemonUpload` and `DfdaemonDownload` services. It deletes the tasks of the image in the peer except the ones still referenced by other images, and returns the deleted and retained task ids. Add the optional `image` field to `PreheatImageRequest`, so the scheduler passes the image to the peers it preheats. Regenerate the Go, Rust and Python bindings and the Go mocks, and bump the version to 2.3.9. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Gaius <gaius.qi@gmail.com>
gaius-qi
requested review from
BruceAko,
ClementMaH,
chlins,
fcgxz2003,
xujihui1985 and
yxxhero
November 10, 2026 03:51
CormickKneey
approved these changes
Nov 10, 2026
CormickKneey
enabled auto-merge (squash)
November 10, 2026 03:59
hhhhsdxxxx
approved these changes
Nov 10, 2026
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.
Description
API for image-aware deletion. A peer records which OCI image each downloaded task belongs to.
DeleteImagethen deletes only the tasks that no other cached image on that peer still references.Image { reference, platform }message.Downloadgainsoptional Image image = 36, the next free field afterscheduling_policy = 35.DeleteImageRequest { Image image, optional remote_ip }andDeleteImageResponse { deleted_task_ids, retained_task_ids }.rpc DeleteImageis added to bothDfdaemonUploadandDfdaemonDownload.PreheatImageRequestgainsoptional common.v2.Image image = 21, so the scheduler can pass the image to the peers it preheats.referenceneedsmin_len: 1,platformmust match^[a-z0-9]+/[a-z0-9]+$, andDeleteImageRequest.imageis required.hack/protoc.sh), Rust (cargo build) and Python (hack/protoc-python.sh) bindings and the Go mocks (go generate), and bumped the version to 2.3.9.All changes are additive.
imageis not part of the task ID calculation.Related Issue
None.
Motivation and Context
Today
DeleteImagein dragonfly-sdk resolves the image again from the registry and deletes every manifest and blob task. That also deletes blobs shared with other cached images, and when the tag has moved it deletes the wrong blobs. With this API, each dfdaemon keeps the image-to-task references locally and decides itself which tasks are safe to delete. The design follows containers/storageDeleteImage(reachability is checked at delete time) and containerd's content GC references.Verified with
go build ./...,go vet ./pkg/apis/...,cargo clippy --release -- -D warnings, and an import smoke test of the Python bindings. A throwaway Go test (not committed) checked the new validation rules onDeleteImageRequest,ImageandDownload.cargo fmt --checkalready fails on main for the generatedsrc/*.rs, and this PR does not change that.🤖 Generated with Claude Code