| # One-shot environment bootstrap for a fresh container / server. | |
| # Run this ONCE after every 3-day recycle on the server. | |
| set -euo pipefail | |
| cd "$(dirname "$0")/.." | |
| echo "[bootstrap] python: $(python3 --version)" | |
| echo "[bootstrap] pip: $(python3 -m pip --version)" | |
| # install deps into user site (no conda) | |
| python3 -m pip install --user --upgrade pip setuptools wheel | |
| python3 -m pip install --user -r requirements.txt | |
| # ffmpeg (debian/ubuntu image); skip silently if already there | |
| if ! command -v ffmpeg >/dev/null 2>&1; then | |
| if command -v apt-get >/dev/null 2>&1; then | |
| apt-get update -y && apt-get install -y --no-install-recommends \ | |
| ffmpeg parallel libgl1 libglib2.0-0 | |
| else | |
| echo "[bootstrap] ffmpeg missing and apt-get unavailable; install it manually" | |
| fi | |
| fi | |
| mkdir -p outputs | |
| # .env seed if missing | |
| if [ ! -f .env ]; then | |
| cp .env.example .env | |
| echo "[bootstrap] created .env; edit it to set WANDB_API_KEY / DATA_ROOT etc." | |
| fi | |
| echo "[bootstrap] done." | |