#!/usr/bin/env just --justfile set shell := ["bash", "-c"] # Start test database start-db: start-docker-db docker-is-ready # Start test database [private] start-docker-db: docker run -p 127.0.0.1:5439:5432 -d --name mvtbenchdb --rm sourcepole/mvtbenchdb:v1.2 # Stop test database stop-db: docker stop mvtbenchdb # Wait for the test database to be ready [private] docker-is-ready: docker exec mvtbenchdb sh -c 'until pg_isready -h localhost -U postgres; do sleep 1; done' # -- s3 test environment start-minio: mkdir -p s3data docker run --security-opt label=disable -d --rm --name minio -p 9000:9000 -p 9001:9001 -v $PWD/s3data:/data -e MINIO_REGION_NAME=my-region -e MINIO_ROOT_USER=miniostorage -e MINIO_ROOT_PASSWORD=miniostorage minio/minio server /data --console-address ":9001" stop-minio: docker stop minio setup-minio: docker exec minio mc config host add local-docker http://localhost:9000 miniostorage miniostorage docker exec minio mc mb local-docker/tiles || true docker exec minio mc anonymous set public local-docker/tiles # Serve mvtbench tile service serve: docker-is-ready cargo run -- --config={{justfile_directory()}}/bbox-mvtbench.toml --loglevel=debug serve # -- mvtbench seeding # mvtbench seed files seed-bench-files: docker-is-ready rm -rf /tmp/mvtbench cargo build --release ../target/release/bbox-tile-server --config={{justfile_directory()}}/bbox-mvtbench.toml --loglevel=warn seed --tileset=ne_countries --maxzoom=6 # mvtbench seed MBTiles seed-bench-mbtiles: docker-is-ready rm -f /tmp/mvtbench.mbtiles cargo build --release ../target/release/bbox-tile-server --config={{justfile_directory()}}/bbox-mvtbench.toml --loglevel=warn seed --mb-path=/tmp/mvtbench.mbtiles --tileset=ne_countries --maxzoom=6 # mvtbench seed PMTiles seed-bench-pmtiles: docker-is-ready rm -f /tmp/mvtbench.pmtiles cargo build --release ../target/release/bbox-tile-server --config={{justfile_directory()}}/bbox-mvtbench.toml --loglevel=warn seed --pm-path=/tmp/mvtbench.pmtiles --tileset=ne_countries --maxzoom=6 # -- tile store write benchmarks seed-write-bench-files: rm -rf /tmp/writebench cargo build --release ../target/release/bbox-tile-server --config=/dev/null --loglevel=warn seed --tile-path=/tmp/writebench --tileset=mvtbench --maxzoom=6 /tmp/mvtbench.pmtiles seed-write-bench-mbtiles: rm -f /tmp/writebench.mbtiles cargo build --release ../target/release/bbox-tile-server --config=/dev/null --loglevel=info seed --mb-path=/tmp/writebench.mbtiles --tileset=mvtbench --maxzoom=6 /tmp/mvtbench.pmtiles seed-write-bench-pmtiles: rm -f /tmp/writebench.pmtiles cargo build --release ../target/release/bbox-tile-server --config=/dev/null --loglevel=warn seed --pm-path=/tmp/writebench.pmtiles --tileset=mvtbench --maxzoom=6 /tmp/mvtbench.pmtiles # -- tile datasource read benchmarks seed-read-bench-pg: docker-is-ready cargo build --release ../target/release/bbox-tile-server --config={{justfile_directory()}}/bbox-mvtbench.toml --loglevel=warn seed --no-store --tileset=ne_countries --maxzoom=6 seed-read-bench-mbtiles: cargo build --release ../target/release/bbox-tile-server --config=/dev/null --loglevel=info seed --no-store --tileset=mvtbench --maxzoom=6 /tmp/mvtbench.mbtiles seed-read-bench-pmtiles: cargo build --release ../target/release/bbox-tile-server --config=/dev/null --loglevel=warn seed --no-store --tileset=mvtbench --maxzoom=6 /tmp/mvtbench.pmtiles # Run all seeding benchmarks seed-all-benchmarks: seed-bench-files seed-bench-mbtiles seed-bench-pmtiles seed-write-bench-files seed-write-bench-mbtiles seed-write-bench-pmtiles seed-read-bench-pg seed-read-bench-mbtiles seed-read-bench-pmtiles # -- mvtbench test seeding # mvtbench test seed files seed-files: docker-is-ready rm -rf /tmp/mvtbench cargo run -- --config={{justfile_directory()}}/bbox-mvtbench.toml --loglevel=info seed --tileset=ne_countries --maxzoom=3 # mvtbench test seed MBTiles seed-mbtiles: docker-is-ready rm -f /tmp/tilecache.mbtiles cargo run -- --config={{justfile_directory()}}/bbox-mvtbench.toml --loglevel=info seed --mb-path=/tmp/tilecache.mbtiles --tileset=ne_countries --maxzoom=3 # mvtbench test seed PMTiles seed-pmtiles: docker-is-ready rm -f /tmp/tilecache.pmtiles cargo run -- --config={{justfile_directory()}}/bbox-mvtbench.toml --loglevel=debug seed --pm-path=/tmp/tilecache.pmtiles --tileset=ne_countries --maxzoom=3 export AWS_ACCESS_KEY_ID := "miniostorage" export AWS_SECRET_ACCESS_KEY := "miniostorage" export S3_ENDPOINT_URL := "http://localhost:9000" # mvtbench test seed S3 seed-s3: docker-is-ready cargo run -- --config={{justfile_directory()}}/bbox-mvtbench.toml --loglevel=info seed --tileset=ne_countries --s3-path=s3://tiles --overwrite=true --maxzoom=3 # -- raster seeding seed-wms-mbtiles: cargo run -- --loglevel=info seed --tileset=gebco --mb-path=/tmp/gebco.mbtile --maxzoom=3 seed-wms-pmtiles: cargo run -- --loglevel=info seed --tileset=gebco --pm-path=/tmp/gebco.pmtile --maxzoom=3 seed-map-mbtiles: cargo run -- --loglevel=warn seed --tileset=ne_extracts --mb-path=/tmp/ne_extracts.mbtile --maxzoom=3 seed-map-pmtiles: cargo run -- --loglevel=warn seed --tileset=ne_extracts --pm-path=/tmp/ne_extracts.pmtile --maxzoom=3