Skip to content

add terminal-proxy as standalone service#76

Open
emerson-gray wants to merge 2 commits intomainfrom
container-terminal-architecture
Open

add terminal-proxy as standalone service#76
emerson-gray wants to merge 2 commits intomainfrom
container-terminal-architecture

Conversation

@emerson-gray
Copy link
Collaborator

@emerson-gray emerson-gray commented Mar 25, 2026

Summary

Adds the Terminal Proxy — a standalone service for interactive terminal access to workload containers. Single responsibility: bridge WebSocket sessions to Runner Exec RPC via OpenZiti.

New file: architecture/terminal-proxy.md

WebSocket endpoint/terminal/ws?workloadId={workloadId}&containerId={containerId}

  • JSON message protocol: input, resize, ping, close (client→server) / output, status, error, pong (server→client)
  • Mermaid sequence diagram showing the full lifecycle
  • Exec config: TTY mode, shell auto-detection (bash → sh), no wall timeout
  • Container selection: containerId targets a specific container within the workload pod

Infrastructure:

  • Authentication: OIDC bearer token
  • Authorization: delegates to Authorization service
  • OpenZiti: dials Runners (does not bind any service)
  • Ingress: path-based route on platform domain (agyn.dev/terminal/)
  • Implementation: Go, net/http, nhooyr.io/websocket, OpenZiti SDK

Changes to existing docs

  • architecture/system-overview.md: Terminal Proxy added to component diagram, component summary table, and repository map
  • README.md: Terminal Proxy added to architecture docs table
  • open-questions.md: Added "Workload Discovery and Runner Routing" — where does container discovery for the UI live, and how does the Terminal Proxy route to the correct runner instance when multiple runners exist

Related

@emerson-gray emerson-gray force-pushed the container-terminal-architecture branch from 7181fb7 to 70ce8ae Compare March 25, 2026 12:24
@emerson-gray emerson-gray changed the title gateway: add terminal WebSocket proxy and RunnerGateway add terminal-proxy as standalone service Mar 25, 2026
@emerson-gray emerson-gray force-pushed the container-terminal-architecture branch 2 times, most recently from f07eaee to c71970b Compare March 25, 2026 13:18
- Add architecture/terminal-proxy.md — standalone WebSocket service for
  interactive terminal access to workload containers
- Terminal Proxy has a single responsibility: bridge WebSocket sessions
  to Runner Exec RPC via OpenZiti. No workload discovery methods.
- Documents: WebSocket protocol (JSON messages), flow diagram, exec
  configuration, authentication, authorization, OpenZiti policies,
  ingress, configuration
- Add Terminal Proxy to system-overview.md (component summary, diagram,
  repository map) and README.md
- Add open question: Workload Discovery and Runner Routing — where does
  container discovery for the UI live, and how does the Terminal Proxy
  route to the correct runner instance
@emerson-gray emerson-gray force-pushed the container-terminal-architecture branch from c71970b to 6f4bec7 Compare March 25, 2026 15:53
Terminal Proxy now queries the Runners service (GetWorkload) to resolve
which runner hosts the target workload before dialing via OpenZiti.

Changes:
- Add 'Runner resolution' responsibility
- Add Runners Service participant to connection flow diagram
- Add GetWorkload call before shell detection in the flow
- Add runner resolution paragraph in Workload Container Selection
- Add RUNNERS_SERVICE_ADDRESS to configuration
- Update internal calls to include Runners
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.

2 participants