scripts: run_demo.sh launcher (no python on PATH needed), friendly port-in-use check in run_bridge.sh; README updated
This commit is contained in:
@@ -1,7 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
# Start the AICC capsule testbed bridge over WebSocket (headless).
|
||||
# Usage: scripts/run_bridge.sh [port] (default 8765)
|
||||
# Note: the bridge keeps running until interrupted (Ctrl-C).
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
PORT="${1:-8765}"
|
||||
|
||||
if python3 - "$PORT" <<'EOF'
|
||||
import socket, sys
|
||||
port = int(sys.argv[1])
|
||||
s = socket.socket()
|
||||
if s.connect_ex(("127.0.0.1", port)) == 0:
|
||||
print(f"port {port} is already in use")
|
||||
sys.exit(1)
|
||||
EOF
|
||||
then
|
||||
:
|
||||
else
|
||||
echo "error: a bridge may already be running on port $PORT." >&2
|
||||
echo "stop it first, e.g.: fuser -k ${PORT}/tcp (or kill the run_bridge.sh process)" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exec testbed/.venv/bin/python -m testbed.bridge --host 127.0.0.1 --port "$PORT"
|
||||
|
||||
Executable
+9
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
# Run the AICC capsule demo (agent drives the capsule to the beacon).
|
||||
# Usage: scripts/run_demo.sh [demo args...]
|
||||
# e.g. scripts/run_demo.sh --agent auto
|
||||
# scripts/run_demo.sh --agent scripted
|
||||
# scripts/run_demo.sh --agent llm --model gemma4:e2b
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
exec testbed/.venv/bin/python -m testbed.demo "$@"
|
||||
+1
-1
@@ -14,5 +14,5 @@ pip install pillow websockets openai pytest pytest-asyncio
|
||||
|
||||
echo "Setup done. Activate with: source testbed/.venv/bin/activate"
|
||||
echo "Run the bridge: scripts/run_bridge.sh"
|
||||
echo "Run the demo: testbed/.venv/bin/python -m testbed.demo --agent auto"
|
||||
echo "Run the demo: scripts/run_demo.sh --agent auto"
|
||||
echo "Conformance: testbed/.venv/bin/python -m testbed.conformance ~/Desktop/aicc-spec/conformance/scenarios"
|
||||
|
||||
Reference in New Issue
Block a user