improvement(setup): make k8s mode end somewhere usable, and show install progress - #5966
improvement(setup): make k8s mode end somewhere usable, and show install progress#5966TheodoreSpeaks wants to merge 1 commit into
Conversation
…all progress Two things made k8s mode the least satisfying path. The services are ClusterIP, so a successful install left nothing on :3000 — 'Sim is ready' was true about the cluster and useless to the user, who had to notice and run a port-forward by hand. Compose opens a browser and dev offers to start the server; k8s now offers the forward the same way and runs it in the foreground so Ctrl-C ends it. Realtime gets its own forward (kubectl takes one resource per invocation) or the editor socket fails; it is a child in the same process group, so the terminal's Ctrl-C reaches it, and it is killed explicitly when the app forward exits. 'helm --wait' then blocked for minutes with a single static spinner, so a slow image pull looked identical to a wedged install. Run helm asynchronously and poll the cluster, so the spinner reports '3/3 pods ready · 1 starting'. CronJob-owned pods are excluded: the chart schedules a lot of them (36 on a running cluster here) and they finish as Completed, which would swamp the count and make readiness jitter for reasons unrelated to the install. Restarting pods are surfaced too — a cold cluster restarts realtime while Postgres comes up, and a silent spinner made that look like nothing was happening.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryLow Risk Overview When the release is healthy, the “Reach your cluster” note is expanded (open URL, logs, forward, tear down). The wizard then prompts to port-forward app ( Reviewed by Cursor Bugbot for commit 3052dcf. Bugbot is set up for automated code reviews on this repo. Configure here. |
Greptile SummaryImproves Kubernetes setup completion and progress reporting.
Confidence Score: 3/5This PR should not merge until failures from both port-forward processes are detected and propagated instead of allowing setup to report success with unreachable endpoints. The newly added forwarding path discards the app command's exit status and never observes the realtime child's failure, so realistic port conflicts or Kubernetes connection failures produce false successful completion. Files Needing Attention: scripts/setup/modes/k8s.ts
|
| Filename | Overview |
|---|---|
| scripts/setup/modes/k8s.ts | Adds asynchronous Helm progress and dual port-forwarding, but forwarding failures are not propagated to the setup wizard. |
Sequence Diagram
sequenceDiagram
participant Wizard as Setup wizard
participant Helm
participant K8s as Kubernetes
participant AppPF as App port-forward
participant RTPF as Realtime port-forward
Wizard->>Helm: upgrade --install --wait
loop Every 3 seconds
Wizard->>K8s: get pods
K8s-->>Wizard: readiness and waiting states
end
Helm-->>Wizard: installation result
Wizard->>RTPF: start :3002 forward
Wizard->>AppPF: run :3000 forward in foreground
AppPF-->>Wizard: process exits
Wizard->>RTPF: terminate
Reviews (1): Last reviewed commit: "improvement(setup): make k8s mode end so..." | Re-trigger Greptile
| const realtime = spawn( | ||
| 'kubectl', | ||
| [...scope, 'port-forward', `svc/${RELEASE}-realtime`, '3002:3002'], | ||
| { stdio: 'ignore' } | ||
| ) | ||
| p.log.step(`Forwarding ${APP_URL} (app) and :3002 (realtime) — Ctrl-C to stop`) | ||
| spawnSync('kubectl', [...scope, 'port-forward', `svc/${RELEASE}-app`, '3000:3000'], { | ||
| stdio: 'inherit', | ||
| }) |
There was a problem hiding this comment.
Port-forward failures report success
When either local port is occupied, the Kubernetes connection drops, or a target service is unavailable, the realtime child can exit without being observed and the app command's exit status is discarded, causing setup to announce that Sim is ready even though one or both endpoints are unreachable.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 3052dcf. Configure here.
| spawnSync('kubectl', [...scope, 'port-forward', `svc/${RELEASE}-app`, '3000:3000'], { | ||
| stdio: 'inherit', | ||
| }) | ||
| realtime.kill() |
There was a problem hiding this comment.
Port-forward failures go unchecked
Medium Severity
offerPortForward claims app and realtime are forwarding, but never checks that either kubectl actually succeeded. Realtime uses stdio: 'ignore', so bind failures vanish, and the app spawnSync result is discarded. Setup then returns normally and the wizard can still announce Sim is ready with nothing reachable on :3000/:3002.
Reviewed by Cursor Bugbot for commit 3052dcf. Configure here.
| initialValue: true, | ||
| }) | ||
| if (!forward) { | ||
| p.log.info(theme.muted('Skipped — run the forward command above when you want to reach it.')) |
There was a problem hiding this comment.
Manual forward omits realtime
Medium Severity
The “Reach your cluster” note and the skip message only document forwarding the app service, while this change’s own comment states realtime needs a separate forward or the editor socket fails. Declining the prompt or copying the listed command leaves :3002 unforwarded even though NEXT_PUBLIC_SOCKET_URL points there.
Reviewed by Cursor Bugbot for commit 3052dcf. Configure here.
| if (containers.includes('ContainerCreating') || containers.includes('PodInitializing')) | ||
| pulling++ | ||
| if (containers.includes('CrashLoopBackOff') || containers.includes('ImagePullBackOff')) | ||
| crashing++ |
There was a problem hiding this comment.
Init pull failures not surfaced
Low Severity
podProgress only reads containerStatuses waiting reasons, so ImagePullBackOff / CrashLoopBackOff on the migrations init container never increment the “restarting” count. A cold install stuck on simstudioai/migrations tends to look like quiet “starting” / not-ready progress instead of the wedged pull the spinner is meant to expose.
Reviewed by Cursor Bugbot for commit 3052dcf. Configure here.


Summary
helm --waitno longer blocks behind a static spinner. helm runs asynchronously while the cluster is polled, so the spinner reports3/3 pods ready · 1 startingand a slow image pull is distinguishable from a wedged install.Completed, which would swamp readiness for reasons unrelated to the install. Restarting pods are surfaced rather than hidden.Type of Change
Testing
Verified against a live kind cluster (
kind-sim, releasesim-dev)::3000/api/healthand:3002/health, and both children are killed on exit:3000returns nothing — the gap this closes3/3 pods readyand correctly excludes 36 CronJob podsEvery setup script builds and
bun run lintpasses. No UI or migration files touched, so/cleanupand/db-migratedon't apply.Stacked context: this is independent of #5964 (which touches compose/db/lifecycle/csp, not
modes/k8s.ts), so the two don't conflict.Checklist