Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
ci(os): tag guest-OS releases os-v<version>
dstackup, dstack-cloud, tools/dev-stack.sh and the docs download guest
images from guest-os-v<version> releases, but the mkosi workflow
published them as mkosi-os-v<version>, so dstackup never found a 0.6+
image. The separate prefix only kept the mkosi trigger apart from the
Yocto workflow, which is gone.

Tag guest-OS releases os-v<version>, matching kms-v, gateway-v and the
other components. The 0.6.0 to 0.6.7 releases stay where they are and
are referenced by others, so the consumers pick mkosi-os-v<version> for
those versions and os-v<version> after.

dstackup also took the first .tar.gz asset that was not a UKI or dev
image. GitHub lists dstack-<v>-kernel-devel.tar.gz first, so it would
have downloaded the kernel build tree instead of the image; skip it.

Signed-off-by: Kevin Wang <wy721@qq.com>
  • Loading branch information
kvinwang committed Dec 2, 2026
commit 28d166ac846d20a659377b463bcd5cd1c2a30071
21 changes: 9 additions & 12 deletions .github/workflows/mkosi-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
name: Build Guest Images (mkosi)

# Publishing is bound to the tag, not to a workflow input: pushing
# mkosi-os-v<version> is the only event that creates a GitHub Release. Every
# os-v<version> is the only event that creates a GitHub Release. Every
# other trigger builds and reports the hashes without publishing anything, so a
# dry run can never be mistaken for a release.
on:
Expand All @@ -26,7 +26,7 @@ on:
# is gated by its own `if`, so an unfiltered push trigger is cheap.
push:
branches: [next, 'release/**']
tags: ['mkosi-os-v*']
tags: ['os-v*']

concurrency:
group: mkosi-build-${{ github.ref }}
Expand Down Expand Up @@ -54,7 +54,7 @@ jobs:
# The full image build takes ~40 minutes, so keep it off the PR path.
if: >-
github.event_name == 'workflow_dispatch' ||
startsWith(github.ref, 'refs/tags/mkosi-os-v')
startsWith(github.ref, 'refs/tags/os-v')
needs: static
runs-on: ubuntu-latest
timeout-minutes: 360
Expand Down Expand Up @@ -279,7 +279,7 @@ jobs:
name: Kernel module builder image
if: >-
github.event_name == 'workflow_dispatch' ||
startsWith(github.ref, 'refs/tags/mkosi-os-v')
startsWith(github.ref, 'refs/tags/os-v')
needs: build
runs-on: ubuntu-latest
timeout-minutes: 30
Expand Down Expand Up @@ -309,21 +309,21 @@ jobs:
"dist/dstack-$VERSION-kernel-devel.tar.gz" "ghcr.io/$owner/dstack-kernel-builder:$VERSION"

- name: Log in to GitHub Container Registry
if: startsWith(github.ref, 'refs/tags/mkosi-os-v')
if: startsWith(github.ref, 'refs/tags/os-v')
uses: docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550 # v4.8.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Push the builder image
if: startsWith(github.ref, 'refs/tags/mkosi-os-v')
if: startsWith(github.ref, 'refs/tags/os-v')
run: docker push "$IMAGE"

