Make/Model Data Loading

This commit is contained in:
Eric Gullickson
2025-11-07 13:51:47 -06:00
parent 060867e796
commit daf1f71e2c
11 changed files with 817 additions and 97 deletions

30
scripts/run-data-load.sh Normal file
View File

@@ -0,0 +1,30 @@
container=vehicle-loader-$(date +%s)
# Start on backend network for outbound internet access
docker run -d --rm \
--name "$container" \
--network motovaultpro_backend \
-v "$PWD":/workspace \
-w /workspace \
-e PGPASSWORD="$(cat secrets/app/postgres-password.txt)" \
python:3.12-slim \
sleep infinity
# Install psycopg before touching the DB network
docker exec "$container" bash -lc "pip install psycopg[binary] >/tmp/pip.log"
# Now attach to the database network so Postgres is reachable
docker network connect motovaultpro_database "$container"
# Run the loader
docker exec "$container" bash -lc "
python scripts/load_vehicle_data.py \
--db-host mvp-postgres \
--db-port 5432 \
--db-user postgres \
--db-name motovaultpro \
--data-dir data/make-models
"
# Clean up
docker rm -f "$container"