Skip to content

Commit

Permalink
Implement http pmtiles
Browse files Browse the repository at this point in the history
  • Loading branch information
nyurik committed Nov 9, 2023
1 parent f7c69f8 commit 56efa4c
Show file tree
Hide file tree
Showing 15 changed files with 715 additions and 236 deletions.
186 changes: 182 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,13 @@ martin-tile-utils = { path = "./martin-tile-utils", version = "0.1.0" }
mbtiles = { path = "./mbtiles", version = "0.7.0", default-features = false }
num_cpus = "1"
pbf_font_tools = { version = "2.5.0", features = ["freetype"] }
pmtiles = { version = "0.3", features = ["mmap-async-tokio", "tilejson"] }
pmtiles = { version = "0.3", features = ["http-async", "mmap-async-tokio", "tilejson"] }
postgis = "0.9"
postgres = { version = "0.19", features = ["with-time-0_3", "with-uuid-1", "with-serde_json-1"] }
postgres-protocol = "0.6"
pretty_assertions = "1"
regex = "1"
reqwest = { version = "0.11", default-features = false, features = ["rustls-tls-native-roots"] }
rstest = "0.18"
rustls = { version = "0.21", features = ["dangerous_configuration"] }
rustls-native-certs = "0.6"
Expand All @@ -59,6 +60,7 @@ thiserror = "1"
tilejson = "0.3"
tokio = { version = "1.33.0", features = ["macros"] }
tokio-postgres-rustls = "0.10"
url = "2.4"

[profile.dev.package]
# See https://github.com/launchbadge/sqlx#compile-time-verification
Expand All @@ -67,6 +69,6 @@ sqlx-macros.opt-level = 3
insta.opt-level = 3
similar.opt-level = 3

#[patch.crates-io]
[patch.crates-io]
#sqlite-hashes = { path = "/home/nyurik/dev/rust/sqlite-hashes" }
#pmtiles = { path = "../pmtiles-rs" }
8 changes: 8 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ services:
depends_on:
- db

fileserver:
image: nginx:alpine
restart: unless-stopped
ports:
- "5412:80"
volumes:
- ./tests/fixtures/pmtiles2:/usr/share/nginx/html

db-is-ready:
# This should match the version of postgres used in the CI workflow
image: postgis/postgis:14-3.3-alpine
Expand Down
12 changes: 8 additions & 4 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,16 @@ clean-test:
rm -rf tests/output

# Start a test database
start: (docker-up "db") docker-is-ready
start: start-pmtiles-server (docker-up "db") docker-is-ready

# Start an ssl-enabled test database
start-ssl: (docker-up "db-ssl") docker-is-ready
start-ssl: start-pmtiles-server (docker-up "db-ssl") docker-is-ready

# Start an ssl-enabled test database that requires a client certificate
start-ssl-cert: (docker-up "db-ssl-cert") docker-is-ready
start-ssl-cert: start-pmtiles-server (docker-up "db-ssl-cert") docker-is-ready

# Start a legacy test database
start-legacy: (docker-up "db-legacy") docker-is-ready
start-legacy: start-pmtiles-server (docker-up "db-legacy") docker-is-ready

# Start a specific test database, e.g. db or db-legacy
[private]
Expand All @@ -84,6 +84,10 @@ restart:
stop:
docker-compose down

# Start test python server for testing HTTP pmtiles
start-pmtiles-server:
docker-compose up -d fileserver

# Run benchmark tests
bench: start
cargo bench
Expand Down
Loading

0 comments on commit 56efa4c

Please sign in to comment.