Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Action merge #33

Merged
merged 14 commits into from
Oct 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions .github/workflows/tile-join.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ jobs:
runs-on: ubuntu-latest
env:
AREA: north-america
#AREA: nova-scotia

steps:
- name: Maximize build space
Expand All @@ -22,24 +23,28 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

- name: Fetch binaries
run: sudo mkdir /mnt/layers && sudo chown runner:docker /mnt/layers && ./bin/fetch-binaries

- name: Fetch tiles
env:
AWS_ENDPOINT_URL: https://ce5627cfc65c8b54d40bb91c0ba7298b.r2.cloudflarestorage.com
AWS_EC2_METADATA_DISABLED: true
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: cd /mnt/layers && aws s3 sync s3://hikes-public/layers/"$AREA"/ . --no-progress
run: sudo mkdir /mnt/layers && sudo chown runner:docker /mnt/layers && cd /mnt/layers && aws s3 sync s3://hikes-public/layers/"$AREA"/ . --no-progress

- name: tile-join
run: /tmp/tile-join --no-tile-size-limit -o tiles.mbtiles /mnt/layers/*.mbtiles
#run: ./bin/docker-tile-join --no-tile-size-limit -o tiles.mbtiles /mnt/layers/*.mbtiles
run: ./bin/docker-tile-smush /mnt/layers/*.mbtiles

- name: Free up space
run: df -h && rm -f /mnt/layers/*.mbtiles && ls -l /mnt/layers && df -h

- name: convert to pmtiles
run: ./bin/docker-pmtiles convert --tmpdir /mnt/layers merged.mbtiles /mnt/layers/tiles.pmtiles

- name: Upload tiles
env:
AWS_ENDPOINT_URL: https://ce5627cfc65c8b54d40bb91c0ba7298b.r2.cloudflarestorage.com
AWS_EC2_METADATA_DISABLED: true
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: aws s3 cp --no-progress tiles.mbtiles s3://hikes-public/"$AREA".mbtiles
run: aws s3 cp --no-progress /mnt/layers/tiles.pmtiles s3://hikes-public/"$AREA".pmtiles
2 changes: 1 addition & 1 deletion .github/workflows/tilemaker-exports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

- name: Export
env:
TILEMAKER: ${{ github.workspace }}/bin/tilemaker-docker
TILEMAKER: ${{ github.workspace }}/bin/docker-tilemaker
run: ./export/export-all $AREA.pbf

- name: Upload GeoJSON
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tilemaker-layers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:

- name: Build layer
env:
TILEMAKER: ${{ github.workspace }}/bin/tilemaker-docker
TILEMAKER: ${{ github.workspace }}/bin/docker-tilemaker
LAYER: ${{ matrix.layer }}
run: bun mapt build "$AREA".pbf $LAYER --mbtiles -- --store /mnt/store --fast $BBOX

Expand Down
8 changes: 8 additions & 0 deletions bin/docker-pmtiles
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh

exec docker run \
--rm \
-w $(readlink -f .) \
-v $(git rev-parse --show-toplevel):$(git rev-parse --show-toplevel) \
-v /mnt/layers:/mnt/layers \
protomaps/go-pmtiles:main "$@"
9 changes: 9 additions & 0 deletions bin/docker-tile-join
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

exec docker run \
--rm \
--entrypoint /usr/bin/tile-join \
-w $(readlink -f .) \
-v $(git rev-parse --show-toplevel):$(git rev-parse --show-toplevel) \
-v /mnt/layers:/mnt/layers \
versatiles/tippecanoe "$@"
11 changes: 11 additions & 0 deletions bin/docker-tile-smush
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh

# An alternative to tile-join. It's special cased for our scenario,
# and is faster. It will explode if the input mbtiles have overlapping
# layers, though.
exec docker run \
--rm \
-w $(readlink -f .) \
-v $(git rev-parse --show-toplevel):$(git rev-parse --show-toplevel) \
-v /mnt/layers:/mnt/layers \
ghcr.io/hikeratlas/tile-smush:master "$@"
File renamed without changes.
Loading