add boot-time synth-diagnostic.service
- synth-diagnostic.service: runs test-unit.py before pipeline services - Type=oneshot, After=prometheus-exporter, Before=pipeline services - Pipeline services: After=synth-diagnostic - deploy: restart prometheus-exporter → start synth-diagnostic → restart pipeline - install.sh: includes synth-diagnostic in SERVICES array
This commit is contained in:
+1
-1
@@ -3,7 +3,7 @@
|
||||
set -euo pipefail
|
||||
|
||||
REPO="/home/arduino/uno-q-audio-synth"
|
||||
SERVICES=(midi-bridge pd-synth-onboard led-matrix-viz prometheus-exporter)
|
||||
SERVICES=(synth-diagnostic midi-bridge pd-synth-onboard led-matrix-viz prometheus-exporter)
|
||||
|
||||
for svc in "${SERVICES[@]}"; do
|
||||
sudo cp "$REPO/system/$svc.service" /etc/systemd/system/
|
||||
|
||||
@@ -104,7 +104,9 @@ deploy:
|
||||
cd {{REPO_DIR}} && git pull && \
|
||||
chmod +x scripts/*.py scripts/*.sh 2>/dev/null; \
|
||||
echo '{{BOARD_PASS}}' | sudo -S systemctl daemon-reload && \
|
||||
echo '{{BOARD_PASS}}' | sudo -S systemctl restart midi-bridge pd-synth-onboard led-matrix-viz prometheus-exporter && \
|
||||
echo '{{BOARD_PASS}}' | sudo -S systemctl restart prometheus-exporter && \
|
||||
echo '{{BOARD_PASS}}' | sudo -S systemctl start synth-diagnostic && \
|
||||
echo '{{BOARD_PASS}}' | sudo -S systemctl restart midi-bridge pd-synth-onboard led-matrix-viz && \
|
||||
echo '[OK] Deployed + restarted'"
|
||||
|
||||
# Start synth (onboard audio)
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
# run-tests.sh — wrapper for test-unit.py with exit code mapping
|
||||
set -euo pipefail
|
||||
|
||||
BOARD="${BOARD_HOST:-192.168.9.167}"
|
||||
cd /home/arduino/uno-q-audio-synth
|
||||
|
||||
echo "[diag] Running synth pipeline diagnostics against $BOARD..."
|
||||
|
||||
python3 scripts/test-unit.py "$BOARD"
|
||||
exit_code=$?
|
||||
|
||||
if [ $exit_code -eq 0 ]; then
|
||||
echo "[diag] All tests PASSED — pipeline healthy"
|
||||
else
|
||||
echo "[diag] Tests FAILED (exit $exit_code) — check dashboard for details"
|
||||
fi
|
||||
|
||||
exit $exit_code
|
||||
@@ -1,6 +1,6 @@
|
||||
[Unit]
|
||||
Description=LED Matrix MIDI Visualization
|
||||
After=arduino-router.service
|
||||
After=arduino-router.service synth-diagnostic.service
|
||||
|
||||
[Service]
|
||||
User=arduino
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[Unit]
|
||||
Description=MIDI rawmidi → Pd UDP bridge (auto-detects gadget/host)
|
||||
After=multi-user.target
|
||||
After=multi-user.target synth-diagnostic.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[Unit]
|
||||
Description=Pure Data Synth (Onboard PMIC Audio)
|
||||
After=multi-user.target
|
||||
After=multi-user.target synth-diagnostic.service
|
||||
Wants=midi-bridge.service
|
||||
|
||||
[Service]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[Unit]
|
||||
Description=Prometheus metrics exporter for synth pipeline
|
||||
After=multi-user.target
|
||||
After=multi-user.target synth-diagnostic.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
[Unit]
|
||||
Description=Synth pipeline diagnostic — runs unit tests at boot
|
||||
DefaultDependencies=no
|
||||
After=multi-user.target prometheus-exporter.service
|
||||
Before=midi-bridge.service pd-synth-onboard.service led-matrix-viz.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/home/arduino/uno-q-audio-synth/scripts/run-tests.sh
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
RemainAfterExit=yes
|
||||
|
||||
# Don't let failures cascade — critical for headless boot
|
||||
# On failure: services won't start, board stays SSH-accessible
|
||||
FailureAction=none
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user