#!/usr/bin/env bash # AZ-615: drive the Tier-2 Reality Gate e2e harness on a remote Jetson. # # Runs from the developer Mac. Assumes: # * `ssh jetson-e2e` works via key auth + ~/.ssh/config (see # _docs/03_implementation/jetson_harness_setup.md for one-time setup). # * The Jetson has docker + nvidia-container-toolkit + ≥ 30 GB free on # /var/lib/docker. # # Flow: # 1. rsync the working tree to the Jetson under ~/gps-denied-onboard/ # (excluding .git, LFS pointers, build artefacts). # 2. ssh into the Jetson and `docker compose build` the e2e-runner image # against tests/e2e/Dockerfile.jetson. # 3. ssh again and `docker compose up --abort-on-container-exit # --exit-code-from e2e-runner` so the local exit code reflects the # remote test verdict. # 4. stdout / stderr stream back to the Mac terminal. # # Exit code propagates the docker-compose exit code (which == the # e2e-runner container's exit code, which == pytest's verdict). set -euo pipefail # ---------------------------------------------------------------------- # Configuration SSH_ALIAS="${JETSON_SSH_ALIAS:-jetson-e2e}" REMOTE_DIR="${JETSON_REMOTE_DIR:-~/gps-denied-onboard}" COMPOSE_FILE="docker-compose.test.jetson.yml" # Repo root regardless of where the script is invoked from. SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" REPO_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)" # ---------------------------------------------------------------------- # Pre-flight if ! command -v rsync >/dev/null 2>&1; then echo "ERROR: rsync not on PATH — install with 'brew install rsync' or apt" >&2 exit 64 fi if ! ssh -o BatchMode=yes -o ConnectTimeout=5 "${SSH_ALIAS}" true 2>/dev/null; then cat >&2 <