Skip to content

feat(deploy): add deploy vps command - #141

Merged
AndreasGassmann merged 11 commits into
developfrom
feat/deploy-vps
Jul 20, 2026
Merged

feat(deploy): add deploy vps command#141
AndreasGassmann merged 11 commits into
developfrom
feat/deploy-vps

Conversation

@AndreasGassmann

@AndreasGassmann AndreasGassmann commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds acurast deploy vps — deploy an SSH-able "VPS" on an Acurast processor with a single command, no acurast.json required:

acurast deploy vps --image ubuntu24 --min-memory 2GB --min-storage 10GB \
  --min-compute-score 100 --authorized-ssh-key "ssh-ed25519 AAAA..."
  • Vendors the app-tunnel/cargo example (Shell runtime, dropbear SSH over the Acurast reverse tunnel) as a CLI-shipped template; start.sh gains optional SSH_AUTHORIZED_KEYauthorized_keys installation (password auth stays enabled).
  • Config synthesized in buildVpsConfig.ts from flags > VPS_* env vars (.env supported) > interactive wizard (@inquirer/prompts).
  • Image aliases ubuntu24 (noble, default) / ubuntu25 (questing) → pinned proot-distro tarballs with sha256.
  • Extracts executeDeployFlow from the deploy action so both commands share signer/balance/pricing/submission/progress logic (behavior-preserving refactor).
  • Enables commander positional options so flags shared with deploy (--dry-run, --min-memory, …) reach the subcommand instead of being consumed by the parent.
  • Connect info: optional --callback-url (e.g. webhook.watch) receives the started event with the exact SSH connect command; otherwise it's in the deployment logs (acurast devtools <id>).

Testing

  • test/buildVpsConfig.test.ts — 11 new unit tests (env precedence, flag mapping, alias table, validation errors, schema acceptance); full suite 63/63 green.
  • New e2e scenario 07-deploy-vps-dry-run.sh + vps.exp: non-interactive flags, VPS_* env vars, and the interactive wizard through a pseudo-tty, all with --dry-run.
  • Manual: wizard + non-interactive dry runs verified locally; deploy regression (flags before/after positional arg) verified.
  • Not yet done: real canary deploy + SSH login via key and password on a device — the authorized-key path needs on-device testing before hardening to key-only auth.

Deploy an SSH-able VPS on a processor without an acurast.json:
vendors the app-tunnel/cargo example (Shell runtime, dropbear over
the Acurast reverse tunnel) as a CLI-shipped template and
synthesizes the project config from flags, VPS_* env vars, or an
interactive wizard (precedence in that order).

- extract executeDeployFlow from the deploy action so both commands
  share signer/balance/pricing/submission logic
- enable positional options so flags shared with `deploy`
  (--dry-run, --min-memory, ...) reach the subcommand
- image aliases: ubuntu24 (noble, default) / ubuntu25 (questing),
  pinned proot-distro tarballs with sha256
- SSH auth: password and/or authorized key (SSH_AUTHORIZED_KEY
  written to authorized_keys by the template's start.sh)
DevTools log forwarding only works for NodeJS runtimes — the Shell
(cargo) runtime has no snippet to inject, so the post-deploy hint was
misleading. Since the tunnel hostname is generated on the processor and
there is no remote log access, a missing callback URL makes the SSH
connect command unrecoverable: warn, and in interactive mode require
confirmation before deploying without one.
executeDeployFlow decided whether to wait for EnvironmentVariablesSet
by checking config.includeEnvironmentVariables. `deploy vps` passes
env vars directly without listing them there, so the CLI exited right
after processor acknowledgement — killing the SDK's in-flight
setEnvVars submission. The processor never received NETWORK /
SSH_PASSWORD / CALLBACK_URL and the tunnel app aborted on startup.
Wizard answers are written as VPS_* variables (existing lines updated,
rest of the file preserved), so subsequent runs pre-fill from the
environment and skip the questions. Prompt only appears when the
wizard actually asked something.
The non-interactive benchmark gate returned before the dry-run exit,
so `--dry-run --non-interactive` with filters never printed
"Dry run, not deploying" (e2e scenario 07 failure). A dry run submits
nothing — skip the abort.
@AndreasGassmann
AndreasGassmann merged commit 2a33ca4 into develop Jul 20, 2026
3 checks passed
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.

1 participant