Files
svc-gw/scripts/deploy.sh
T
mikkeli a1ed8d8fc5 Boundary v0: WebSocket with heartbeats, acked commands and mock state
One socket on :7700 carries hello, heartbeats both ways (5 s timeout), 5 Hz
state snapshots of envelopes, and idempotent commands. 'mark' is forwarded to
the recorder's control socket. --mock synthesises degrading state flagged as
mock in every envelope; without it a client gets hello and heartbeats only.
Peers outside loopback, RFC 1918 and the tailnet are refused. Deployed on the
car Orin as yukart-gw.service.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DDwfd6Ki8UfG4hK6W5YpJz
2026-10-09 20:19:05 +09:00

32 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env bash
# Build svc-gw for aarch64, check it against the car's glibc, and install it
# on an Orin as the yukart-gw service.
#
# usage: scripts/deploy.sh [host] (default: mikkeli-orin-nano)
#
# Cross-compiles from the workstation (the documented fallback): the development
# Orin is the preferred native build host. Either way check-glibc.sh gates it.
set -euo pipefail
HOST="${1:-mikkeli-orin-nano}"
cd "$(dirname "$0")/.."
TARGET=aarch64-unknown-linux-gnu
BIN="target/$TARGET/release/svc-gw"
cargo build --release --target "$TARGET"
scripts/check-glibc.sh "$BIN"
# Binary lives under ~/infra per the host repo's guidelines; /usr/local/bin gets a symlink.
ssh "$HOST" 'mkdir -p ~/infra/svc-gw'
scp -q "$BIN" "$HOST:infra/svc-gw/svc-gw.new"
scp -q deploy/yukart-gw.service "$HOST:infra/svc-gw/yukart-gw.service"
ssh "$HOST" 'set -e
mv ~/infra/svc-gw/svc-gw.new ~/infra/svc-gw/svc-gw
sudo ln -sfn "$HOME/infra/svc-gw/svc-gw" /usr/local/bin/yukart-gw
sudo install -m 0644 ~/infra/svc-gw/yukart-gw.service /etc/systemd/system/yukart-gw.service
sudo systemctl daemon-reload
sudo systemctl enable yukart-gw.service >/dev/null
sudo systemctl restart yukart-gw.service
sleep 1
systemctl --no-pager --lines=5 status yukart-gw.service'