Skip to content

feat(app): web-UI app kind — serve an app's own web UI via a spored TLS proxy (#590) - #596

Merged
scttfrdmn merged 2 commits into
mainfrom
feat/590-web-apps
Sep 15, 2026
Merged

scttfrdmn merged 2 commits into
mainfrom
feat/590-web-apps

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Feature B of the approved plan: web-UI applications (Jupyter, code-server, OpenRefine, RStudio Server, ComfyUI…) that serve their own HTTP UI — no DCV/X11. Depends on the kind schema in libs v0.45.0.

Model

kind: web (catalog) or --web-port <n> (ad-hoc, with --image):

  • Launch: run the container publishing its HTTP port on localhost (docker run -p 127.0.0.1:<port>:<port>); no DCV install. The launch drops the wildcard TLS cert (same spawn-certs source as DCV) at /etc/spore/webproxy/.
  • spored (pkg/agent/webready.go): each monitor tick, probe http://127.0.0.1:<port><health_path>; once it answers, start a built-in TLS reverse proxy on :443 (httputil.ReverseProxy, WebSocket-capable for Jupyter/code-server) and write spawn:ready-url = https://<fqdn>/. Named terminal statuses web-not-responding / web-proxy-failed.
  • Idle: web apps don't set DCVSessionID, so spored's existing generic idle branch (CPU/network/process) applies automatically. TTL is the backstop.
  • CLI: the ready poll now runs for web too, treats ready-status=ready as ready (the web ready-url has no auth token — the app owns its auth), parses port-less hosts, and opens https://<fqdn>/ directly (no DCV session HTML).

Plumbing

  • LaunchConfig.AppMode/ReadyPort/ReadyHealthPath → tags spawn:app-mode/spawn:ready-port/spawn:ready-path, read back in provider.GetConfig.
  • New CreateOrGetWebSecurityGroup (spawn-web, opens :443) instead of the DCV :8443 SG.
  • New flags --web-port, --health-path.

Tests

buildWebUserData (no DCV, localhost publish, cert drop, spored; + private-ECR login/GPU), buildWebReadyURL, probeHTTP down-case, extractReadyFromTags web URL parse (no token, port-less host), dcvStatusTerminal web statuses. Full cmd/pkg/agent/pkg/aws/pkg/provider suites + vet green.

Not yet validated end-to-end

Needs a real-instance run (a web app like code-server/Jupyter) — the gated follow-up (TTL + terminate + leak-check): confirm probe → :443 TLS proxy → ready → the app serves over https://<fqdn>/. Web catalog entries (code-server/jupyter/openrefine) will be seeded in libs after this validates (kept out now to avoid listing not-yet-launchable apps, per #592).

Refs #590.

…LS proxy (#590)

Add a 'web' launch kind for apps that serve their own HTTP UI (Jupyter,
code-server, OpenRefine): run the container publishing its port on localhost;
spored probes the port, starts a built-in TLS reverse proxy on :443 (wildcard
cert from spawn-certs), and writes spawn:ready-url=https://<fqdn>/. No DCV; idle
uses the generic path. New LaunchConfig AppMode/ReadyPort/ReadyHealthPath +
tags, spawn-web SG (:443), CLI poll accepts status=ready (no token) and parses
port-less hosts, named web statuses. --web-port/--health-path launch BYO web
apps. Unit-tested (buildWebUserData, buildWebReadyURL, ready-tag parse).

Refs #590.
@codecov

codecov Bot commented Sep 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 31.22530% with 174 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/app.go 51.56% 62 Missing ⚠️
pkg/aws/securitygroup.go 0.00% 48 Missing ⚠️
pkg/agent/webready.go 18.18% 44 Missing and 1 partial ⚠️
pkg/provider/ec2.go 0.00% 7 Missing ⚠️
cmd/dcv.go 25.00% 5 Missing and 1 partial ⚠️
pkg/aws/tags.go 0.00% 3 Missing and 3 partials ⚠️

📢 Thoughts on this report? Let us know!

…S proxy; regen docs

The :443 TLS reverse proxy must bind all interfaces (public web app, gated by
the spawn-web SG + app auth) — annotate with a justified nosemgrep. Regenerate
docs-gen/app.md for the new --web-port/--health-path flags (drift gate).
@scttfrdmn
scttfrdmn merged commit de3f0c4 into main Sep 15, 2026
7 checks passed
@scttfrdmn
scttfrdmn deleted the feat/590-web-apps branch September 15, 2026 03:42
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