Skip to content

Rehearse a fleet rollout and rollback

Operate a deterministic fictional device fleet, evaluate health thresholds, stage firmware through a canary, and preserve the timeline of an automatic rollback.

Cloud Clara: I want you to connect every fleet signal to the gate decision, recovery action, and final reported state., your practice guide

Cloud Clara: I want you to connect every fleet signal to the gate decision, recovery action, and final reported state.
Predict the reading, then compare it with the measurement.

Python 3 in your browser (JupyterLite)

Python · no install

Operate a deterministic fictional device fleet, evaluate health thresholds, stage firmware through a canary, and preserve the timeline of an automatic rollback.

Tier 2 · Web · paste-in setup · No account

Version tested: Python 3.12.7 / Pyodide 0.27.6 in JupyterLite 0.6.4; Chromium 148.0.7778.96; captureSource playwright:jupyterlite. Date: 2026-09-10.

Open the notebook in your browser and run each Python cell; no install or account is needed.

Three ways to run: use JupyterLite here with no install; run main.py locally from the downloadable lab folder; or open the same notebook in Google Colab.

Open in your browser (new tab)

Steps

Screens captured against JupyterLite Python 3.12.7 / Pyodide 0.27.6; Chromium 148.0.7778.96 on 2026-09-10; the tool may have moved on — the text steps are the contract.

  1. 1 Step 1

    Do
    Run `python3 main.py --step 1` to create the six-device fleet from seed 731.
    You will see
    A table lists pump-01 through pump-06 with region, reported firmware, battery, temperature, and heartbeat age.
    Why it matters
    A rollout decision needs an explicit reported-state snapshot rather than only a fleet total.
    JupyterLite notebook output for fleet-ops-drill step 1, captured after running the real Python cell.
    Step 1 · Python 3 in your browser (JupyterLite); numbered callout added to a real capture. Enlarge screenshot (new tab)
  2. 2 Step 2

    Do
    Run `python3 main.py --step 2` to evaluate the fleet's health snapshot against three thresholds.
    You will see
    The rules are printed above six rows: four devices are OK, while pump-04 and pump-06 show ALERT for their measured values.
    Why it matters
    Putting readings beside thresholds makes cohort exclusion and later alerts auditable.
    JupyterLite notebook output for fleet-ops-drill step 2, captured after running the real Python cell.
    Step 2 · Python 3 in your browser (JupyterLite); numbered callout added to a real capture. Enlarge screenshot (new tab)
  3. 3 Step 3

    Do
    Run `python3 main.py --step 3` to fire alerts and exclude unhealthy devices from the rollout.
    You will see
    Timestamped alert lines name pump-04's temperature breach and pump-06's heartbeat and battery breaches before the operator exclusion event.
    Why it matters
    The individual rule evidence explains why those devices are excluded while still remaining under monitoring.
    JupyterLite notebook output for fleet-ops-drill step 3, captured after running the real Python cell.
    Step 3 · Python 3 in your browser (JupyterLite); numbered callout added to a real capture. Enlarge screenshot (new tab)
  4. 4 Step 4

    Do
    Run `python3 main.py --step 4` to inspect the rolling firmware plan and safety gate.
    You will see
    The eligible, canary, and next-batch cohorts are named beside the success signal and `pause when cohort error rate > 20%; restore 2.3.1` rule.
    Why it matters
    A staged change is safe only when scope, success evidence, breach threshold, and rollback target are decided before execution.
    JupyterLite notebook output for fleet-ops-drill step 4, captured after running the real Python cell.
    Step 4 · Python 3 in your browser (JupyterLite); numbered callout added to a real capture. Enlarge screenshot (new tab)
  5. 5 Step 5

    Do
    Run `python3 main.py --step 5` to update and observe the two canary devices.
    You will see
    Commands and acknowledgements for pump-01 and pump-03 report firmware 2.4.0 with no errors; `0.0% <= 20.0% -> PROCEED` opens the next batch.
    Why it matters
    Reported version and error signals prove the canary result before rollout scope widens.
    JupyterLite notebook output for fleet-ops-drill step 5, captured after running the real Python cell.
    Step 5 · Python 3 in your browser (JupyterLite); numbered callout added to a real capture. Enlarge screenshot (new tab)
  6. 6 Step 6

    Do
    Run `python3 main.py --step 6` to update the next batch and inject pump-05's boot failure.
    You will see
    One of two batch devices fails, making `50.0% > 20.0% -> BREACH`; the timeline immediately pauses rollout and requests rollback to 2.3.1 for four devices.
    Why it matters
    The error-rate arithmetic beside the automatic actions proves why containment occurred and which state recovery requests.
    JupyterLite notebook output for fleet-ops-drill step 6, captured after running the real Python cell.
    Step 6 · Python 3 in your browser (JupyterLite); numbered callout added to a real capture. Enlarge screenshot (new tab)
  7. 7 Step 7

    Do
    Run `python3 main.py --step 7` to verify rollback acknowledgements and compare requested with reported firmware.
    You will see
    Four rollback acknowledgements precede a six-row table in which requested and reported versions are 2.3.1 and every drift value is NO.
    Why it matters
    Recovery is complete only after observed device state matches the rollback request, including unchanged excluded devices.
    JupyterLite notebook output for fleet-ops-drill step 7, captured after running the real Python cell.
    Step 7 · Python 3 in your browser (JupyterLite); numbered callout added to a real capture. Enlarge screenshot (new tab)
  8. 8 Step 8

    Do
    Run `python3 main.py --step 8` to print the incident record in event order.
    You will see
    The timeline moves from ALERT through DECISION, ERROR, CONTAIN, RECOVER, and VERIFY, then assigns the release-manager and a quarantine follow-up.
    Why it matters
    A chronological incident record connects signals to operator decisions, recovery evidence, ownership, and the next investigation.
    JupyterLite notebook output for fleet-ops-drill step 8, captured after running the real Python cell.
    Step 8 · Python 3 in your browser (JupyterLite); numbered callout added to a real capture. Enlarge screenshot (new tab)

Chapter checks

These questions refer to the chapter’s examples. Use the return links to review their answers.

  1. Why do production fleet problems differ from single-device testing?

    Return to the chapter’s knowledge check
  2. After an outage, why is a fixed 60-second reconnect delay (no jitter) still a problem?

    Return to the chapter’s knowledge check
  3. Why can identical X.509 certificate expiry dates across a fleet cause an outage?

    Return to the chapter’s knowledge check

Caution

This is a deterministic in-process drill with fictional devices. Its thresholds and injected failure are teaching fixtures, not production SLOs; a real rollout also needs signed artifacts, compatibility checks, redundant recovery paths, authorization, durable audit logs, and device-specific safety review.

Return to Production Architecture Case Studies · Browse Labs