mirror of
https://github.com/hyperknot/openfreemap.git
synced 2026-05-21 14:02:15 +00:00
work
This commit is contained in:
@@ -84,15 +84,19 @@ def prepare_http_host(c):
|
|||||||
|
|
||||||
|
|
||||||
def debug_tmp(c):
|
def debug_tmp(c):
|
||||||
c.sudo('rm -rf /data/ofm/logs')
|
for file in [
|
||||||
c.sudo('mkdir -p /data/ofm/logs')
|
'extract_btrfs.sh',
|
||||||
c.sudo('rm -f /data/nginx/logs/*')
|
'planetiler_monaco.sh',
|
||||||
put(c, f'{ASSETS_DIR}/nginx/nginx.conf', '/etc/nginx/')
|
'planetiler_planet.sh',
|
||||||
put(c, f'{SCRIPTS_DIR}/http_host/nginx_site.conf', '/data/nginx/sites')
|
'prepare-virtualenv.sh',
|
||||||
c.sudo('nginx -t')
|
'upload_cloudflare.sh',
|
||||||
c.sudo('service nginx restart')
|
]:
|
||||||
|
put(
|
||||||
benchmark(c)
|
c,
|
||||||
|
SCRIPTS_DIR / 'tile_gen' / file,
|
||||||
|
TILE_GEN_BIN,
|
||||||
|
permissions='755',
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@click.command()
|
@click.command()
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ sudo umount mnt_rw 2> /dev/null || true
|
|||||||
sudo umount mnt_rw2 2> /dev/null || true
|
sudo umount mnt_rw2 2> /dev/null || true
|
||||||
rm -rf mnt_rw* tmp_*
|
rm -rf mnt_rw* tmp_*
|
||||||
rm -f -- *.btrfs *.gz
|
rm -f -- *.btrfs *.gz
|
||||||
rm -f -- *.log *.txt
|
rm -rf -- *.log *.txt logs
|
||||||
|
|
||||||
# make an empty file that's definitely bigger then the current OSM output
|
# make an empty file that's definitely bigger then the current OSM output
|
||||||
fallocate -l 200G image.btrfs
|
fallocate -l 200G image.btrfs
|
||||||
@@ -44,6 +44,8 @@ $VENV_PYTHON $TILE_GEN_BIN/extract_mbtiles/extract_mbtiles.py \
|
|||||||
tiles.mbtiles mnt_rw/extract \
|
tiles.mbtiles mnt_rw/extract \
|
||||||
> extract_out.log 2> extract_err.log
|
> extract_out.log 2> extract_err.log
|
||||||
|
|
||||||
|
cp mnt_rw/extract/osm_date .
|
||||||
|
|
||||||
grep fixed extract_out.log > dedupl_fixed.log || true
|
grep fixed extract_out.log > dedupl_fixed.log || true
|
||||||
|
|
||||||
# Unfortunately, by deleting files from the btrfs partition, the size _grows_.
|
# Unfortunately, by deleting files from the btrfs partition, the size _grows_.
|
||||||
@@ -79,6 +81,7 @@ sudo btrfs filesystem usage mnt_rw2
|
|||||||
} > stats2.txt
|
} > stats2.txt
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
sudo umount mnt_rw
|
sudo umount mnt_rw
|
||||||
sudo umount mnt_rw2
|
sudo umount mnt_rw2
|
||||||
rm -r mnt_rw*
|
rm -r mnt_rw*
|
||||||
@@ -92,4 +95,8 @@ mv image2.btrfs tiles.btrfs
|
|||||||
|
|
||||||
pigz tiles.btrfs --fast
|
pigz tiles.btrfs --fast
|
||||||
|
|
||||||
|
mkdir -p logs
|
||||||
|
mv -- *.log logs
|
||||||
|
mv -- *.txt logs
|
||||||
|
|
||||||
echo extract_btrfs.sh DONE
|
echo extract_btrfs.sh DONE
|
||||||
|
|||||||
@@ -3,8 +3,9 @@ set -e
|
|||||||
|
|
||||||
TILE_GEN_BIN=/data/ofm/tile_gen/bin
|
TILE_GEN_BIN=/data/ofm/tile_gen/bin
|
||||||
|
|
||||||
|
AREA=monaco
|
||||||
DATE=$(date +"%Y%m%d_%H%M%S")
|
DATE=$(date +"%Y%m%d_%H%M%S")
|
||||||
RUN_FOLDER="/data/ofm/tile_gen/runs/monaco/${DATE}_pt"
|
RUN_FOLDER="/data/ofm/tile_gen/runs/$AREA/${DATE}_pt"
|
||||||
|
|
||||||
|
|
||||||
mkdir -p "$RUN_FOLDER"
|
mkdir -p "$RUN_FOLDER"
|
||||||
@@ -13,7 +14,7 @@ cd "$RUN_FOLDER" || exit
|
|||||||
java -Xmx1g \
|
java -Xmx1g \
|
||||||
-jar $TILE_GEN_BIN/planetiler.jar \
|
-jar $TILE_GEN_BIN/planetiler.jar \
|
||||||
`# Download the latest osm.pbf from s3://osm-pds bucket` \
|
`# Download the latest osm.pbf from s3://osm-pds bucket` \
|
||||||
--area=monaco --download \
|
--area=$AREA --download \
|
||||||
`# Accelerate the download by fetching the 10 1GB chunks at a time in parallel` \
|
`# Accelerate the download by fetching the 10 1GB chunks at a time in parallel` \
|
||||||
--download-threads=10 --download-chunk-size-mb=1000 \
|
--download-threads=10 --download-chunk-size-mb=1000 \
|
||||||
`# Also download name translations from wikidata` \
|
`# Also download name translations from wikidata` \
|
||||||
@@ -22,7 +23,7 @@ java -Xmx1g \
|
|||||||
`# Store temporary node locations at fixed positions in a memory-mapped file` \
|
`# Store temporary node locations at fixed positions in a memory-mapped file` \
|
||||||
--nodemap-type=array --storage=mmap \
|
--nodemap-type=array --storage=mmap \
|
||||||
--force \
|
--force \
|
||||||
> planetiler_out 2> planetiler_err
|
> planetiler.out 2> planetiler.err
|
||||||
|
|
||||||
rm -r data
|
rm -r data
|
||||||
echo planetiler.jar DONE
|
echo planetiler.jar DONE
|
||||||
|
|||||||
@@ -3,8 +3,9 @@ set -e
|
|||||||
|
|
||||||
TILE_GEN_BIN=/data/ofm/tile_gen/bin
|
TILE_GEN_BIN=/data/ofm/tile_gen/bin
|
||||||
|
|
||||||
|
AREA=planet
|
||||||
DATE=$(date +"%Y%m%d_%H%M%S")
|
DATE=$(date +"%Y%m%d_%H%M%S")
|
||||||
RUN_FOLDER="/data/ofm/tile_gen/runs/planet/${DATE}_pt"
|
RUN_FOLDER="/data/ofm/tile_gen/runs/$AREA/${DATE}_pt"
|
||||||
|
|
||||||
|
|
||||||
mkdir -p "$RUN_FOLDER"
|
mkdir -p "$RUN_FOLDER"
|
||||||
@@ -24,7 +25,7 @@ java -Xmx30g \
|
|||||||
`# Store temporary node locations at fixed positions in a memory-mapped file` \
|
`# Store temporary node locations at fixed positions in a memory-mapped file` \
|
||||||
--nodemap-type=array --storage=mmap \
|
--nodemap-type=array --storage=mmap \
|
||||||
--force \
|
--force \
|
||||||
> planetiler_out 2> planetiler_err
|
> planetiler.out 2> planetiler.err
|
||||||
|
|
||||||
rm -r data
|
rm -r data
|
||||||
echo planetiler.jar DONE
|
echo planetiler.jar DONE
|
||||||
|
|||||||
Reference in New Issue
Block a user