Skip to main content

End-to-End Deployment Runbook

📌 What is this for? (Quick Summary)​

In simple words: This is the step-by-step recipe book for launching and running the whole TuTr Hyperloop system from scratch. If you ever need to set up a new computer, put code on the Raspberry Pi, or publish updates to the live web dashboard at dashboard.tutr.tech, follow the commands on this page.


1. Edge Device Deployment (Raspberry Pi 5)​

Prerequisites:​

  • Raspberry Pi 5 with 64-bit Raspberry Pi OS (Debian Bookworm).
  • Network interface configured with static IP or DHCP on trackside network.
  • Go toolchain 1.22+ installed in /usr/local/go.
  • Python 3.11+ with venv support.
  • FFmpeg installed (sudo apt update && sudo apt install -y ffmpeg).

Deployment Steps:​

# 1. Clone repository to home directory
cd /home/ssm-user
git clone https://github.com/TutrTech/RPi-Package.git
cd RPi-Package

# 2. Run the automated installer
chmod +x installer.sh updater.sh
./installer.sh

# 3. Verify all systemd services are active
sudo systemctl status pod-gateway pod-stream pod-emulator pod-web

2. 2D Operations Dashboard Deployment (dashboard.tutr.tech)​

Local Development:​

cd "Client Dashboard/Dashboard"
npm install
npm run dev
# Accessible at http://localhost:5173

Production Build & S3/CloudFront Deployment:​

cd "Client Dashboard/Dashboard"

# Verify test suite passes 100%
npm run test

# Build production bundle
npm run build

# Deploy dist/ to S3 bucket backing dashboard.tutr.tech
aws s3 sync dist/ s3://dashboard-hosting-bucket/ --delete

# Invalidate CloudFront cache
aws cloudfront create-invalidation --distribution-id E3XXXXXXXXXXXX --paths "/*"

3. 3D Visualizer Dashboard Deployment​

Local Development:​

cd "Client Dashboard/ThreeJsForDemoPurpose"
npm install
npm run dev
# Accessible at http://localhost:5173

Production Build:​

cd "Client Dashboard/ThreeJsForDemoPurpose"
npm run build
# Compiled assets generated in dist/

4. MediaMTX Video Streaming Server Setup​

📘 Full Step-by-Step Guide: For a complete walkthrough including AWS EC2 launch settings, firewall rules, and Raspberry Pi edge forwarder setup for new projects, see the Camera Setup & MediaMTX Streaming Guide.

On the video streaming EC2 instance (cam.tutr.tech):

4.1 Installation & SSL Setup​

# 1. Install prerequisites & obtain Let's Encrypt certificate
sudo apt update && sudo apt install -y certbot ffmpeg curl tar jq
sudo certbot certonly --standalone -d "cam.tutr.tech" --agree-tos -m "dev@tutr.tech" --non-interactive

# 2. Download MediaMTX binary
wget https://github.com/bluenviron/mediamtx/releases/download/v1.9.3/mediamtx_v1.9.3_linux_amd64.tar.gz
tar -xzf mediamtx_v1.9.3_linux_amd64.tar.gz
sudo install -m 755 mediamtx /usr/local/bin/mediamtx
sudo mkdir -p /etc/mediamtx

4.2 Production Configuration (/etc/mediamtx/mediamtx.yml)​

Write the configuration directly to /etc/mediamtx/mediamtx.yml:

logLevel: info
logDestinations: [stdout]

# RTSP Ingestion from vehicle
rtsp: yes
rtspAddress: :8554
protocols: [tcp]

# HLS Fallback
hls: yes
hlsAddress: :8888
hlsAlwaysRemux: yes

# WebRTC / WHEP Server (< 300ms latency)
webrtc: yes
webrtcAddress: :8889
webrtcEncryption: yes
webrtcServerKey: /etc/letsencrypt/live/cam.tutr.tech/privkey.pem
webrtcServerCert: /etc/letsencrypt/live/cam.tutr.tech/fullchain.pem
webrtcAllowOrigin: '*'
webrtcLocalUDPAddress: :8189
webrtcAdditionalHosts: ["cam.tutr.tech"]

paths:
cam1:
source: publisher
cam2:
source: publisher
all_others:
source: publisher

4.3 Systemd Service (/etc/systemd/system/mediamtx.service)​

[Unit]
Description=MediaMTX Live Video Streaming Server
After=network.target

[Service]
Type=simple
ExecStart=/usr/local/bin/mediamtx /etc/mediamtx/mediamtx.yml
Restart=always
RestartSec=3
LimitNOFILE=65536

[Install]
WantedBy=multi-user.target

Enable and start the service:

sudo systemctl daemon-reload
sudo systemctl enable mediamtx
sudo systemctl start mediamtx