diff --git a/init-server.py b/init-server.py index d912872..33ab18e 100755 --- a/init-server.py +++ b/init-server.py @@ -53,8 +53,8 @@ def prepare_http_host(c): @click.command() @click.argument('hostname') -@click.option('--port', type=int, help='SSH port') -@click.option('--user', help='SSH user') +@click.option('--port', type=int, help='SSH port (if not in .ssh/config)') +@click.option('--user', help='SSH user (if not in .ssh/config)') @click.option('--tile-creator', is_flag=True, help='Install tile-creator task') @click.option('--http-host', is_flag=True, help='Install http-host task') def main(hostname, user, port, tile_creator, http_host): @@ -84,7 +84,7 @@ def main(hostname, user, port, tile_creator, http_host): port=port, ) - prepare_shared(c) + # prepare_shared(c) if tile_creator: prepare_tile_creator(c) diff --git a/scripts/tile_creator/gen_monaco.sh b/scripts/tile_creator/gen_monaco.sh new file mode 100644 index 0000000..bb5f0f7 --- /dev/null +++ b/scripts/tile_creator/gen_monaco.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +DATE=$(date +"%Y%m%d_%H%M%S") + +RUN_FOLDER="/data/tile_creator/runs/monaco_$DATE" + +mkdir -p "$RUN_FOLDER" +cd "$RUN_FOLDER" || exit + +bash /data/tile_creator/bin/run_monaco.sh "$DATE" + diff --git a/scripts/tile_creator/run_monaco.sh b/scripts/tile_creator/run_monaco.sh index c47d77e..d4be924 100644 --- a/scripts/tile_creator/run_monaco.sh +++ b/scripts/tile_creator/run_monaco.sh @@ -1,19 +1,11 @@ #!/usr/bin/env bash -DATE=$(date +"%Y%m%d_%H%M%S") - -RUN_FOLDER="/data/planetiler/runs/monaco_$DATE" - -mkdir -p "$RUN_FOLDER" -cd "$RUN_FOLDER" || exit - - # the Xmx value below the most important parameter here # setting is less then 25g means there is too little memory # setting it to too much means there is too much memory used -java -Xmx30g \ - -jar /data/planetiler/bin/planetiler.jar \ +java -Xmx1g \ + -jar /data/ofm/tile_creator/bin/planetiler.jar \ `# Download the latest planet.osm.pbf from s3://osm-pds bucket` \ --area=monaco --download \ `# Accelerate the download by fetching the 10 1GB chunks at a time in parallel` \ @@ -24,7 +16,7 @@ java -Xmx30g \ `# Store temporary node locations at fixed positions in a memory-mapped file` \ --nodemap-type=array --storage=mmap \ --force \ - > "output_$DATE.log" 2> "err_$DATE.log" + > "output.log" 2> "err.log" diff --git a/scripts/tile_creator/run_planet.sh b/scripts/tile_creator/run_planet.sh index 3766d34..188d9c8 100644 --- a/scripts/tile_creator/run_planet.sh +++ b/scripts/tile_creator/run_planet.sh @@ -1,19 +1,11 @@ #!/usr/bin/env bash -DATE=$(date +"%Y%m%d_%H%M%S") - -RUN_FOLDER="/data/planetiler/runs/planet_$DATE" - -mkdir -p "$RUN_FOLDER" -cd "$RUN_FOLDER" || exit - - # the Xmx value below the most important parameter here # setting is less then 25g means there is too little memory # setting it to too much means there is too much memory used java -Xmx30g \ - -jar /data/planetiler/bin/planetiler.jar \ + -jar /data/ofm/tile_creator/bin/planetiler.jar \ `# Download the latest planet.osm.pbf from s3://osm-pds bucket` \ --area=planet --bounds=planet --download \ `# Accelerate the download by fetching the 10 1GB chunks at a time in parallel` \ @@ -24,7 +16,7 @@ java -Xmx30g \ `# Store temporary node locations at fixed positions in a memory-mapped file` \ --nodemap-type=array --storage=mmap \ --force \ - > "output_$DATE.log" 2> "err_$DATE.log" + > "output.log" 2> "err.log" diff --git a/ssh_lib/planetiler.py b/ssh_lib/planetiler.py index 88ec878..c620723 100644 --- a/ssh_lib/planetiler.py +++ b/ssh_lib/planetiler.py @@ -11,7 +11,7 @@ def install_planetiler(c): apt_get_update(c) apt_get_install(c, 'openjdk-17-jdk') - c.sudo('mkdir -p /data/planetiler/bin') + c.sudo(f'mkdir -p {TILE_GEN_BIN}') c.sudo( f'wget -q https://github.com/onthegomap/planetiler/releases/download/v{PLANETILER_VERSION}/planetiler.jar ' @@ -20,4 +20,4 @@ def install_planetiler(c): c.sudo(f'java -jar {PLANETILER_PATH} --help', hide=True) - c.sudo('chown -R ofm:ofm /data/planetiler') + c.sudo('chown -R ofm:ofm /data/ofm')