chore: decouple Rust SDK from dstack core workspace#785
Merged
Conversation
Stop treating sdk/rust as a member of the dstack core workspace. The packages only share a protocol with guest-agent and do not need to be resolved when building guest binaries. - make sdk/rust a standalone workspace with its own lockfile - move no_std_check next to the SDK types it validates - drop sdk/rust rsync from the dstack-guest Yocto recipe - point SDK CI and crates.io publish at sdk/rust/Cargo.toml
Contributor
There was a problem hiding this comment.
Pull request overview
This PR decouples the public Rust SDK (sdk/rust) from the core dstack/ Cargo workspace so core builds (notably Yocto guest builds) no longer need to stage the SDK tree just for workspace resolution.
Changes:
- Create a standalone Cargo workspace under
sdk/rust(includingdstack-sdk,dstack-sdk-types, andno_std_check) with its ownCargo.lock. - Remove SDK crates from the core
dstack/workspace and stop Yocto guest builds from rsync’ingsdk/rust. - Update CI/release automation to use
--manifest-path sdk/rust/Cargo.tomlfor SDK checks and publishing.
Reviewed changes
Copilot reviewed 9 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| sdk/rust/Cargo.toml | Defines the new standalone SDK workspace and centralizes dependency versions. |
| sdk/rust/Cargo.lock | Adds an SDK-specific lockfile for the standalone workspace. |
| sdk/rust/types/Cargo.toml | Removes linkage to the core workspace so types are resolved via the SDK workspace. |
| sdk/rust/no_std_check/Cargo.toml | Marks the check crate as non-publishable and ties it to workspace deps. |
| sdk/rust/no_std_check/src/lib.rs | Adds a minimal #![no_std] compile check that imports dstack-sdk-types. |
| sdk/rust/README.md | Documents that sdk/rust is now a standalone Cargo workspace. |
| dstack/Cargo.toml | Removes SDK members and the dstack-sdk-types workspace dependency from core. |
| dstack/Cargo.lock | Regenerates lockfile after removing SDK crates from the core workspace graph. |
| os/yocto/layers/meta-dstack/recipes-core/dstack-guest/dstack-guest.bb | Stops staging sdk/rust into the Yocto guest build source tree. |
| .github/workflows/sdk.yaml | Updates SDK validation commands to target sdk/rust/Cargo.toml. |
| .github/workflows/rust-sdk-release.yml | Updates version checks to look at the SDK workspace instead of core workspace deps. |
| .github/scripts/cargo-publish-idempotent.sh | Publishes SDK crates using the SDK workspace manifest path. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
Summary
The public Rust SDK (
dstack-sdk/dstack-sdk-types) only talks to guest-agent over the wire. It is not a library dependency of the coredstack/crates, but it was listed as a workspace member, which forced every Yocto guest build to rsyncsdk/rustjust so Cargo could resolve the workspace.This PR splits the SDK into its own Cargo workspace so core builds no longer need that tree.
Changes
sdk/rustis now a standalone workspace (dstack-sdk,dstack-sdk-types,no_std_check) with its ownCargo.lock../sdk/rustmembers anddstack-sdk-typesfromdstack/Cargo.tomlno_std_checknext to the SDK types it validatesdstack-guest.bbonly stagesdstack/+ rootfs (no SDK rsync)sdk.yaml) and crates.io publish use--manifest-path sdk/rust/Cargo.tomlCI coverage (preserved)
sdk/run-tests.sh)SDK testsworkflowdstack-sdk-typesunit +no_std_testsdk/run-tests.sh+sdk.yamldstack-sdk-typessdk.yaml(wasm32-unknown-unknown)no_std_checkonthumbv6m-none-eabisdk.yamlrun-tests.shRust checks(no longer pulls SDK)Local verification
cargo check -p dstack-guest-agentin an isolateddstack/tree withoutsdk/presentcargo check -p dstack-sdk/cargo test -p dstack-sdk-typesundersdk/rustthumbv6m-none-eabichecks for SDK types /no_std_checkTest plan