askrobots / dbbasic-object-primitive
Public
Python functions as REST objects, with clustering, load balancing and state replication; no containers or orchestration.
deploy.sh · 1.0 KB · 32 lines
| 1 | #!/bin/bash |
| 2 | # Deploy code to all stations |
| 3 | # Run this from the master station |
| 4 | # Reads configuration from cluster.tsv |
| 5 | |
| 6 | # Load cluster configuration |
| 7 | eval "$(python cluster_shell_helper.py)" |
| 8 | |
| 9 | echo "=== Deploying to All Stations ===" |
| 10 | echo |
| 11 | |
| 12 | # Deploy to worker 1 |
| 13 | if [ -n "$WORKER1_SSH" ]; then |
| 14 | echo "Deploying to $WORKER1_ID ($WORKER1_HOST)..." |
| 15 | rsync -av --exclude='.venv' --exclude='data' --exclude='__pycache__' --exclude='.git' --exclude='_to_move' --exclude='cluster.tsv' \ |
| 16 | ./ ${WORKER1_SSH}:~/multiplexing/ |
| 17 | echo "✓ $WORKER1_ID deployed" |
| 18 | echo |
| 19 | fi |
| 20 | |
| 21 | # Deploy to worker 2 |
| 22 | if [ -n "$WORKER2_SSH" ]; then |
| 23 | echo "Deploying to $WORKER2_ID ($WORKER2_HOST)..." |
| 24 | rsync -av --exclude='.venv' --exclude='data' --exclude='__pycache__' --exclude='.git' --exclude='_to_move' --exclude='cluster.tsv' \ |
| 25 | ./ ${WORKER2_SSH}:~/multiplexing/ |
| 26 | echo "✓ $WORKER2_ID deployed" |
| 27 | echo |
| 28 | fi |
| 29 | |
| 30 | echo "=== Deployment Complete ===" |
| 31 | echo "Servers will auto-reload (uvicorn --reload=True)" |
| 32 | echo "Run ./restart_cluster.sh to restart heartbeat daemons with new version" |