#!/usr/bin/env bash # Read-only. Establishes portable paths that work on BOTH hosts. # # Your storage is one NFS export mounted at different points: # jupyter-pod -> /workspace (has the MIG GPU) # kls-headnode -> /home/dgx-i-carbine (this shell) # # So we never hardcode absolutes — everything is derived from where this repo # actually sits. Run on either host: bash scripts/whereami.sh set -uo pipefail REPO="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" ANURAG="$(dirname "$REPO")" # .../carbine/anurag CARBINE="$(dirname "$ANURAG")" # .../carbine BASE="$(dirname "$CARBINE")" # /workspace OR /home/dgx-i-carbine ROOT="$ANURAG/voicerag_data" # data root, INSIDE anurag echo "════════ HOST ════════" echo " hostname : $(hostname -s 2>/dev/null || hostname)" echo " user : $(id -un 2>/dev/null || echo "uid $(id -u)")" echo echo "════════ DERIVED PATHS (portable) ════════" printf ' %-14s %s\n' repo "$REPO" printf ' %-14s %s\n' anurag "$ANURAG" printf ' %-14s %s\n' base "$BASE" printf ' %-14s %s\n' "DATA ROOT" "$ROOT" echo echo "════════ STORAGE ════════" printf ' %-14s ' "anurag"; df -h "$ANURAG" 2>/dev/null | awk 'NR==2{printf "%s free of %s (%s)\n",$4,$2,$1}' || echo "?" for extra in /data "$BASE/../data"; do [ -d "$extra" ] && { printf ' %-14s ' "$extra"; df -h "$extra" 2>/dev/null | awk 'NR==2{printf "%s free of %s\n",$4,$2}'; } done echo echo " -- stray data dirs from the earlier default (should be empty/absent) --" _seen="" for cand in "$BASE/voicerag_data" "$HOME/voicerag_data" "/workspace/voicerag_data"; do _real="$(readlink -f "$cand" 2>/dev/null || echo "$cand")" case " $_seen " in *" $_real "*) continue ;; esac _seen="$_seen $_real" cand="$_real" if [ -d "$cand" ]; then echo " FOUND $cand ($(du -sh "$cand" 2>/dev/null | cut -f1))" else echo " absent $cand" fi done echo echo " -- current data root --" if [ -d "$ROOT" ]; then echo " exists: $ROOT ($(du -sh "$ROOT" 2>/dev/null | cut -f1))" [ -d "$ROOT/hf_cache" ] && echo " hf_cache: $(du -sh "$ROOT/hf_cache" 2>/dev/null | cut -f1)" else echo " not created yet" fi echo echo "════════ GPU ON THIS HOST ════════" if command -v nvidia-smi >/dev/null 2>&1; then nvidia-smi -L 2>&1 | sed 's/^/ /' else echo " no nvidia-smi -> no GPU here. Run GPU work on jupyter-pod." fi echo echo "════════ RUNNING JOBS (this host only) ════════" pgrep -af '01_download.py|pseudo_docs.py|fertility.py' 2>/dev/null | sed 's/^/ /' || echo " none" echo " NOTE: processes on jupyter-pod are invisible from here and vice versa." echo echo "════════ USE THIS ════════" cat </dev/null || echo "$REPO")/.." && pwd)/voicerag_data" EOF