Skip to content

Add mieweb exec for running a command in a managed guest - #30

Merged
horner merged 1 commit into
mainfrom
feat/manager-guest-exec
Dec 4, 2026
Merged

horner merged 1 commit into
mainfrom
feat/manager-guest-exec

Conversation

@horner

@horner horner commented Dec 4, 2026

Copy link
Copy Markdown
Member

Closes mieweb/opensource-server#541. Companion Manager and OS provider change: mieweb/opensource-server#543.

Run a command in an existing guest from a laptop or CI runner using the current Manager login.

mieweb exec --site 1 --container 42 -- node --version
  • Add an optional provider method for a one-shot guest command. The CLI forwards the executable and every argument after -- literally, including empty strings, spaces, and guest flags such as --target.
  • Write guest stdout and stderr to the corresponding streams and propagate the process exit code. Truncation and request errors have explicit diagnostics. An unknown outcome after dispatch never triggers an automatic retry.
  • Document provider support and return a clear error for unsupported targets and old OS providers.

Verification

The CLI tests cover flags on either side of the separator, binary output, nonzero statuses, truncation, missing or old providers and transport errors. Workspace tests, typechecking and the packed CLI install smoke test passed. Tested the built OS provider end to end against the companion Manager and an unprivileged Linux LXC guest with no guest SSH route.

Release order

Release the Manager and OS provider from the companion PR first. The current npm provider (2026.12.1) predates exec. Install the provider preview in the test project for joint review. Before publishing the CLI, set its bundled provider dependency and lockfile to the first stable release containing exec.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Release coordination needs human confirmation because companion PR #543 remains unmerged and bundled provider 2026.12.1 lacks exec, requiring verification of deployment order and an exec-capable stable dependency and lockfile before publishing.

No open issues 🎉

1 file not reviewed
  • pnpm-lock.yaml: Generated file
What changed in this PR

Adds mieweb exec to run a one-shot command in a managed guest through the active provider and Manager login.

Changes:

  • Adds an optional provider exec contract and CLI command that preserve arguments, output bytes, and guest exit status.
  • Adds validation, failure diagnostics, and CLI tests.
  • Documents usage, provider compatibility, and release requirements.
File Description
README.md Introduces guest exec usage.
pnpm-lock.yaml Updates the locked OS provider dependency.
packages/​deploy-contract/​src/​index.ts Defines exec requests, results, and optional provider capability.
packages/​cli/​test/​exec.test.mjs Tests arguments, streams, statuses, and failures.
packages/​cli/​src/​index.mjs Routes exec and preserves arguments after --.
packages/​cli/​src/​exec.mjs Implements exec validation, dispatch, and output handling.
packages/​cli/​README.md Documents authentication, usage, diagnostics, and provider support.
packages/​cli/​package.json Updates the OS provider dependency range.
.changeset/​manager-guest-exec.md Records minor releases for the new capability.

Review effort: Balanced

@horner
horner merged commit 663d0f1 into main Dec 4, 2026
6 checks passed
@horner
horner deleted the feat/manager-guest-exec branch December 4, 2026 09:50
@horner

horner commented Dec 4, 2026 •

Copy link
Copy Markdown
Member Author

I verified the release dependency using the published PR artifacts. CLI 0.5.1-pr30.39 with OS provider 0.1.0-pr543.71.1 sent one POST to a loopback Manager fixture, preserved an empty argument and a literal --target, returned binary stdout and separate stderr, and propagated exit 23. CLI preview build · OS provider preview build

The npm stable version and this branch’s lockfile both resolve to @mieweb/os-cloud-provider@2026.12.1. I loaded that version and confirmed it lacks exec. The release order in the PR description still applies. Land Manager and provider #543, deploy Manager and configure the target node, publish the exec-capable provider to npm, then update the CLI dependency minimum and lockfile to that stable version before publishing. This CLI change has merged. The pending version PR #31 is the release step. The verified preview pair is available for review in the meantime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support mieweb exec in running containers through the Manager API

2 participants