Desktop foundation / core (ubuntu-latest) (push) Failing after 28s
Desktop foundation / core (macos-latest) (push) Canceled after 0s
Desktop foundation / core (windows-latest) (push) Canceled after 0s
Linux / verify (push) Canceled after 0s
Linux / keyless-cuda (push) Canceled after 0s
Linux / static-cuda-package (push) Canceled after 0s
Linux / hosted-cuda-package (push) Canceled after 0s
Linux / linux-static-cli (push) Canceled after 0s
Linux / linux-cli-container (push) Canceled after 0s
Linux / release-cli (push) Canceled after 0s
123 lines
7.6 KiB
Markdown
123 lines
7.6 KiB
Markdown
# SSH preflight
|
||
|
||
`strata-desktop remote-inspect /absolute/private/ssh-profile.json` reads server
|
||
resources using system OpenSSH. Copy `examples/ssh-profile.json` and supply a host
|
||
or trusted SSH config alias. Null user/port/identity fields defer to OpenSSH's
|
||
configuration/agent. Identity paths must be absolute; keys are referenced, never
|
||
embedded. There is no password field. Keep real profiles outside Git.
|
||
|
||
This command sends a fixed read-only POSIX shell script over SSH stdin. It reads
|
||
Linux OS/architecture, CPU/count/features, RAM, NVIDIA memory/driver and available
|
||
disk space on the SSH user's current/home filesystem. Recheck the actual model
|
||
destination filesystem during provisioning. Non-NVIDIA GPU/NPU and engine
|
||
capabilities remain unknown, not inferred from the client hardware. No Python,
|
||
model request, process restart, package installation or persistent agent occurs.
|
||
|
||
Known-host verification is strict; establish and verify trust in the usual SSH
|
||
flow first. Agent forwarding, configured forwards and LocalCommand are disabled.
|
||
Batch mode avoids password prompts; the existing SSH configuration (including
|
||
ProxyJump/ProxyCommand when configured by the user) remains a trusted dependency.
|
||
The probe has a 15-second total deadline and 128 KiB stdout/stderr limits.
|
||
Unexpected banners, malformed data and unsupported remote OS/CPU return explicit
|
||
errors. Raw SSH stderr and key paths are not included in the returned inventory.
|
||
|
||
Tests cover injected options/shell syntax, forbidden secret fields, memory and
|
||
unknown GPU parsing, output bounds, stdin EOF, timeout and host-key rejection.
|
||
On 2026-10-04 the command also read the authorized existing Linux RTX5090 host
|
||
successfully without changing its active serving session. This proves preflight,
|
||
not remote provisioning or persistent lifecycle.
|
||
|
||
STRA-58 now provides a shared local/SSH gRPC node transport; see `GRPC.md`.
|
||
STRA-52 provisioning remains pending. gRPC reconnect and optional durable node
|
||
operation history are implemented; complete recovery/reconciliation is still pending. SSH remains bootstrap and secure transport.
|
||
The preflight command does not install or launch this node.
|
||
|
||
## Managed SSH transport (STRA-53)
|
||
|
||
The local Rust listener owns one OpenSSH stdio-forward process per accepted TCP
|
||
connection: `ssh -W 127.0.0.1:REMOTE_PORT`. It always binds loopback, clears
|
||
configured forwards, disables shared ControlMaster/ControlPersist, and sends no
|
||
remote shell command. Thus an existing user tunnel/runtime is never replaced.
|
||
The same gRPC client can reconnect through the surviving local listener and obtain
|
||
a fresh SSH process. SSH keepalives detect lost transport; the existing gRPC
|
||
heartbeat/backoff governs node readiness. A listening port alone is not readiness.
|
||
|
||
Bound connection count and spawn rate, copy bytes with backpressure, cancel/reap
|
||
only owned SSH children on disconnect/shutdown. Fail an occupied local port
|
||
without changing its owner. CLI first: private JSON profile with SSH fields,
|
||
local listen address and remote node port. Output descriptor has no credential.
|
||
No runtime install or model start in this transport operation. All feature tests
|
||
use isolated endpoints; active rnr5090 serving/tunnel remain unchanged.
|
||
|
||
### Usage and verified behavior
|
||
|
||
Copy `examples/ssh-tunnel.json` to a private location and configure the SSH
|
||
destination and the **remote gRPC node port**, not the model's HTTP port:
|
||
```sh
|
||
strata-desktop ssh-tunnel /absolute/private/ssh-tunnel.json
|
||
```
|
||
The foreground command prints a loopback endpoint descriptor. Leave it running
|
||
and set `STRATA_NODE_ENDPOINT` to that address for the desktop, with the node's
|
||
existing private `STRATA_NODE_TOKEN`. The existing `node-proxy --node ADDRESS`
|
||
can expose that remote node to the harness through the same authenticated HTTP
|
||
Responses interface. Ctrl+C closes only this listener and its SSH children;
|
||
the remote node/model remains running. If the configured local port is occupied,
|
||
startup fails without touching that listener. Port 0 allows OS-assigned ports.
|
||
|
||
The configured maximum is 1–16 simultaneous TCP connections; starts are spaced
|
||
at least 250 ms apart. Each gRPC HTTP/2 connection multiplexes its RPC streams
|
||
over one SSH connection. SSH keepalives are 10 seconds with three missed replies;
|
||
gRPC liveness and reconnect/backoff remain separate. Remote destination is always
|
||
127.0.0.1. No remote shell command or background shared SSH master is created.
|
||
Counters distinguish accepted/active/completed/failed/rejected transport
|
||
connections; they are not model requests, readiness, or performance measurements.
|
||
SSH stderr is discarded; use the existing read-only preflight command to diagnose
|
||
trust/authentication failures rather than exposing remote logs in the UI.
|
||
|
||
Validation on macOS: four Rust tests cover safe arguments, public-bind/occupied
|
||
port rejection, byte-exact 300,000-byte binary duplex transfer including client
|
||
half-close, repeated connection creation, concurrency rejection, failed child,
|
||
and shutdown cleanup. `python desktop/tests/ssh_tunnel.py` creates a real isolated
|
||
localhost sshd with temporary host/user keys and a dedicated known_hosts file;
|
||
no ~/.ssh or system service changes. Two real C# clients completed gRPC
|
||
handshake/hardware/plan/snapshot through the tunnel. The test then killed only an
|
||
SSH child whose parent matched its own tunnel process and observed the C# client
|
||
reconnect to the unchanged node epoch. Graceful tunnel shutdown left the remote
|
||
fixture node running. All fixture processes, keys and files were removed.
|
||
|
||
This integration is in the macOS CI definition; hosted Actions are unrun.
|
||
Windows/Linux real SSH and suspend/resume qualification remain pending.
|
||
Model installation, persistent node bootstrap and saved connection profiles remain
|
||
next features. The desktop now provides a pre-session Local/SSH connection form. The active user's remote runtime/tunnel was not changed.
|
||
|
||
Digest-pinned per-user installation and activation: [INSTALL.md](INSTALL.md).
|
||
|
||
## Desktop connection chooser (STRA-53)
|
||
|
||
Without an explicit `STRATA_NODE_ENDPOINT`, desktop startup offers this computer
|
||
or an existing SSH node. The form accepts SSH alias/host, optional user and key
|
||
file reference, SSH port, remote loopback node port, and a masked node credential.
|
||
The credential stays in memory; it is not included in CLI arguments, tunnel
|
||
configuration or temporary files. Saving to an OS credential vault is future work.
|
||
|
||
The app sends a bounded single-line JSON config to
|
||
`ssh-tunnel --stdio-lifetime`, which owns an ephemeral loopback listener. Closing
|
||
its stdin closes/reaps that listener and its own SSH children. Desktop first
|
||
completes the authenticated gRPC handshake before opening the management window.
|
||
Failed authentication returns to the form for correction. No local/remote
|
||
rebinding is allowed after a management client exists, preserving lifecycle UUID
|
||
ownership. Close and reopen desktop to choose another node; closing does not
|
||
stop an external model. Existing explicit environment endpoints still work.
|
||
|
||
The Local option currently starts an inventory/planning node, without an inference
|
||
backend. Remote requires an already started compatible node with a trusted SSH
|
||
host key. Neither the chooser nor a successful handshake claims model readiness.
|
||
The management window reports worker readiness separately.
|
||
|
||
Real isolated localhost SSH integration exercises the same C# connection path:
|
||
wrong-token rejection, successful retry, hardware/plan/events, rejected active
|
||
rebind, owned tunnel cleanup while remote node survives, and selection of a new
|
||
local node after closing. Native macOS UI was checked for validation feedback
|
||
and transition to the local hardware/worker management window. Windows/Linux
|
||
UI and sleep/resume qualification remain pending; hosted CI has not run.
|