#!/bin/bash # Sync the repository (code + processed data) to a MacLustr node and build its venv. Usage: scripts/cluster_setup.sh [--no-data] set -e NODE=$1; NODATA=$2 REMOTE=~/wp31/prisme-slm ssh "$NODE" "mkdir -p $REMOTE" rsync -az --delete --exclude .venv --exclude data/raw --exclude '/experiments/runs' --exclude .git --exclude 'data/processed' --exclude '.pytest_cache' --exclude '__pycache__' ./ "$NODE:$REMOTE/" if [ "$NODATA" != "--no-data" ]; then rsync -az data/processed/ "$NODE:$REMOTE/data/processed/" fi ssh "$NODE" "export PATH=\$HOME/.local/bin:/opt/homebrew/bin:\$PATH; cd $REMOTE && (test -x .venv/bin/python || uv venv --python 3.12 .venv -q) && uv pip install -p .venv/bin/python -q torch numpy pyyaml pytest hypothesis matplotlib tokenizers datasets safetensors scipy pandas psutil tqdm && .venv/bin/python scripts/environment_audit.py --smoke --out hardware/device_inventory_\$(hostname -s).json | grep -E 'hostname|cpu_brand|gpu_cores|\"torch\"|mps' " echo "setup done on $NODE"