#!/usr/bin/env bash # Inside the image (bin/devrun bash scripts/dev_server.sh gather): serve the app with uvicorn on 127.0.0.1:20000, # run the package smoke test against it, stop the server with SIGTERM (its lifespan closes the device). set -u variant="${1:-gather}" export METEOR2_VARIANT="$variant" METEOR2_WEIGHTS_DIR=/weights cd /work python -m uvicorn --host 127.0.0.1 --port 20000 --lifespan on tt_meteor2.server.app:app >/logs/dev_server_$variant.log 2>&1 & pid=$! python3 tt_meteor2/server/smoke_test.py --url http://127.0.0.1:20000 --wait 900 --out /logs/dev_server_$variant.json \ --reference tt_meteor2/samples/synthetic_8cam.$variant.reference.json rc=$? kill -TERM $pid wait $pid tail -5 /logs/dev_server_$variant.log exit $rc