feat(dfctl): add task preheat command for image and file preheat#1781
Merged
feat(dfctl): add task preheat command for image and file preheat#1781
task preheat command for image and file preheat#1781Conversation
Add `dfctl task preheat` subcommand with two modes: - gRPC mode (default): directly calls scheduler's PreheatImage/PreheatFile RPCs - SDK mode (--request-sdk): uses Dragonfly SDK proxy for preheat Supports: - Image preheat via oci:// URL prefix - File preheat via http:// or https:// URL prefix - Optional scheduler address (--scheduler) - Optional parameters: platform, username, password, piece-length, tag, etc. Also adds preheat_image and preheat_file methods to SchedulerClient. Agent-Logs-Url: https://github.com/dragonflyoss/client/sessions/c4a70baf-75e8-4d6b-bee5-6bad61c2c6f2 Co-authored-by: gaius-qi <15955374+gaius-qi@users.noreply.github.com>
Agent-Logs-Url: https://github.com/dragonflyoss/client/sessions/c4a70baf-75e8-4d6b-bee5-6bad61c2c6f2 Co-authored-by: gaius-qi <15955374+gaius-qi@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
gaius-qi
April 13, 2026 04:27
View session
Signed-off-by: Gaius <gaius.qi@gmail.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1781 +/- ##
==========================================
- Coverage 44.43% 43.11% -1.33%
==========================================
Files 91 91
Lines 26054 26839 +785
==========================================
- Hits 11578 11571 -7
- Misses 14476 15268 +792
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds a new dfctl task preheat subcommand to trigger scheduler-side preheating for OCI images (oci://…) and file/object URLs, with both direct scheduler gRPC mode and an optional Request SDK (--request-sdk) mode.
Changes:
- Added
dfctl task preheatwith URL-scheme dispatch and extensive CLI flags for scheduler endpoint, auth, platform, piece length, scope, and timeouts. - Improved dfctl-family CLI error rendering by attempting to decode structured backend error details from gRPC status details.
- Updated
dragonfly-client-util::requestAPI to make request/response headers non-optional, and added a tiny OCI scheme constant in the backend crate.
Reviewed changes
Copilot reviewed 4 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
dragonfly-client/src/bin/dfctl/task.rs |
Adds task preheat command implementation and extends error formatting for task list/remove/preheat paths. |
dragonfly-client/src/bin/dfctl/persistent_task.rs |
Extends persistent task listing error formatting (backend error details + headers). |
dragonfly-client/src/bin/dfctl/persistent_cache_task.rs |
Extends persistent cache task listing error formatting (backend error details + headers). |
dragonfly-client/Cargo.toml |
Adds oci-client dependency for OCI reference parsing in dfctl preheat. |
dragonfly-client-util/src/request/mod.rs |
Makes GetRequest.header and GetResponse.header non-optional and updates internal handling accordingly. |
dragonfly-client-backend/src/oci.rs |
Introduces oci URL scheme constant. |
dragonfly-client-backend/src/lib.rs |
Exposes the new oci module. |
Cargo.lock |
Locks the new oci-client dependency. |
Signed-off-by: Gaius <gaius.qi@gmail.com>
Signed-off-by: Gaius <gaius.qi@gmail.com>
mingcheng
reviewed
Apr 13, 2026
hhhhsdxxxx
approved these changes
Apr 13, 2026
EvanCley
approved these changes
Apr 13, 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.
Adds
dfctl task preheatto trigger preheat of OCI images (oci://prefix) or files (http:///https://prefix) through the Dragonfly scheduler.Two modes
PreheatImage/PreheatFileRPCs.--request-sdk): Preheats via the Dragonfly SDK proxy — usesProxy.preheat()for images andProxy.get()for files fromdragonfly-client-util::request.Changes
dragonfly-client/src/grpc/scheduler.rs— Addedpreheat_imageandpreheat_filemethods toSchedulerClient, wrapping the proto RPCs fromdragonfly-api.dragonfly-client/src/bin/dfctl/task.rs— AddedPreheatvariant toTaskSubCommandwith URL-scheme-based dispatch and full CLI arg set (--scheduler,--request-sdk,--platform,--username,--password,--piece-length,--tag,--application,--timeout).dragonfly-client/Cargo.toml— Addedoci-clientworkspace dep for OCI reference parsing (manifest URL construction in gRPC mode).Usage