|
| 1 | +<!-- |
| 2 | +Copyright © Advanced Micro Devices, Inc., or its affiliates. |
| 3 | +
|
| 4 | +SPDX-License-Identifier: MIT |
| 5 | +--> |
| 6 | + |
| 7 | +# Demo screencasts |
| 8 | + |
| 9 | +The README embeds short terminal screencasts (GIFs) of common `rocm` commands. |
| 10 | +They are authored as [VHS](https://github.com/charmbracelet/vhs) tapes, rendered |
| 11 | +in CI, and published to the orphan **`media`** branch. GIFs are **never committed |
| 12 | +to source branches** — the README references them by absolute raw URL, so the |
| 13 | +binaries stay out of `main`'s history. |
| 14 | + |
| 15 | +## Layout |
| 16 | + |
| 17 | +| Path | Purpose | |
| 18 | +| --- | --- | |
| 19 | +| `docs/tapes/*.tape` | One VHS tape per demo (the recorded script). | |
| 20 | +| `docs/tapes/lib/demo-env.sh` | Sourced by server-backed tapes; starts the mock server and points `rocm` at an isolated config. | |
| 21 | +| `.github/workflows/demo-gifs.yml` | Builds the binaries, renders every tape, publishes GIFs to the `media` branch. | |
| 22 | +| `docs/media/` | Render output directory (git-ignored; present only so `vhs` has a target). | |
| 23 | + |
| 24 | +## How the server-backed demos work |
| 25 | + |
| 26 | +`chat` and `services` need a running model endpoint. Instead of a GPU or a real |
| 27 | +model, they reuse the end-to-end test harness's mock OpenAI server via the |
| 28 | +standalone `rocm-demo-env` binary (`tests/e2e-cucumber/src/bin/rocm-demo-env.rs`): |
| 29 | + |
| 30 | +1. `demo-env.sh` starts `rocm-demo-env`, which boots the axum mock server on a |
| 31 | + loopback port and plants a managed-service record into an isolated config dir. |
| 32 | +2. It exports `ROCM_CLI_CONFIG_DIR` / `ROCM_CLI_DATA_DIR` / `ROCM_CLI_CACHE_DIR` |
| 33 | + so `rocm` discovers the mock, and sets `ROCM_MOCK_CHAT_REPLY` for a realistic |
| 34 | + canned answer. |
| 35 | +3. The tape runs the real `rocm` command; the server is killed on shell exit. |
| 36 | + |
| 37 | +Output is deterministic and needs no hardware, so renders are reproducible. |
| 38 | + |
| 39 | +## Regenerate locally |
| 40 | + |
| 41 | +Install VHS (see its README), then from the repo root: |
| 42 | + |
| 43 | +```bash |
| 44 | +# Build the binaries the tapes invoke. |
| 45 | +cargo build --release -p rocm --bin rocm |
| 46 | +cargo build --release -p e2e-cucumber --bin rocm-demo-env |
| 47 | + |
| 48 | +# Render one tape (writes docs/media/<name>.gif). |
| 49 | +vhs docs/tapes/chat.tape |
| 50 | +``` |
| 51 | + |
| 52 | +Tapes resolve binaries from `target/release` by default; override with |
| 53 | +`ROCM_BIN_DIR=/path/to/bin`. |
| 54 | + |
| 55 | +## Add a demo |
| 56 | + |
| 57 | +1. Add `docs/tapes/<name>.tape` with `Output docs/media/<name>.gif`. For a |
| 58 | + server-backed demo, `source docs/tapes/lib/demo-env.sh` inside a `Hide` block. |
| 59 | +2. Add a `Render <name>` step to `.github/workflows/demo-gifs.yml`. |
| 60 | +3. Reference the published GIF from the README: |
| 61 | + `https://raw.githubusercontent.com/ROCm/rocm-cli/media/<name>.gif`. |
| 62 | + |
| 63 | +## Triggers |
| 64 | + |
| 65 | +The workflow runs on `workflow_dispatch` and on published releases — never on |
| 66 | +pull requests (rendering is slow and would churn the `media` branch). GitHub |
| 67 | +proxies README images through a cache; when a regenerated GIF looks stale, append |
| 68 | +a cache-buster to the URL (e.g. `...chat.gif?v=<release-tag>`). |
0 commit comments