Skip to content

add hack tool to run Substrate against a locally-built runsc - #726

Open
Jing (milantracy) wants to merge 2 commits into
agent-substrate:mainfrom
milantracy:hack
Open

add hack tool to run Substrate against a locally-built runsc#726
Jing (milantracy) wants to merge 2 commits into
agent-substrate:mainfrom
milantracy:hack

Conversation

@milantracy

Copy link
Copy Markdown
Contributor

atelet fetches runsc at runtime from a url + sha256 on a cluster-scoped SandboxConfig, so trying an unreleased build needs no image rebuild — but there was no supported way to stage one, and the resolution path it would rely on was untested.

the tool is modelled on hack/microvm-assets/: deploy.sh hashes a local runsc, stages it (rustfs on kind, GCS on GKE), applies a SandboxConfig pinning it, and optionally repoints a WorkerPool. gvisor-default is left untouched; pools opt in via sandboxConfigName.

So an unreleased gVisor feature can be tested in a cluster without hand-staging binaries or hand-writing a SandboxConfig.

hack/gvisor-hack/stage-to-gcs.sh
fi

# Two defaults for one sandbox class make every actor launch fail to resolve its

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 should-fix 🟡 – Demoting before applying swaps a two-default cluster for a zero-default one, and if the apply on line 130 fails the cluster stays that way. TestResolveSandboxAssetsErrors pins both as failures ("multiple default SandboxConfigs" and "no default SandboxConfig"), so every gVisor pool relying on the default stops resolving assets either way — but the two-default window closes on the next patch, while a failed apply leaves zero defaults until someone notices.

That is reachable: NAME is an unvalidated env var, so a name the API server rejects gets you there, as does any transient apply failure. The script exits on the apply error without mentioning that it just cleared gvisor-default, and the README's Reverting section only covers the success path.

A server-side dry run before the demote loop would close it — the ValidatingAdmissionPolicy runs under --dry-run=server, so the config is known good before the incumbent is touched.

Comment thread docs/api-guide.md Outdated
atelet fetches runsc at runtime from a url + sha256 on a cluster-scoped
SandboxConfig, so trying an unreleased build needs no image rebuild —
but there was no supported way to stage one, and the resolution path it
would rely on was untested.

hack/gvisor-hack/ adds it, modelled on hack/microvm-assets/: deploy.sh
hashes a local runsc, stages it (rustfs on kind, GCS on GKE), applies a
SandboxConfig pinning it, and optionally repoints a WorkerPool.
gvisor-default is left untouched; pools opt in via sandboxConfigName.
Objects are content-addressed so a rebuild cannot serve new bytes behind
an old digest, and MAKE_DEFAULT demotes the incumbent default first,
since two defaults for one class break asset resolution.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants