Repository navigation
feat(cli): enable remote-sandbox sends one custom image for every matching cloud - #767
Conversation
The configure request is now { customImage?, maxLifetimeSeconds?,
azureIdleSuspendSeconds? }. --image or the --src build result is the
custom image. Without a flag the command keeps the saved custom image and
lifetime; it no longer carries a per-cloud Azure source.
The platform API spec copied into client-sdks/platform is taken from an
unreleased API version for local testing.
A bare enable on default images resends the saved azureIdleSuspendSeconds so it does not return to the default. With a custom image, saved or passed, it is not sent: the API refuses the two together.
An invalid --image or saved custom image now reports the value and the field it came from. The bare-enable test saves a custom-image row the way the API returns one, without an Azure source.
|
Comments Outside DiffThese findings could not be posted inline.
|
…ote-sandbox-every-ready-cloud-by-default-one-optional # Conflicts: # client-sdks/platform/openapi.json # client-sdks/platform/rust/openapi-3.0.json # client-sdks/platform/rust/openapi.json
|
@greptile review On the TypeScript client finding: this is deliberate and listed under "Before this merges" in the description. The three spec files here come from an API version that isn't released yet, so this PR can't merge until they are copied again from the released spec. The TypeScript client is regenerated from that released spec with the pinned Speakeasy CLI, as #751 did. Regenerating it now would bake unreleased schema into the published package. The Rust CLI in this PR is the only consumer that changes, and it builds against the updated spec. |
|
@greptile review |
1 similar comment
|
@greptile review |
The API accepts azureIdleSuspendSeconds together with customImage, so `enable remote-sandbox` resends the saved idle time whether or not a custom image is in effect, instead of letting it fall back to the default.
|
@greptile review |
…ote-sandbox-every-ready-cloud-by-default-one-optional
…ote-sandbox-every-ready-cloud-by-default-one-optional
…e and no catalog image
A public image runs on AWS from its linux/arm64 variant, and on Azure and GCP from its linux/amd64 variant. An image pushed with --src is private and runs on AWS only. A bare enable resends the Azure idle time saved beside a custom image.
|
@greptile review |
…ote-sandbox-every-ready-cloud-by-default-one-optional
Summary
alien projects capabilities enable remote-sandboxnow sends one optional custom image plus limits, not a source per cloud, and the API runs that image on every cloud it has a matching variant for. A bareenablekeeps the settings already saved on the project.Step-by-step flow when you run
alien projects capabilities enable remote-sandbox [--image <ref> | --src <dir>] [--max-session-lifetime-seconds N]:{ customImage?, maxLifetimeSeconds, azureIdleSuspendSeconds? }: each flag replaces its saved value, and anything without a flag keeps the saved one. ← the changeThis PR changes the request from per-cloud sources (
baseImage,azure) to one optional custom image.What I did
customImageis--image, or the image--srcbuilds and pushes. Without either, the saved custom image is sent again. With none saved, the request has no image and every ready cloud runs the default images.--srcis private and runs on AWS only. The--imageand--srchelp says this.maxLifetimeSecondsis the flag, else the saved value, else 3600.Files touched
crates/alien-cli/src/commands/platform/projects.rs: the request, how saved settings are carried over, the help text, and the tests.client-sdks/platform/openapi.json,client-sdks/platform/rust/openapi.json,client-sdks/platform/rust/openapi-3.0.json: copied unchanged from the released Platform API spec. The copy also brings in other API changes released since the last copy, such as the ECS bootstrap write check and new operations and package fields.client-sdks/platform/rust/tests/remote_sandbox_azure_registry_image.rs: the Rust client decodes a project whose Azure settings name a registry image and no catalog image.The TypeScript Platform SDK (
client-sdks/platform/typescript) is not regenerated here yet. The pinned Speakeasy CLI needs a one-time interactive login, and the regeneration follows as a separate commit.How I tested
alienbinary against a local API with the new request schema and a real database, across 16 combinations of saved settings and flags. Every request was accepted and every stored row parsed back. That API came from before the final server change, so the idle time beside a custom image is covered by the tests below, not by that run.cargo test -p alien-clipasses (340 lib tests). The tests cover each flag and saved-value combination, and three runs against a mock API that check the exact body a bareenablesends: default images with a saved Azure idle time, a saved custom image, and a saved custom image that also runs on Azure.cargo test -p alien-platform-apipasses; the new registry-image test does not compile against the previous spec.pnpm buildpasses (withNODE_OPTIONS=--max-old-space-size=12288, as the SDK generator uses; the default heap runs out on the TypeScript SDK build), and the Platform TypeScript SDK script tests pass (20).--srcbuild and push through the project's private registry was not rerun. That path is unchanged here apart from where its result goes in the request.