Skip to main content

🛠️ Infrastructure Scripts

Scripts for updating a CONDOR GPU VM after pulling the latest code. Run as root on the target machine.

Quick Start

Run the full update (interactive — prompts for all configuration once):

sudo bash azure/infrastructure/scripts/update.sh

Scripts

ScriptPurpose
update.shOrchestrator — prompts for configuration, validates, then runs all four steps below in order.
update-db.shApplies db/init/001_schema.sql against the running PostgreSQL container.
update-srtm.shDownloads SRTM1 terrain tiles for California coverage. Cached tiles are skipped.
update-compose.shTears down the Docker Compose stack, rebuilds all images, restarts services, and waits for health checks.
update-containerapp.shLogs in to ACR, builds and pushes the server image, and updates the Azure Container App.
acr-bootstrap-build.shOne-time ACR bootstrap — clones the repo into a temp directory and builds the server image in ACR.

Running Individual Scripts

Each script (except acr-bootstrap-build.sh) can be run standalone. It will prompt for only the configuration it needs:

# Just rebuild Docker Compose
sudo bash azure/infrastructure/scripts/update-compose.sh

# Just apply DB migrations
sudo bash azure/infrastructure/scripts/update-db.sh

# Just download SRTM tiles
sudo bash azure/infrastructure/scripts/update-srtm.sh

# Just redeploy the Container App
sudo bash azure/infrastructure/scripts/update-containerapp.sh
info

When run via update.sh, guard variables prevent re-prompting and re-validation across scripts.

ACR Bootstrap Build

The acr-bootstrap-build.sh script requires the following environment variables:

VariableDescription
ACR_NAMEAzure Container Registry name
RESOURCE_GROUP_NAMEResource group containing the ACR
REPO_URLAzure DevOps repository URL
REPO_BRANCHBranch to clone
REPO_PATPersonal Access Token for repo access
IMAGE_TAGTag for the built Docker image