plmap_2026-11-02: vastai_setup.sh = tools/vastai/setup.sh at ff474fe (adds the claude stage)
Browse files7 unmodified lines89101112131415161787 unmodified lines10510610710810911054 unmodified lines1651661671681691701713 unmodified lines1751761771781791801811821837 unmodified lines# bash setup.sh # every stage, in order (each one is safe to rerun)# bash setup.sh data checks # only some stages## Stages: preflight paths code conda plmap secrets data external omniroam miniworld checks# Everything lives under $WORKDIR/u7543832, which becomes /home/projects/u7543832 (701 paths in the code are# absolute; data/Holo360D_aligned_views symlinks with absolute targets). Not covered: outputs/code_snapshots# (copy it from the cluster, see the end) and Slurm (run the run_*.sh files with bash; #SBATCH lines are comments).set -euo pipefailWORKDIR=${WORKDIR:-/workspace}87 unmodified linesfi}stage_data() {say "data: plmap_2026-11-02 from eztao/data_transfer ($JOBS tars in flight, sha256-checked, resumable)"conda_on plmap54 unmodified linescd - >/dev/null}ALL=(preflight paths code conda plmap secrets data external omniroam miniworld checks)STAGES=("$@"); [ ${#STAGES[@]} -gt 0 ] || STAGES=("${ALL[@]}")for s in "${STAGES[@]}"; dodeclare -F "stage_$s" >/dev/null || { echo "unknown stage '$s' (have: ${ALL[*]})"; exit 2; }3 unmodified linessay "done (log: $LOG)"cat <<EOFNext:* outputs/code_snapshots/ (106 MB, frozen trainer copies) is not on Hugging Face. From the cluster:rsync -a -e "ssh -p <vast ssh port>" /home/projects/u7543832/plmap/outputs/code_snapshots/ \\root@<vast ip>:$U/plmap/outputs/code_snapshots/* No Slurm here: run a job script with bash run_xxx.sh (or tmux new -s run 'bash run_xxx.sh').* Activate the env: source $LINK/anaconda3/etc/profile.d/conda.sh && conda activate plmapEOF7 unmodified lines8910111213141516171887 unmodified lines10610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215354 unmodified lines2082092102112122132143 unmodified lines2182192202212222232242252262277 unmodified lines# bash setup.sh # every stage, in order (each one is safe to rerun)# bash setup.sh data checks # only some stages## Stages: preflight paths code conda plmap secrets claude data external omniroam miniworld checks# Everything lives under $WORKDIR/u7543832, which becomes /home/projects/u7543832 (701 paths in the code are# absolute; data/Holo360D_aligned_views symlinks with absolute targets). Not covered: Claude's memory +# settings.json and outputs/code_snapshots, which are in neither git nor HF -- push them from the cluster with# tools/vastai/claude_state.sh (see the end) -- and Slurm (run the run_*.sh files with bash; #SBATCH lines are comments).set -euo pipefailWORKDIR=${WORKDIR:-/workspace}87 unmodified linesfi}stage_claude() {say "claude: one project dir for both spellings of the repo path + a machine note in ~/.claude/CLAUDE.md"# Claude Code keys its memory and transcripts on the start directory (every non-alphanumeric -> '-'). Here that is# either $LINK/plmap -- the cluster's key, where claude_state.sh pushes the memory -- or the real $U/plmap behind# the link, so the second key is made a symlink to the first.local projects=$HOME/.claude/projects key realkey=$(printf '%s' "$LINK/plmap" | sed 's/[^A-Za-z0-9]/-/g')real=$(readlink -f "$LINK/plmap" | sed 's/[^A-Za-z0-9]/-/g')mkdir -p "$projects/$key"if [ "$real" != "$key" ]; thenif [ -d "$projects/$real" ] && [ ! -L "$projects/$real" ]; then # a session already ran under the real pathrsync -a --ignore-existing "$projects/$real/" "$projects/$key/"mv "$projects/$real" "$projects/$real.bak-$(date +%Y%m%d%H%M%S)"echo "merged the existing $real/ into $key/ (nothing overwritten; the original is kept as $real.bak-*)"filn -sfn "$projects/$key" "$projects/$real"echo "$projects/$real -> $key"fi# AGENTS.md and several memories are Slurm-cluster rules; without this note Claude tries sbatch here.if [ -f "$HOME/.claude/CLAUDE.md" ]; thenecho "kept the existing $HOME/.claude/CLAUDE.md"elsecat > "$HOME/.claude/CLAUDE.md" <<EOF# This machine: a rented Vast.ai GPU box, not the Slurm cluster (written by tools/vastai/setup.sh, stage claude)- No Slurm, no login node: run run_*.sh with \`bash\` inside tmux; check nvidia-smi, RAM and \`df -h $WORKDIR\` first.- Cluster-only rules do NOT apply here: the Slurm/QoS/MaxWall/login-node rules in AGENTS.md, and the memoriesslurm-only-best-gpu-max-time, cluster-cpu-jobs, jobtrack-tool, job-description-bilingual,shared-fs-nearly-full, disk-free-holo360d-depth.- Still apply: W&B logging, reports in Chinese, never modify the original dataset, ask before deleting code.- $LINK is a symlink to $U. Env: source $LINK/anaconda3/etc/profile.d/conda.sh && conda activate plmap- New memories written here are merged back to the cluster by hand (claude_state.sh pull): date them and tag them "(Vast)".EOFecho "wrote $HOME/.claude/CLAUDE.md"fiif [ -f "$projects/$key/memory/MEMORY.md" ]; thenecho "memory: $(ls "$projects/$key/memory" | grep '\.md$' | grep -cvx MEMORY.md) notes + MEMORY.md"elseecho "memory not here yet; on the cluster run: bash $LINK/plmap/tools/vastai/claude_state.sh push root@<vast ip> <vast ssh port>"ficommand -v claude >/dev/null || echo "claude CLI not installed: curl -fsSL https://claude.ai/install.sh | bash"}stage_data() {say "data: plmap_2026-11-02 from eztao/data_transfer ($JOBS tars in flight, sha256-checked, resumable)"conda_on plmap54 unmodified linescd - >/dev/null}ALL=(preflight paths code conda plmap secrets claude data external omniroam miniworld checks)STAGES=("$@"); [ ${#STAGES[@]} -gt 0 ] || STAGES=("${ALL[@]}")for s in "${STAGES[@]}"; dodeclare -F "stage_$s" >/dev/null || { echo "unknown stage '$s' (have: ${ALL[*]})"; exit 2; }3 unmodified linessay "done (log: $LOG)"cat <<EOFNext:* Claude's memory + settings.json and outputs/code_snapshots/ (106 MB, frozen trainer copies) are not onHugging Face. From the cluster (after the code stage here):bash /home/projects/u7543832/plmap/tools/vastai/claude_state.sh push root@<vast ip> <vast ssh port>* Start Claude from the repo: cd $LINK/plmap && claude -- then /memory should list the notes.* No Slurm here: run a job script with bash run_xxx.sh (or tmux new -s run 'bash run_xxx.sh').* Activate the env: source $LINK/anaconda3/etc/profile.d/conda.sh && conda activate plmapEOF
plmap_2026-11-02/vastai_setup.sh+51-7