release:
name: Publish release
# The tag is the publish decision. Nothing else reaches this job.
if: startsWith(github.ref, 'refs/tags/mkosi-os-v')
if: startsWith(github.ref, 'refs/tags/os-v')
needs: [build, kernel-builder]
runs-on: ubuntu-latest
timeout-minutes: 30
Expand All @@ -349,8 +349,8 @@ jobs:
OS_IMAGE_HASH: ${{ needs.build.outputs.os_image_hash }}
run: |
set -euo pipefail
echo "$TAG" | grep -Eq '^mkosi-os-v[0-9]+\.[0-9]+\.[0-9]+([-.][0-9A-Za-z.-]+)?$'
version="${TAG#mkosi-os-v}"
echo "$TAG" | grep -Eq '^os-v[0-9]+\.[0-9]+\.[0-9]+([-.][0-9A-Za-z.-]+)?$'
version="${TAG#os-v}"
# shellcheck source=/dev/null
source os/mkosi/versions.env
if [ "$version" != "$DSTACK_VERSION" ]; then
Expand Down Expand Up @@ -419,9 +419,6 @@ jobs:
#
# --prerelease is kept until release maintainers promote a stable
# mkosi-built release; dropping the flag is a release decision.
#
# The title names the product, not the build backend that the
# mkosi-os-v tag prefix names.
gh release create "$TAG" \
"dist/dstack-$VERSION.tar.gz" \
"dist/dstack-$VERSION-uki.tar.gz" \
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- **`dstackup install` finds 0.6+ guest-OS releases.** Guest-OS releases are
now tagged `os-v<version>`, like the `kms-v` and `gateway-v` components.
`dstackup`, `dstack-cloud`, `tools/dev-stack.sh` and the docs look up
`os-v<version>`, and `mkosi-os-v<version>` for 0.6.0 through
0.6.7; before, they asked for `guest-os-v<version>`, which never existed.
`dstackup` also no longer picks a release's `-kernel-devel` archive as the
image.
- **`ports:` works under the `nerdctl-compose` runner.** The mkosi guest
kernel now builds `xt_multiport`, which the CNI portmap plugin needs, and
the runner accepts DNATed connections that Docker's `FORWARD` policy
Expand Down
5 changes: 3 additions & 2 deletions docs/amd-sev-snp.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ Guest OS releases are split at the monorepo boundary:
[`Dstack-TEE/meta-dstack`](https://github.com/Dstack-TEE/meta-dstack/releases)
under tags such as `v0.5.11`;
- versions 0.6.0 and later are in
[`Dstack-TEE/dstack`](https://github.com/Dstack-TEE/dstack/releases?q=guest-os-v)
under tags such as `guest-os-v0.6.0`.
[`Dstack-TEE/dstack`](https://github.com/Dstack-TEE/dstack/releases?q=os-v)
under tags such as `os-v0.6.8`; 0.6.0 through 0.6.7 are tagged
`mkosi-os-v<version>`.

The 0.5.x images are legacy TDX images, not the current unified SEV-SNP image
line. Use a 0.6.6-or-later image for SEV-SNP. The image must include
Expand Down
2 changes: 1 addition & 1 deletion docs/onboarding.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Run:
sudo dstackup install
```

`dstackup install` auto-detects TDX or AMD SEV-SNP. If no local guest image exists, it downloads the latest unified image from [dstack guest-OS releases](https://github.com/Dstack-TEE/dstack/releases?q=guest-os-v), requires the release SHA-256 digest by default, verifies the tarball, stages the unpack, and only then adopts the image. Current images include NVIDIA support conditionally and work on CPU-only hosts too. Pinned versions below 0.6.0 are read directly from the archived [`meta-dstack` releases](https://github.com/Dstack-TEE/meta-dstack/releases); versions 0.6.0 and later come from this repository.
`dstackup install` auto-detects TDX or AMD SEV-SNP. If no local guest image exists, it downloads the latest unified image from [dstack guest-OS releases](https://github.com/Dstack-TEE/dstack/releases?q=os-v), requires the release SHA-256 digest by default, verifies the tarball, stages the unpack, and only then adopts the image. Current images include NVIDIA support conditionally and work on CPU-only hosts too. Pinned versions below 0.6.0 are read directly from the archived [`meta-dstack` releases](https://github.com/Dstack-TEE/meta-dstack/releases); versions 0.6.0 and later come from this repository.

On TDX, `dstackup install` starts the SGX key provider automatically from `/usr/local/share/dstack/local-key-provider/build`. To use a different provider, pass one of:

Expand Down
6 changes: 3 additions & 3 deletions docs/rc-testing-runbook.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ push by hand — do not push those tags.
- Pre-run the release job's own validation locally before tagging:

```bash
TAG=mkosi-os-v<version>
echo "$TAG" | grep -Eq '^mkosi-os-v[0-9]+\.[0-9]+\.[0-9]+([-.][0-9A-Za-z.-]+)?$'
source os/mkosi/versions.env && [ "${TAG#mkosi-os-v}" = "$DSTACK_VERSION" ]
TAG=os-v<version>
echo "$TAG" | grep -Eq '^os-v[0-9]+\.[0-9]+\.[0-9]+([-.][0-9A-Za-z.-]+)?$'
source os/mkosi/versions.env && [ "${TAG#os-v}" = "$DSTACK_VERSION" ]
```

The release job also requires `metadata.json`'s `git_revision` to equal the
Expand Down
2 changes: 1 addition & 1 deletion docs/testing-dstackup-image-pull.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ curl -fsS -X POST \
http://localhost:8000/__admin/repos/Dstack-TEE/dstack/releases \
-H 'content-type: application/json' \
-d '{
"tag_name": "guest-os-v99.0.0",
"tag_name": "os-v99.0.0",
"assets": [{"local_path": "/tmp/dstack-99.0.0.tar.gz"}]
}'
```
Expand Down
6 changes: 4 additions & 2 deletions docs/tutorials/guest-image-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,13 @@ echo "Installing guest images for version: $DSTACK_VERSION"

# Download the image archive
cd /tmp
IFS=. read -r DSTACK_MAJOR DSTACK_MINOR _ <<< "$DSTACK_VERSION"
IFS=. read -r DSTACK_MAJOR DSTACK_MINOR DSTACK_PATCH <<< "$DSTACK_VERSION"
if (( DSTACK_MAJOR == 0 && DSTACK_MINOR < 6 )); then
IMAGE_URL="https://github.com/Dstack-TEE/meta-dstack/releases/download/v${DSTACK_VERSION}/dstack-${DSTACK_VERSION}.tar.gz"
elif (( DSTACK_MAJOR == 0 && DSTACK_MINOR == 6 && DSTACK_PATCH <= 7 )); then
IMAGE_URL="https://github.com/Dstack-TEE/dstack/releases/download/mkosi-os-v${DSTACK_VERSION}/dstack-${DSTACK_VERSION}.tar.gz"
else
IMAGE_URL="https://github.com/Dstack-TEE/dstack/releases/download/guest-os-v${DSTACK_VERSION}/dstack-${DSTACK_VERSION}.tar.gz"
IMAGE_URL="https://github.com/Dstack-TEE/dstack/releases/download/os-v${DSTACK_VERSION}/dstack-${DSTACK_VERSION}.tar.gz"
fi
wget "$IMAGE_URL"
```
Expand Down
6 changes: 4 additions & 2 deletions docs/tutorials/troubleshooting-dstack-installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -347,11 +347,13 @@ Try alternative download methods:

```bash
# Using curl instead of wget
IFS=. read -r DSTACK_MAJOR DSTACK_MINOR _ <<< "$DSTACK_VERSION"
IFS=. read -r DSTACK_MAJOR DSTACK_MINOR DSTACK_PATCH <<< "$DSTACK_VERSION"
if (( DSTACK_MAJOR == 0 && DSTACK_MINOR < 6 )); then
IMAGE_URL="https://github.com/Dstack-TEE/meta-dstack/releases/download/v${DSTACK_VERSION}/dstack-${DSTACK_VERSION}.tar.gz"
elif (( DSTACK_MAJOR == 0 && DSTACK_MINOR == 6 && DSTACK_PATCH <= 7 )); then
IMAGE_URL="https://github.com/Dstack-TEE/dstack/releases/download/mkosi-os-v${DSTACK_VERSION}/dstack-${DSTACK_VERSION}.tar.gz"
else
IMAGE_URL="https://github.com/Dstack-TEE/dstack/releases/download/guest-os-v${DSTACK_VERSION}/dstack-${DSTACK_VERSION}.tar.gz"
IMAGE_URL="https://github.com/Dstack-TEE/dstack/releases/download/os-v${DSTACK_VERSION}/dstack-${DSTACK_VERSION}.tar.gz"
fi
curl -L -o dstack-${DSTACK_VERSION}.tar.gz \
"$IMAGE_URL"
Expand Down
61 changes: 42 additions & 19 deletions dstack/crates/dstackup/src/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

//! `dstackup image` — fetch, list, and remove guest OS images.
//!
//! Images are published as `guest-os-v*` release tarballs in the dstack
//! monorepo. Current releases use one hardware-adaptive `dstack-<ver>` image;
//! Images are published as `os-v*` release tarballs in the dstack
//! monorepo (`mkosi-os-v*` for 0.6.0 through 0.6.7). Current releases use one hardware-adaptive `dstack-<ver>` image;
//! legacy releases may also contain `dstack-nvidia-<ver>` variants.
//! `install` validates the selected image against `digest.txt`, the OS image
//! hash used on all platforms. HTTP + checksum are native (reqwest is
Expand All @@ -25,8 +25,11 @@ use std::time::SystemTime;

const REPO: &str = "Dstack-TEE/dstack";
const LEGACY_REPO: &str = "Dstack-TEE/meta-dstack";
const RELEASE_TAG_PREFIX: &str = "guest-os-v";
pub(crate) const RELEASES_URL: &str = "https://github.com/Dstack-TEE/dstack/releases?q=guest-os-v";
const RELEASE_TAG_PREFIX: &str = "os-v";
/// Tag prefix of the guest-OS releases up to `MKOSI_TAGGED_LAST_VERSION`.
const MKOSI_RELEASE_TAG_PREFIX: &str = "mkosi-os-v";
const MKOSI_TAGGED_LAST_VERSION: (u64, u64, u64) = (0, 6, 7);
pub(crate) const RELEASES_URL: &str = "https://github.com/Dstack-TEE/dstack/releases?q=os-v";
const LEGACY_RELEASES_URL: &str = "https://github.com/Dstack-TEE/meta-dstack/releases";
const MONOREPO_GUEST_OS_MIN_VERSION: (u64, u64, u64) = (0, 6, 0);

Expand Down Expand Up @@ -642,10 +645,10 @@ async fn fetch_release(version: Option<&str>, release_api_base_url: &str) -> Res
.json()
.await
.context("parsing dstack release list")?;
if let Some(release) = releases
.into_iter()
.find(|release| release.tag_name.starts_with(RELEASE_TAG_PREFIX))
{
if let Some(release) = releases.into_iter().find(|release| {
release.tag_name.starts_with(RELEASE_TAG_PREFIX)
|| release.tag_name.starts_with(MKOSI_RELEASE_TAG_PREFIX)
}) {
return Ok(release);
}

Expand All @@ -660,11 +663,14 @@ fn tagged_release_location(
release_api_base_url: &str,
) -> Result<(String, String, &'static str)> {
let version = version
.trim_start_matches(MKOSI_RELEASE_TAG_PREFIX)
.trim_start_matches(RELEASE_TAG_PREFIX)
.trim_start_matches('v');
let core = numeric_version_core(version)?;
let (repo, tag_prefix, releases_url) = if core < MONOREPO_GUEST_OS_MIN_VERSION {
(LEGACY_REPO, "v", LEGACY_RELEASES_URL)
} else if core <= MKOSI_TAGGED_LAST_VERSION {
(REPO, MKOSI_RELEASE_TAG_PREFIX, RELEASES_URL)
} else {
(REPO, RELEASE_TAG_PREFIX, RELEASES_URL)
};
Expand Down Expand Up @@ -721,10 +727,10 @@ async fn fetch_tagged_release(
))
}

/// Pick a full bare-metal image tarball, never the `-uki` archive. For a GPU
/// request, prefer a legacy `dstack-nvidia-*` asset when present and otherwise
/// use the current unified image (which already contains conditional NVIDIA
/// support).
/// Pick a full bare-metal image tarball, never the `-uki` or `-kernel-devel`
/// archive. For a GPU request, prefer a legacy `dstack-nvidia-*` asset when
/// present and otherwise use the current unified image (which already contains
/// conditional NVIDIA support).
fn pick_asset(assets: &[Asset], gpu: bool) -> Option<&Asset> {
// `-dev` marks the dev *flavour*, which only ever appears as a name prefix
// (`dstack-dev-*`, `dstack-nvidia-dev-*`). Matching it as a bare substring
Expand All @@ -734,7 +740,11 @@ fn pick_asset(assets: &[Asset], gpu: bool) -> Option<&Asset> {
|n: &str| n.starts_with("dstack-dev-") || n.starts_with("dstack-nvidia-dev-");
let matches = |a: &&Asset, want_legacy_gpu: bool| {
let n = a.name.as_str();
if !n.ends_with(".tar.gz") || n.ends_with("-uki.tar.gz") || is_dev_flavour(n) {
if !n.ends_with(".tar.gz")
|| n.ends_with("-uki.tar.gz")
|| n.ends_with("-kernel-devel.tar.gz")
|| is_dev_flavour(n)
{
return false;
}
let is_gpu = n.starts_with("dstack-nvidia-");
Expand Down Expand Up @@ -841,10 +851,16 @@ mod tests {

#[test]
fn gpu_pull_falls_back_to_unified_image() {
// The order GitHub lists a guest-OS release's assets in.
let assets = vec![
asset("dstack-0.6.0-kernel-devel.tar.gz"),
asset("dstack-0.6.0-uki.tar.gz"),
asset("dstack-0.6.0.tar.gz"),
];
assert_eq!(
pick_asset(&assets, false).unwrap().name,
"dstack-0.6.0.tar.gz"
);
assert_eq!(
pick_asset(&assets, true).unwrap().name,
"dstack-0.6.0.tar.gz"
Expand Down Expand Up @@ -895,7 +911,7 @@ mod tests {

#[test]
fn routes_pinned_releases_at_the_monorepo_boundary() {
for version in ["0.5.11", "v0.5.11", "guest-os-v0.5.11"] {
for version in ["0.5.11", "v0.5.11", "os-v0.5.11"] {
let (normalized, url, releases_url) =
tagged_release_location(version, crate::cli::DEFAULT_RELEASE_API_BASE_URL).unwrap();
assert_eq!(normalized, "0.5.11");
Expand All @@ -906,13 +922,20 @@ mod tests {
assert_eq!(releases_url, LEGACY_RELEASES_URL);
}

for version in ["0.6.0", "0.6.0.a2", "1.0.0"] {
for (version, tag) in [
("0.6.0", "mkosi-os-v0.6.0"),
("0.6.7", "mkosi-os-v0.6.7"),
("mkosi-os-v0.6.5", "mkosi-os-v0.6.5"),
("0.6.8", "os-v0.6.8"),
("os-v0.6.8-rc1", "os-v0.6.8-rc1"),
("1.0.0", "os-v1.0.0"),
] {
let (normalized, url, releases_url) =
tagged_release_location(version, crate::cli::DEFAULT_RELEASE_API_BASE_URL).unwrap();
assert_eq!(normalized, version);
assert!(tag.ends_with(&format!("-v{normalized}")), "{version}");
assert_eq!(
url,
format!("https://api.github.com/repos/Dstack-TEE/dstack/releases/tags/guest-os-v{version}")
format!("https://api.github.com/repos/Dstack-TEE/dstack/releases/tags/{tag}")
);
assert_eq!(releases_url, RELEASES_URL);
}
Expand All @@ -931,10 +954,10 @@ mod tests {
#[test]
fn release_api_base_url_is_configurable_and_trailing_slash_safe() {
let (_, url, _) =
tagged_release_location("0.6.0", " http://127.0.0.1:1234/api/ ").unwrap();
tagged_release_location("0.6.8", " http://127.0.0.1:1234/api/ ").unwrap();
assert_eq!(
url,
"http://127.0.0.1:1234/api/Dstack-TEE/dstack/releases/tags/guest-os-v0.6.0"
"http://127.0.0.1:1234/api/Dstack-TEE/dstack/releases/tags/os-v0.6.8"
);
}

Expand Down
5 changes: 4 additions & 1 deletion dstack/scripts/bin/dstack-cloud
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ GLOBAL_CONFIG_PATH = os.path.expanduser(
)
DEFAULT_OS_IMAGE = "dstack-0.6.0"
MONOREPO_GUEST_OS_MIN_VERSION = (0, 6, 0)
# 0.6.0 through 0.6.7 were released under mkosi-os-v<version> tags.
MKOSI_TAGGED_LAST_VERSION = (0, 6, 7)
AWS_EBS_BLOCK_SIZE = 512 * 1024
AWS_EBS_UPLOAD_WORKERS = 8
AWS_EBS_UPLOAD_QUEUE_DEPTH = AWS_EBS_UPLOAD_WORKERS * 2
Expand All @@ -103,9 +105,10 @@ def guest_os_release_url(os_image: str, version: str) -> str:
"https://github.com/Dstack-TEE/meta-dstack/releases/download/"
f"v{version}/{os_image}-uki.tar.gz"
)
prefix = "mkosi-os-v" if core <= MKOSI_TAGGED_LAST_VERSION else "os-v"
return (
"https://github.com/Dstack-TEE/dstack/releases/download/"
f"guest-os-v{version}/{os_image}-uki.tar.gz"
f"{prefix}{version}/{os_image}-uki.tar.gz"
)


Expand Down
2 changes: 1 addition & 1 deletion os/image/mk-image-mr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ set -euo pipefail
usage() {
local status=${1:-1}
echo "Usage: ${0##*/} <url_or_local_file>"
echo "Example: $0 https://github.com/Dstack-TEE/dstack/releases/download/guest-os-v0.6.0/dstack-0.6.0.tar.gz"
echo "Example: $0 https://github.com/Dstack-TEE/dstack/releases/download/mkosi-os-v0.6.7/dstack-0.6.7.tar.gz"
echo "Example: $0 /path/to/local/file.tar.gz"
exit "$status"
}
Expand Down
6 changes: 5 additions & 1 deletion tools/dev-stack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -309,10 +309,14 @@ guest_os_release_url() {

local MAJOR=$((10#${BASH_REMATCH[1]}))
local MINOR=$((10#${BASH_REMATCH[2]}))
local PATCH=$((10#${BASH_REMATCH[3]}))
if (( MAJOR == 0 && MINOR < 6 )); then
echo "https://github.com/Dstack-TEE/meta-dstack/releases/download/v$VERSION/$BASENAME.tar.gz"
elif (( MAJOR == 0 && MINOR == 6 && PATCH <= 7 )); then
# 0.6.0 through 0.6.7 were released under mkosi-os-v<version> tags.
echo "https://github.com/Dstack-TEE/dstack/releases/download/mkosi-os-v$VERSION/$BASENAME.tar.gz"
else
echo "https://github.com/Dstack-TEE/dstack/releases/download/guest-os-v$VERSION/$BASENAME.tar.gz"
echo "https://github.com/Dstack-TEE/dstack/releases/download/os-v$VERSION/$BASENAME.tar.gz"
fi
}

Expand Down
Loading