Repository navigation
microvm-assets: upload the kata assets through the node that hosts rustfs - #2905
Closed
Davanum Srinivas (dims) wants to merge 1 commit into
Closed
Davanum Srinivas (dims) wants to merge 1 commit into
Davanum Srinivas (dims) wants to merge 1 commit into
Conversation
Davanum Srinivas (dims)
marked this pull request as ready for review
October 19, 2026 20:31
Davanum Srinivas (dims)
force-pushed
the
microvm-assets-rustfs-node
branch
10 times, most recently
from
October 27, 2026 12:31
01d86c7 to
9245345
Compare
Davanum Srinivas (dims)
force-pushed
the
microvm-assets-rustfs-node
branch
from
October 28, 2026 11:04
9245345 to
e962ca6
Compare
…stfs stage-to-rustfs.sh ran the S3 client in the netns of the first kind node. rustfs's NetworkPolicy admits a node address only on the node that hosts rustfs, so on a multi-node kind cluster the upload timed out unless the first node happened to be that one. The script now picks the rustfs pod's node and falls back to the first node when the pod is not found. Signed-off-by: Davanum Srinivas <[email protected]>
Davanum Srinivas (dims)
force-pushed
the
microvm-assets-rustfs-node
branch
from
October 30, 2026 11:19
e962ca6 to
60a34fe
Compare
Huy Pham (hdp617)
pushed a commit
to hdp617/substrate
that referenced
this pull request
Oct 30, 2026
…strate#2092) Stacked on agent-substrate#1838. ## Summary Ports the microVM dependency setup (`hack/install-microvm-deps.sh` and `hack/microvm-assets/`) to Go, and folds microVM asset assembly, staging, and `SandboxConfig` management directly into `deploy ate-system`, `deploy sandboxconfig`, and `delete ate-system`. ## Changes - **Fold microVM setup into control-plane deploy/delete (`cmd/ate-setup/internal/steps/deploy.go`, `delete.go`, `benchmarks.go`)**: - Calls `prepareMicroVMDeps` (before cluster resources are modified) and `applyMicroVMSandboxConfig` inside `DeployAteSystem` (after applying the system bundle so Kind's in-cluster `rustfs` Deployment and `rustfs-bucket-init` Job exist before asset staging) and inside `DeploySandboxConfig`. - Adds `--sandbox-classes` (default `gvisor,microvm`) to `ate-setup deploy ate-system` and `ate-setup deploy sandboxconfig` (`--sandbox-classes=gvisor` opts out of staging microVM assets and applying `SandboxConfig/microvm`). - Releases `SandboxConfig` protection finalizers inside `DeleteAteSystem` before CRD teardown when no `WorkerPool` references the config. - Updates `DeployBenchmarks` / `DeleteBenchmarks` since `deploy ate-system` now installs both `gvisor-default` and `microvm` `SandboxConfig`s up front, and checks that `sandboxconfig/microvm` exists when `--sandbox-class=microvm`. - **Remove `hack/install-microvm-deps.sh` and `hack/microvm-assets/`**: - Deletes `hack/install-microvm-deps.sh` and the entire `hack/microvm-assets/` directory (`assemble.sh`, `stage-to-gcs.sh`, `stage-to-rustfs.sh`, and `README.md`). - Updates `hack/run-microvm-demo.sh`, `benchmarking/automation/orchestrator.py`, and `.github/workflows/pr-workflow.yaml` to rely on `deploy ate-system`. - **Native Go multi-arch microVM asset assembly and staging (`cmd/ate-setup/internal/steps/microvm.go`)**: - Streams and extracts the Kata `.tar.zst` archive (`vmlinux.container`, `kata-containers-ubuntu.img` as `rootfs.img`, `virtiofsd`) and Cloud Hypervisor binary in Go (`runtime.GOARCH` on Kind; both `amd64` and `arm64` on non-Kind clusters) into `bin/microvm-assets/<arch>/`. - Checks the SHA-256 digests of all four assets (`cloud-hypervisor`, `virtiofsd`, `vmlinux`, `rootfs.img`) against the digests pinned in `manifests/ate-install/sandboxconfig-microvm.yaml.tmpl` (both after assembly and when reusing a cached `.asset-versions` directory). - Stages assets by content digest under `microvm-assets/<arch>/<sha256>` in Kind's `rustfs` bucket or GKE's `<bucket>-assets` GCS bucket, then renders and applies `manifests/ate-install/sandboxconfig-microvm.yaml.tmpl`. - **Docs, manifests & unit tests**: - Moves `sandboxconfig-microvm.yaml.tmpl` to `manifests/ate-install/sandboxconfig-microvm.yaml.tmpl` with per-arch `microvm-assets/<arch>/<sha256>` URLs and removes stale version-number comments. - Folds the remaining asset-set and snapshot-location notes from `hack/microvm-assets/README.md` into `docs/dev/microvm-local.md` and updates `docs/reference/api-guide.md`, `docs/guides/operator-install.md`, `cmd/ate-setup/README.md`, `cmd/ate-setup/commands.md`, `cmd/ate-setup/differences.md`, `demos/counter/README.md`, and `hack/release/draft-release.sh`. - Adds unit tests in `cmd/ate-setup/internal/steps/microvm_test.go`, `cmd/ate-setup/internal/steps/benchmarks_test.go`, `cmd/ate-setup/internal/kube/wait_test.go`, and `cmd/ate-setup/internal/cmd/deploy_test.go`. ## Testing - Run `go test -race ./cmd/ate-setup/... ./internal/e2e/...` and `hack/verify-all.sh`. - Local Kind cluster verification (`go run ./cmd/ate-setup --kind`): - Verified `deploy ate-system --sandbox-classes=gvisor` deploys the control plane and installs only `SandboxConfig/gvisor-default`. - Verified `deploy ate-system` assembles the microVM guest assets, stages them into the in-cluster `rustfs` bucket, and applies `SandboxConfig/microvm` alongside `SandboxConfig/gvisor-default` (reusing cached assets via `.asset-versions` on subsequent runs). - Verified `delete all` removes `SandboxConfig/microvm` during control-plane teardown before deleting CRDs. - Deployed `deploy demo counter` and ran `./hack/run-e2e-kind.sh ./internal/e2e/suites/demo`. ## Folded in from open PRs Because this PR replaces `hack/microvm-assets/stage-to-rustfs.sh` with `stageMicroVMAssetsToRustfs`, it folds in the `stage-to-rustfs.sh` fixes from two open PRs: - agent-substrate#2905 (@dims): look up the `app=rustfs` pod's `spec.nodeName` so the S3 upload container runs in the node network namespace admitted by rustfs's NetworkPolicy on multi-node Kind clusters. - agent-substrate#1122 (@ygao-g): use `net.JoinHostPort(svc.Spec.ClusterIP, "9000")` for `AWS_ENDPOINT_URL` so IPv6 ClusterIPs are bracketed. AI Use: AI assisted implementation & unit testing, human reviewed, refined, and locally tested. --------- Signed-off-by: Noah West <[email protected]> Co-authored-by: jybao <[email protected]>
Collaborator
Author
Collaborator
Author
|
The fix lives on in the Go port: #2092 folded it into |
Dmitry Berkovich (dberkov)
pushed a commit
that referenced
this pull request
Nov 2, 2026
Stacked on #1838. ## Summary Ports the microVM dependency setup (`hack/install-microvm-deps.sh` and `hack/microvm-assets/`) to Go, and folds microVM asset assembly, staging, and `SandboxConfig` management directly into `deploy ate-system`, `deploy sandboxconfig`, and `delete ate-system`. ## Changes - **Fold microVM setup into control-plane deploy/delete (`cmd/ate-setup/internal/steps/deploy.go`, `delete.go`, `benchmarks.go`)**: - Calls `prepareMicroVMDeps` (before cluster resources are modified) and `applyMicroVMSandboxConfig` inside `DeployAteSystem` (after applying the system bundle so Kind's in-cluster `rustfs` Deployment and `rustfs-bucket-init` Job exist before asset staging) and inside `DeploySandboxConfig`. - Adds `--sandbox-classes` (default `gvisor,microvm`) to `ate-setup deploy ate-system` and `ate-setup deploy sandboxconfig` (`--sandbox-classes=gvisor` opts out of staging microVM assets and applying `SandboxConfig/microvm`). - Releases `SandboxConfig` protection finalizers inside `DeleteAteSystem` before CRD teardown when no `WorkerPool` references the config. - Updates `DeployBenchmarks` / `DeleteBenchmarks` since `deploy ate-system` now installs both `gvisor-default` and `microvm` `SandboxConfig`s up front, and checks that `sandboxconfig/microvm` exists when `--sandbox-class=microvm`. - **Remove `hack/install-microvm-deps.sh` and `hack/microvm-assets/`**: - Deletes `hack/install-microvm-deps.sh` and the entire `hack/microvm-assets/` directory (`assemble.sh`, `stage-to-gcs.sh`, `stage-to-rustfs.sh`, and `README.md`). - Updates `hack/run-microvm-demo.sh`, `benchmarking/automation/orchestrator.py`, and `.github/workflows/pr-workflow.yaml` to rely on `deploy ate-system`. - **Native Go multi-arch microVM asset assembly and staging (`cmd/ate-setup/internal/steps/microvm.go`)**: - Streams and extracts the Kata `.tar.zst` archive (`vmlinux.container`, `kata-containers-ubuntu.img` as `rootfs.img`, `virtiofsd`) and Cloud Hypervisor binary in Go (`runtime.GOARCH` on Kind; both `amd64` and `arm64` on non-Kind clusters) into `bin/microvm-assets/<arch>/`. - Checks the SHA-256 digests of all four assets (`cloud-hypervisor`, `virtiofsd`, `vmlinux`, `rootfs.img`) against the digests pinned in `manifests/ate-install/sandboxconfig-microvm.yaml.tmpl` (both after assembly and when reusing a cached `.asset-versions` directory). - Stages assets by content digest under `microvm-assets/<arch>/<sha256>` in Kind's `rustfs` bucket or GKE's `<bucket>-assets` GCS bucket, then renders and applies `manifests/ate-install/sandboxconfig-microvm.yaml.tmpl`. - **Docs, manifests & unit tests**: - Moves `sandboxconfig-microvm.yaml.tmpl` to `manifests/ate-install/sandboxconfig-microvm.yaml.tmpl` with per-arch `microvm-assets/<arch>/<sha256>` URLs and removes stale version-number comments. - Folds the remaining asset-set and snapshot-location notes from `hack/microvm-assets/README.md` into `docs/dev/microvm-local.md` and updates `docs/reference/api-guide.md`, `docs/guides/operator-install.md`, `cmd/ate-setup/README.md`, `cmd/ate-setup/commands.md`, `cmd/ate-setup/differences.md`, `demos/counter/README.md`, and `hack/release/draft-release.sh`. - Adds unit tests in `cmd/ate-setup/internal/steps/microvm_test.go`, `cmd/ate-setup/internal/steps/benchmarks_test.go`, `cmd/ate-setup/internal/kube/wait_test.go`, and `cmd/ate-setup/internal/cmd/deploy_test.go`. ## Testing - Run `go test -race ./cmd/ate-setup/... ./internal/e2e/...` and `hack/verify-all.sh`. - Local Kind cluster verification (`go run ./cmd/ate-setup --kind`): - Verified `deploy ate-system --sandbox-classes=gvisor` deploys the control plane and installs only `SandboxConfig/gvisor-default`. - Verified `deploy ate-system` assembles the microVM guest assets, stages them into the in-cluster `rustfs` bucket, and applies `SandboxConfig/microvm` alongside `SandboxConfig/gvisor-default` (reusing cached assets via `.asset-versions` on subsequent runs). - Verified `delete all` removes `SandboxConfig/microvm` during control-plane teardown before deleting CRDs. - Deployed `deploy demo counter` and ran `./hack/run-e2e-kind.sh ./internal/e2e/suites/demo`. ## Folded in from open PRs Because this PR replaces `hack/microvm-assets/stage-to-rustfs.sh` with `stageMicroVMAssetsToRustfs`, it folds in the `stage-to-rustfs.sh` fixes from two open PRs: - #2905 (@dims): look up the `app=rustfs` pod's `spec.nodeName` so the S3 upload container runs in the node network namespace admitted by rustfs's NetworkPolicy on multi-node Kind clusters. - #1122 (@ygao-g): use `net.JoinHostPort(svc.Spec.ClusterIP, "9000")` for `AWS_ENDPOINT_URL` so IPv6 ClusterIPs are bracketed. AI Use: AI assisted implementation & unit testing, human reviewed, refined, and locally tested. --------- Signed-off-by: Noah West <[email protected]> Co-authored-by: jybao <[email protected]> (cherry picked from commit 8edd9ae) Signed-off-by: Eitan Yarmush <[email protected]>
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.
stage-to-rustfs.shran the S3 upload in the netns of the first kind node. rustfs's NetworkPolicy admits a node address only on the node that hosts rustfs, so on a multi-node kind cluster the upload timed out unless the first node happened to be that one, and the micro-VM install failed at its deps step. A single-node kind cluster, the shape CI runs, never shows it.The script now picks the rustfs pod's node and falls back to the first node when the pod is not found.
Verified with a from-source install on a kind cluster of one control-plane and four worker nodes: the deps step had failed at the upload before the change and passed with it, and the install's smoke test passed. Shell syntax and shellcheck are clean.