File size: 1,026 Bytes
07001d0 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | #!/usr/bin/env bash
# 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."
|