File size: 1,315 Bytes
4a3ac26 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | #!/usr/bin/env bash
# Set up the statewide tile pipeline on a fresh Ubuntu container that already has PyTorch (+CUDA), e.g. a rented GPU
# container from a "pytorch" image. Usage (as root on the box, repo copied to /root/clearing-qld):
# bash scripts/statewide_setup.sh # installs GDAL-bundled wheels, checks Earth Search + GPU
set -euo pipefail
cd "$(dirname "$0")/.."
PY=${PY:-python3}
$PY -m pip install -q --upgrade pip
# rasterio wheels bundle GDAL (no system GDAL needed). Torch is NOT installed here: use the container's.
$PY -m pip install -q "numpy>=1.26,<3" "pandas>=2.1,<3" "pyarrow>=15" "rasterio>=1.4.3" "pyproj>=3.6" "shapely>=2.0" \
"geopandas>=1.0,<2" "requests>=2.31" "pillow>=10" "scipy>=1.11" "lightgbm==4.6.0"
export PYTHONPATH=$PWD/src
$PY - <<'PY'
import torch, rasterio, time, os
os.environ["AWS_NO_SIGN_REQUEST"] = "YES"
print("torch", torch.__version__, "cuda", torch.cuda.is_available(), torch.cuda.get_device_name(0) if torch.cuda.is_available() else "")
print("rasterio", rasterio.__version__, "gdal", rasterio.__gdal_version__, "cpus", os.cpu_count())
from brigalow.statewide import tile_items
t = time.time(); it = tile_items("55KCB", "2024-07-01", "2024-07-31")
print(f"earth search ok: {len(it)} items for 55KCB Jul 2024 in {time.time()-t:.1f}s")
PY
echo "setup ok"
|