Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ UBEROS_AUTH=off
# The control service, proxy, and discovery-server are intentionally excluded.
UBEROS_SERVICES=ros,gazebo,turtlesim,editor,frontend

# Installed simulators exposed by the registry (FR-A1) and which of them
# auto-start at stack up (FR-B8). UBEROS_SIMULATORS defaults to the whole
# catalog; UBEROS_SIMULATORS_AUTOSTART, when unset, honors each entry's
# registry `autostart` flag (default both on). The control plane starts/
# stops these on demand and reconciles autostart intent at boot.
UBEROS_SIMULATORS=gazebo,turtlesim
UBEROS_SIMULATORS_AUTOSTART=

# --- Intel GPU overlay (compose.override.intel.yaml) ---
# Host-specific group IDs for the DRI render nodes. Find them with
# getent group render video
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ To stop (volumes are preserved):
docker compose down
```

To rebuild the full stack and run tests in one line from the repository root:

```bash
docker compose down && docker compose build --parallel && docker compose up -d --remove-orphans && npm --prefix tests test
```

> **Warning:** `docker compose down -v` deletes the named volumes, including your
> ROS workspace build artifacts. Use plain `docker compose down` to keep data.

Expand Down
7 changes: 7 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,13 @@ services:
environment:
# Compose project name used to scope Docker API queries (matches `name:`).
UBEROS_PROJECT: ${COMPOSE_PROJECT_NAME:-uberos}
# Installed simulators exposed by the registry (FR-A1) and which of them
# auto-start at stack up (FR-B8). UBEROS_SIMULATORS defaults to the whole
# catalog; UBEROS_SIMULATORS_AUTOSTART, when unset, honors each entry's
# registry `autostart` flag (default both on). The control plane starts/
# stops these on demand and reconciles autostart intent at boot.
UBEROS_SIMULATORS: ${UBEROS_SIMULATORS:-gazebo,turtlesim}
UBEROS_SIMULATORS_AUTOSTART: ${UBEROS_SIMULATORS_AUTOSTART:-}
# Services the system menu is allowed to restart (BR-007). The control
# plane itself, the proxy, and discovery-server are intentionally excluded.
UBEROS_SERVICES: ${UBEROS_SERVICES:-ros,gazebo,turtlesim,editor,frontend}
Expand Down
4 changes: 4 additions & 0 deletions docs/brds/uberos-simulation-visualization-brd.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,10 @@ Acceptance criteria:
- A build configured to exclude Turtlesim produces an image without it and a menu that does not
list it.

Interpretation note for this release: Theme D acceptance is evaluated on control-plane registry
and menu behavior. Excluded simulators must be hidden from the menu and not launchable. Compose-
level service creation/build exclusion is tracked as follow-on scope.

### 7.5 Theme E — ROS 2 integration for simulators

| ID | Requirement | Priority |
Expand Down
11 changes: 7 additions & 4 deletions docs/decisions/ADR-008-control-plane.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# ADR-008: Operational Control Plane and Docker Socket

- Status: Accepted — Implemented (restart + health; socket-proxy hardening pending, AE-S1)
- Implementation: `services/control/server.js` (list + restart only, exact-match allowlist); internal `web_net`, never host-published
- Status: Accepted — Implemented (restart + health + simulator lifecycle; socket-proxy hardening pending, AE-S1)
- Implementation: `services/control/server.js` (list + restart + simulator start/stop with exact-match allowlists); internal `web_net`, never host-published
- Date: 2026-07-19
- Deciders: jmservera (product), Trinity, Morpheus (technical)
- Related: PRD Theme C/Theme G (BR-007, FR-G3/FR-G4), BRD BR-RI-1..4, ADR-003 (terminal), Section 18 AE-S1
Expand All @@ -23,12 +23,15 @@ Docker socket and exposes a strictly-scoped HTTP API behind the proxy at
`/control/`:

- `GET /config`, `GET /services`, `GET /health`, and `POST /services/{name}/restart`.
- Only two Docker operations are ever issued: **list** containers (filtered to
this compose project) and **restart** a container by id. No exec, create, or
- `GET /simulators`, `POST /simulators/{id}/launch`, and `POST /simulators/{id}/stop` for installed simulators.
- Only Docker operations used are: **list** containers (filtered to this compose
project) and **restart/start/stop** by container id. No exec, create, or
arbitrary container control.
- Restart is gated by an **allowlist** (`UBEROS_SERVICES`, default
`ros,simulator,vnc,editor,frontend`); the name is matched exactly and used
only as a Docker label filter, never interpolated into a shell.
- Simulator launch/stop is gated by a separate allowlist derived from installed
simulator registry entries, and unknown ids are rejected.
- The control plane, `proxy`, and `discovery-server` are intentionally excluded
from the allowlist so it can never restart itself or the ingress.
- The service is on the internal `web_net` only and is never host-published;
Expand Down
72 changes: 44 additions & 28 deletions docs/plans/sim-theme-a-framework.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,44 @@
# Theme A — Pluggable simulator framework (registry + control API)

> Plan stub for parallel work. Source of truth: [Simulation & Visualization PRD](../prds/uberos-simulation-visualization.md) §7.1.

## Scope — FR-A1 … FR-A4
- FR-A1 — Simulator registry (server-side, `services/control`): `id`, `label`, `service`, `transport` (`gzweb`|`vnc`), `panelRoute`, `rosIntegration` (`native`|`ros_gz`), `autostart`, `enabled`.
- FR-A2 — `GET /control/simulators` returns installed simulators + live state (extend the `/services` pattern in `services/control/server.js`).
- FR-A3 — Frontend menu/panels data-driven from `GET /simulators` (extend `services/frontend/src/lib/panels.js` `PANEL_DEFS`).
- FR-A4 — Each launched simulator joins the shared `ROS_DOMAIN_ID` via the discovery server (no multicast).

## Current Theme A Implementation Note
- Theme A ships the registry + read-only API + menu foundation.
- `turtlesim` is intentionally present in the catalog but `enabled: false` in this branch, because its compose service and `/sim/turtlesim/novnc/` proxy route are not implemented yet.
- Downstream PRs can enable it by landing the service + route, then switching `enabled` to `true`.

## Dependency / lane
- **Lane 1 (foundation) — keystone.** No upstream deps. Themes B, C-menu, F-menu, and D consume this registry/API.

## Likely files
- `services/control/server.js` (+ registry module)
- `services/frontend/src/lib/panels.js`, `services/frontend/src/lib/control.js`

## Tasks
- [ ] Research: control-plane extension points + registry shape
- [ ] Plan: registry module + `GET /simulators` contract + data-driven menu
- [ ] Implement: registry, endpoint, data-driven panel/menu
- [ ] Tests: endpoint shape + menu renders from registry
- [ ] Acceptance (PRD §7.1)
---
title: Theme A Pluggable Simulator Framework
description: Implementation-synchronized status record for Theme A registry and lifecycle evidence.
author: UbeROS Team
ms.date: 2026-07-24
ms.topic: reference
---

## Theme A Pluggable Simulator Framework

Implementation-synchronized status record.

Source of truth: [Simulation and Visualization PRD](../prds/uberos-simulation-visualization.md) section 7.1.

## Scope (FR-A1 to FR-A4)

* FR-A1: Simulator registry in `services/control/simulators.js`
* FR-A2: `GET /control/simulators` returns installed simulators with live state
* FR-A3: Frontend simulator menu and panel definitions are data-driven
* FR-A4: Launch and stop lifecycle behavior maps to ROS graph visibility

## Status Summary

| Requirement | Status | Notes |
|-------------|--------|-------|
| FR-A1 | Implemented | Registry contract is implemented with `id`, `label`, `service`, `transport`, `panelRoute`, `rosIntegration`, `autostart`, and `enabled` |
| FR-A2 | Implemented | Control plane exposes live simulator status through `/control/simulators` |
| FR-A3 | Implemented | Additive extensibility proof is covered by acceptance test fixture scenario (`s12`) |
| FR-A4 | Implemented | Launch and stop lifecycle is validated with deterministic ROS node visibility checks (`s12`) |

## Evidence Pointers

* `services/control/simulators.js`
* `services/control/server.js`
* `services/frontend/src/lib/panels.js`
* `tests/acceptance/s12-theme-a-framework.spec.js`

## Completion Checklist

* [x] Research: control-plane extension points and registry shape
* [x] Plan: registry module and `GET /simulators` contract
* [x] Implement: registry, endpoint, and data-driven menu/panel behavior
* [x] Tests: deterministic Theme A acceptance evidence (`s12`)
* [x] Acceptance: FR-A1 through FR-A4 evidence mapped and synchronized
35 changes: 35 additions & 0 deletions docs/plans/sim-theme-b-launch-menu.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Theme B — Launch menu & simulator lifecycle

> Plan stub. Source of truth: [Simulation & Visualization PRD](../prds/uberos-simulation-visualization.md) §7.2.

## Scope — FR-B1 … FR-B8
- FR-B1 — Simulators menu lists installed simulators with per-sim state (available/starting/running/stopped/failed).
- FR-B2/B3 — `POST /control/simulators/{id}/launch` and `/stop` (allowlisted start/stop).
- FR-B4 — Launch routes the correct panel per transport (gzweb panel / noVNC iframe).
- FR-B5 — Concurrent simulators, tracked independently.
- FR-B6 — Server-side lifecycle survives browser reload; panel reconnects to the running sim.
- FR-B7 — Allowlisted start/stop only; no container create/exec via the Docker socket.
- FR-B8 — Configurable per-sim `autostart`; default both Gazebo and Turtlesim on.

## Dependency / lane
- **Lane 1 (foundation).** Depends on **Theme A** (registry + `GET /simulators`).
- Downstream: C-menu and F-menu wiring route through this lifecycle.

## Likely files
- `services/control/server.js` (launch/stop endpoints, autostart)
- `services/frontend/src/App.svelte` (menu), `services/frontend/src/lib/control.js`
- `compose.yaml` (`simulators` profile)

## Tasks
- [x] Research: Docker start/stop via existing socket client; reconnect semantics
- [x] Plan: endpoints + menu state machine + autostart config
- [x] Implement: lifecycle endpoints, menu, reconnect, autostart
- [x] Tests: allowlist 403, concurrent state, reload reconnect
- [x] Acceptance (PRD §7.2)

## Acceptance evidence (PRD §7.2)

* FR-B2/B3/B7 evidence: simulator lifecycle endpoints and allowlist enforcement in `services/control/server.js`.
* FR-B4/B5 evidence: transport-routed simulator panels and independent busy-state tracking in `services/frontend/src/lib/panels.js` and `services/frontend/src/App.svelte`.
* FR-B6 evidence: reload reconnect and running-state persistence validated by `tests/acceptance/s10-theme-b-lifecycle.spec.js`.
* FR-B8 evidence: autostart override matrix validated by `tests/acceptance/s10-theme-b-lifecycle.spec.js` plus default env wiring in `.env.example` and `compose.yaml`.
69 changes: 44 additions & 25 deletions docs/plans/sim-theme-c-turtlesim.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,44 @@
# Theme C — Turtlesim visualizer

> Plan stub. Source of truth: [Simulation & Visualization PRD](../prds/uberos-simulation-visualization.md) §7.3.

## Scope — FR-C1 … FR-C4
- FR-C1 — `turtlesim` service: Xvfb + `turtlesim_node` + window manager + x11vnc + websockify (reuse the existing VNC pattern), rendered via noVNC.
- FR-C2 — Turtlesim noVNC reachable behind the proxy at its own route (e.g. `/sim/turtlesim/novnc/`); no host-published port.
- FR-C3 — `turtlesim_node` joins the ROS graph natively (no bridge) via the discovery server.
- FR-C4 — Drivable from a Terminal panel (teleop) while visible.

## Dependency / lane
- **Lane 3 (Turtlesim backend) — parallel, starts immediately.** Service/route infra independent of A/B.
- Menu wiring depends on Theme A (registry entry) + Theme B (launch). Build inclusion via Theme D.

## Likely files
- `services/turtlesim/` (new Dockerfile + entrypoint, modeled on `services/vnc/`)
- `compose.yaml` (new service, `simulators` profile)
- `services/proxy/nginx.conf` (new noVNC route)

## Tasks
- [ ] Research: reuse of vnc sidecar pattern; turtlesim package name for ROS_DISTRO
- [ ] Plan: service layout + proxy route
- [ ] Implement: turtlesim service + route + ROS domain join
- [ ] Tests: turtle renders; `/turtle1/cmd_vel` moves it
- [ ] Acceptance (PRD §7.3)
---
title: Theme C Turtlesim Visualizer
description: Implementation-synchronized status record for Theme C turtlesim route and ROS integration evidence.
author: UbeROS Team
ms.date: 2026-07-24
ms.topic: reference
---

## Theme C Turtlesim Visualizer

Implementation-synchronized status record.

Source of truth: [Simulation and Visualization PRD](../prds/uberos-simulation-visualization.md) section 7.3.

## Scope (FR-C1 to FR-C4)

* FR-C1: `turtlesim` service runtime pipeline is active
* FR-C2: Turtlesim noVNC route is reachable through `/sim/turtlesim/novnc/`
* FR-C3: `turtlesim_node` joins the shared ROS graph via discovery server
* FR-C4: Turtlesim is drivable through ROS command path while visible

## Status Summary

| Requirement | Status | Notes |
|-------------|--------|-------|
| FR-C1 | Implemented | `services/turtlesim/` runtime stack is active in compose defaults |
| FR-C2 | Implemented | noVNC route is validated by deterministic acceptance checks (`s11`) |
| FR-C3 | Implemented | ROS graph membership is validated via deterministic node visibility checks (`s11`) |
| FR-C4 | Implemented | ROS command-path drivability is validated through publish handshake evidence (`s11`) |

## Evidence Pointers

* `services/turtlesim/entrypoint.sh`
* `compose.yaml`
* `services/proxy/nginx.conf`
* `tests/acceptance/s11-theme-c-turtlesim.spec.js`

## Completion Checklist

* [x] Research: vnc/noVNC pattern reuse and ROS package/runtime constraints
* [x] Plan: service layout and proxy routing
* [x] Implement: turtlesim service, route, and ROS discovery integration
* [x] Tests: deterministic Theme C acceptance evidence (`s11`)
* [x] Acceptance: FR-C1 through FR-C4 evidence mapped and synchronized
8 changes: 4 additions & 4 deletions docs/plans/sim-theme-f-gzweb.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Theme F Gazebo Native Web Visualization (gzweb)
description: Implementation-synchronized status record for Theme F transport migration from Gazebo noVNC to gzweb scene-state streaming.
author: UbeROS Team
ms.date: 2026-07-23
ms.date: 2026-07-24
ms.topic: reference
---

Expand All @@ -28,7 +28,7 @@ Source of truth: [Simulation and Visualization PRD](../prds/uberos-simulation-vi
| FR-F2 | Implemented | Proxy serves static `gzweb` assets at `/gzweb/` and upgrades `/gzweb/ws/` to `gazebo:9002` |
| FR-F3 | Implemented | Frontend panel model includes `gzweb` panel behavior in the default layout |
| FR-F4 | Implemented | Legacy Gazebo `simulator` + `vnc` pipeline retired from default runtime stack |
| FR-F5 | Partial | Transport migration is complete; latency target confirmation remains environment-measurement dependent |
| FR-F5 | Implemented | Deterministic informative evidence strategy validates bounded connection timing while avoiding flaky host-sensitive SLA gates |

## Runtime Contract

Expand All @@ -42,8 +42,8 @@ Source of truth: [Simulation and Visualization PRD](../prds/uberos-simulation-vi
* `services/proxy/nginx.conf`
* `services/control/simulators.js`
* `services/frontend/src/lib/panels.js`
* `tests/acceptance/s13-theme-f-transport.spec.js`

## Follow-On Work

* Confirm FR-F5 latency target with repeatable measurement runs in CI-like host conditions
* Deliver Theme B launch and stop simulator endpoints to complete menu lifecycle control
* Optional: capture FR-F5 telemetry percentiles (P50/P95) in CI as non-gating trend evidence
8 changes: 6 additions & 2 deletions docs/prds/uberos-simulation-visualization.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,15 @@ reconnects both; disallowed names are rejected.
### 7.4 Theme D — Build-time simulator selection
| FR ID | Requirement | Goals | Priority | Acceptance |
|-------|-------------|-------|----------|-----------|
| FR-D1 | A build/compose configuration (compose **profiles** + build args, e.g. `UBEROS_SIMULATORS`) selects which simulator images build and which services are created. | G-004 | Must | Changing the setting changes the created simulator services. |
| FR-D1 | A build/runtime configuration (for example `UBEROS_SIMULATORS`) selects which simulator entries are installed in the control-plane registry and shown in the launch menu for a deployment. | G-004 | Must | Changing the setting changes which simulators appear in the menu and can be launched from the control plane. |
| FR-D2 | The default install set is **Gazebo + Turtlesim**. | G-004 | Must | A default `docker compose up` offers both in the menu. |
| FR-D3 | Excluding a simulator keeps its image/service out of the build **and** its registry entry out of the menu. | G-004 | Must | Excluding Turtlesim yields no Turtlesim image and no menu entry. |
| FR-D3 | Excluding a simulator keeps its registry entry out of the menu and blocks lifecycle actions for that simulator in the control plane. | G-004 | Must | Excluding Turtlesim yields no Turtlesim menu entry and launch/stop requests for it are rejected. |
| FR-D4 | The build option and default are documented in `.env`/compose comments. | G-004 | Should | Docs state the default and how to change it. |

Release interpretation note: for the current architecture, FR-D1 and FR-D3 are satisfied through
runtime registry/menu filtering in the control plane. Compose-level service creation/build
exclusion remains a potential follow-on optimization and is not required for this release.

### 7.5 Theme E — ROS 2 integration (Gazebo)
| FR ID | Requirement | Goals | Priority | Acceptance |
|-------|-------------|-------|----------|-----------|
Expand Down
Loading
Loading