Skip to content

Commit

Permalink
[build] use less diskspace on non-planet build
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelkirk committed Feb 27, 2024
1 parent a592273 commit f330166
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: earthly/actions-setup@v1
with:
# pinning to `latest` requires using the GH API, which causes spurious rate limiting errors
version: "0.7.4"
version: "0.8.4"
- uses: actions/checkout@v2
- run: earthly --version
- run: earthly -P +build --area=Bogota
Expand Down
31 changes: 20 additions & 11 deletions Earthfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
VERSION --use-copy-link 0.6

VERSION 0.8

##############################
# OSM extract
##############################
ARG --global is_planet_build = false

build:
# The name of <area>.osm.pbf if you've downloaded a custom extract, or the
Expand Down Expand Up @@ -343,15 +343,24 @@ planetiler-build-mbtiles:

COPY ./services/tilebuilder/percent-of-available-memory .

RUN --entrypoint -- \
-Xmx$(./percent-of-available-memory 75) \
`# return unused heap memory to the OS` \
-XX:MaxHeapFreeRatio=40 \
--osm_path=/data/data.osm.pbf \
# --bounds=planet \
`# Store temporary node locations at fixed positions in a memory-mapped file` \
--nodemap-type=array --storage=mmap \
--force
IF [ "$is_planet_build" = "false" ]
RUN --entrypoint -- \
--osm_path=/data/data.osm.pbf \
--force
ELSE
RUN --entrypoint -- \
-Xmx$(./percent-of-available-memory 75) \
`# return unused heap memory to the OS` \
-XX:MaxHeapFreeRatio=40 \
--osm_path=/data/data.osm.pbf \

--bounds=planet \
`# Store temporary node locations at fixed positions in a memory-mapped file` \
--nodemap-type=array \
--storage=mmap \
--force
END


SAVE ARTIFACT /data/output.mbtiles /output.mbtiles

Expand Down

0 comments on commit f330166

Please sign in to comment.