OSys fleet quickstart¶

This notebook runs on the osys-jupyter box, which is joined to the NetBird mesh — so its kernel can reach any device directly at osys-<ID>.nb.local.

Set DEVICE below, then run all. When the nightly render executes this notebook the cells hit live devices; the static copy at demos.rvbeta.net freezes whatever they returned.

Each cell tolerates an offline device so one down unit doesn't blank the render.

In [1]:
import os, httpx

DEVICE = os.environ.get("OSYS_DEMO_DEVICE", "77")  # override via env at render time
HOST = f"osys-{DEVICE}.nb.local"

PORTS = {"clipper": 8088, "video-player": 9080, "couchdb": 5984, "depth": 8910}
COUCHDB_AUTH = ("admin", "osys-local")  # per-device CouchDB over NetBird (dev creds)

client = httpx.Client(timeout=5.0)
print(f"Target device: {HOST}")
Target device: osys-77.nb.local

1. Is the device reachable? (clipper health)¶

clipper serves the on-demand clip + timelapse API on :8088. Its /health is the cheapest liveness probe.

In [2]:
url = f"http://{HOST}:{PORTS['clipper']}/health"
try:
    r = client.get(url)
    print(f"GET {url} -> {r.status_code}")
    print(r.text[:500])
except Exception as e:
    print(f"GET {url} FAILED: {e!r}")
GET http://osys-77.nb.local:8088/health -> 200
{"status":"ok","vaapi_decode":true,"vaapi_encode":true,"couchdb_reachable":true,"frames_dir_readable":true,"encode_engine_busy":false,"queue_depth":0}

2. What data does the device hold? (per-device CouchDB)¶

Each device runs its own CouchDB on :5984, replicated up to the fleet master. List its databases over the mesh.

In [3]:
url = f"http://{HOST}:{PORTS['couchdb']}/_all_dbs"
try:
    r = client.get(url, auth=COUCHDB_AUTH)
    print(f"GET {url} -> {r.status_code}")
    dbs = r.json()
    print(f"{len(dbs)} databases:")
    for db in sorted(dbs):
        print("  ", db)
except Exception as e:
    print(f"GET {url} FAILED: {e!r}")
GET http://osys-77.nb.local:5984/_all_dbs -> 200
11 databases:
   _replicator
   _users
   alert-decisions
   alert-feedback
   config
   depth_runs
   detections
   device
   fleet-dashboard
   segments
   telemetry

Where to go next¶

  • Video review UI: http://{HOST}:9080/ (proxied publicly at https://osys-<ID>.playback.rvbeta.net).
  • Depth renders: trigger/report on :8910 (PNGs are retrieved out-of-band — they aren't replicated).
  • Detections / telemetry: read from this device's CouchDB above, or the fleet master at couchdb.rvbeta.net.

Drop new .ipynb files in this folder; the nightly osys-render-demos.timer publishes them to demos.rvbeta.net.