Skip to content

feat(demo): top-level presentation cockpit + live-run fixes - #1

Merged
patterncatalyst merged 6 commits into
mainfrom
feat/top-level-demo-runner
Aug 25, 2026
Merged

feat(demo): top-level presentation cockpit + live-run fixes#1
patterncatalyst merged 6 commits into
mainfrom
feat/top-level-demo-runner

Conversation

@patterncatalyst

Copy link
Copy Markdown
Owner

Summary

Adds a single presentation driver (examples/demo.sh) to run all seven demos from one terminal, plus fixes surfaced during live rehearsal.

What's included

  • Cockpit (examples/demo.sh): interactive menu + --all in deck order (1,2,6,3,4,5,7), driving each demo's own demo.sh with the TTY inherited so the seven stay usable standalone. Flags: --rebuild, --keep-stack, --ide=clion, --no-pause, --clean.
  • code_ref helper: clickable file:line callouts wired into all seven demos; opens in CLion when DEMO_IDE=clion.
  • Reuse builds (DEMO_NO_BUILD): on-stage runs skip rebuilds when images exist.
  • Keep-stack (DEMO_KEEP_STACK / menu k): stack demos (3, 4) leave the LGTM stack up for instant re-runs; cockpit frees the other stack demo first (they share :3000) via --stack-down (image-preserving).
  • Stack-demo teardown: no longer invites Ctrl-C (which killed the whole run under the cockpit).
  • Demo 1 size ratio: computed from actual image bytes (was a stale hardcoded ~26×).

Bug fixes

  • The tutorial Grafana dashboards never actually provisioned (empty mount + no provider). Now both Demo overview and a new Demo 03 dashboard load into the Tutorial folder.
  • free_other_stack no longer deletes images when freeing the other stack.

Testing

Full --all --no-pause run passes (exit 0) with all seven demos; demo-04 span/metric/log probe confirms traces/metrics/logs land; dashboards + datasource UIDs verified; all images pre-cached.

Scaffold Bot added 6 commits August 24, 2026 15:20
Add a root ./demo.sh that drives all seven demos from one terminal in
deck order (1,2,6,3,4,5,7): interactive menu, --all, --clean, --ide=clion.
It runs each demo's own examples/demo-0X/demo.sh with the TTY inherited,
so per-demo pause/callout behaviour is unchanged and the seven remain
usable standalone.

Add a code_ref helper to scripts/lib/_helpers.sh: prints a clickable
file:line and, when DEMO_IDE=clion, opens it in CLion via the JetBrains
Toolbox launcher (opt-in). Wire code_ref callouts into all seven demos
pointing at the key source for each.
The top-level runner belongs beside the demos it drives. Relocate
demo.sh → examples/demo.sh and adjust its paths: source helpers via
../scripts/lib and invoke each demo as ./<dir>/demo.sh (it now cd's
within examples/). Behaviour is unchanged.
…down, demo-03 dashboard

- demo-01: compute the naive-vs-ubi-micro size multiplier from actual
  image bytes instead of the stale hard-coded ~26× (now ~22× for UBI 10).
- Add should_build/image_exists helpers; DEMO_NO_BUILD=1 reuses existing
  images. Wire into demos 1,2,3,4,5,6 so on-stage runs skip rebuilds
  (demo-07's gates run in-build, so it still builds — fast on cache).
- Stack demos (3,4): honor DEMO_ORCHESTRATED to tear down quietly without
  the 'Ctrl-C to leave running' prompt (that Ctrl-C killed the whole
  run-all). Standalone runs keep an 'explore Grafana then Enter' pause.
- Cockpit: default DEMO_NO_BUILD=1 (add --rebuild to force); set
  DEMO_ORCHESTRATED during run-all; clearer deck-order transitions.
- Add provisioned Grafana dashboard for demo-03 (gRPC rate/latency, TCP
  conns, traces, logs) + copy-pasteable PromQL/TraceQL in the callout.
Add DEMO_KEEP_STACK (cockpit --keep-stack / menu 'k' toggle): stack demos
(3, 4) leave the LGTM stack running instead of tearing down, so the next
run skips bring-up. demo-04 gains --keep to match demo-03. Because demos 3
and 4 both bind Grafana on :3000, the cockpit frees the OTHER stack demo
before starting one while keep-stack is on. Also fix -h: use an absolute
self-path so a path-prefixed invocation still prints help after the cd.
The 'Demo overview' dashboard the deck references never loaded: the
observability compose mounted ./grafana/dashboards, but relative paths
resolve against the compose PROJECT dir — the demo's dir when included —
so the mount was empty, and no provider config told Grafana to load it.

- Add a dashboard provider yaml (grafana/otel-provisioning) that scans the
  mounted tutorial/ dir into a 'Tutorial' folder.
- Mount both the dashboards dir and the provider via env vars
  (OBS_DASHBOARDS_DIR / OBS_PROVIDER_FILE) with standalone-correct defaults;
  demos 3 and 4 export absolute paths so the mount works when included.

Verified: tutorial-overview and tutorial-demo-03 now appear in the Tutorial
folder; datasource UIDs (prometheus/tempo/loki) resolve; no provisioning
errors.
…tack

free_other_stack called the other stack demo's --clean, but demo-04's
--clean also runs 'podman rmi cpp-tut/demo-04:latest' — so running Demo 4
then Demo 3 with keep-stack deleted the demo-04 image and forced a ~15 min
recompile on the next run. Add a --stack-down flag (compose down -v only,
image kept) and use it from free_other_stack instead of --clean.
@patterncatalyst
patterncatalyst merged commit 1b09f59 into main Aug 25, 2026
3 of 4 checks passed
@patterncatalyst
patterncatalyst deleted the feat/top-level-demo-runner branch August 25, 2026 15:28
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