mirror of
https://github.com/hyperknot/openfreemap.git
synced 2026-05-21 14:02:15 +00:00
work
This commit is contained in:
@@ -4,7 +4,7 @@ import click
|
|||||||
from dotenv import dotenv_values
|
from dotenv import dotenv_values
|
||||||
from fabric import Config, Connection
|
from fabric import Config, Connection
|
||||||
|
|
||||||
from ssh_lib.config import templates
|
from ssh_lib.config import config
|
||||||
from ssh_lib.kernel import set_cpu_governor, setup_kernel_settings
|
from ssh_lib.kernel import set_cpu_governor, setup_kernel_settings
|
||||||
from ssh_lib.nginx import certbot, nginx
|
from ssh_lib.nginx import certbot, nginx
|
||||||
from ssh_lib.pkg_base import pkg_base, pkg_clean, pkg_upgrade
|
from ssh_lib.pkg_base import pkg_base, pkg_clean, pkg_upgrade
|
||||||
@@ -28,7 +28,7 @@ def prepare_tile_creator(c):
|
|||||||
install_planetiler(c)
|
install_planetiler(c)
|
||||||
put(
|
put(
|
||||||
c,
|
c,
|
||||||
templates / 'planetiler' / 'run_planet.sh',
|
config / 'planetiler' / 'run_planet.sh',
|
||||||
PLANETILER_DIR,
|
PLANETILER_DIR,
|
||||||
permissions='755',
|
permissions='755',
|
||||||
owner='ofm',
|
owner='ofm',
|
||||||
|
|||||||
30
scripts/tile_creator/run_monaco.sh
Normal file
30
scripts/tile_creator/run_monaco.sh
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
#!/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 \
|
||||||
|
`# 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` \
|
||||||
|
--download-threads=10 --download-chunk-size-mb=1000 \
|
||||||
|
`# Also download name translations from wikidata` \
|
||||||
|
--fetch-wikidata \
|
||||||
|
--output=output.mbtiles \
|
||||||
|
`# 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"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
DATE=$(date +"%Y%m%d_%H%M%S")
|
DATE=$(date +"%Y%m%d_%H%M%S")
|
||||||
|
|
||||||
RUN_FOLDER="/data/planetiler/runs/$DATE"
|
RUN_FOLDER="/data/planetiler/runs/planet_$DATE"
|
||||||
|
|
||||||
mkdir -p "$RUN_FOLDER"
|
mkdir -p "$RUN_FOLDER"
|
||||||
cd "$RUN_FOLDER" || exit
|
cd "$RUN_FOLDER" || exit
|
||||||
@@ -25,3 +25,6 @@ java -Xmx30g \
|
|||||||
--nodemap-type=array --storage=mmap \
|
--nodemap-type=array --storage=mmap \
|
||||||
--force \
|
--force \
|
||||||
> "output_$DATE.log" 2> "err_$DATE.log"
|
> "output_$DATE.log" 2> "err_$DATE.log"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -2,4 +2,4 @@ from pathlib import Path
|
|||||||
|
|
||||||
|
|
||||||
base = Path(__file__).parent.parent
|
base = Path(__file__).parent.parent
|
||||||
templates = base / 'templates'
|
config = base / 'config'
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
from ssh_lib.config import templates
|
from ssh_lib.config import config
|
||||||
from ssh_lib.utils import apt_get_install, apt_get_purge, put, put_str
|
from ssh_lib.utils import apt_get_install, apt_get_purge, put, put_str
|
||||||
|
|
||||||
|
|
||||||
def setup_kernel_settings(c):
|
def setup_kernel_settings(c):
|
||||||
put(c, f'{templates}/sysctl/60-optim.conf', '/etc/sysctl.d/')
|
put(c, f'{config}/sysctl/60-optim.conf', '/etc/sysctl.d/')
|
||||||
|
|
||||||
|
|
||||||
def set_cpu_governor(c):
|
def set_cpu_governor(c):
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
from ssh_lib.config import templates
|
from ssh_lib.config import config
|
||||||
from ssh_lib.utils import (
|
from ssh_lib.utils import (
|
||||||
apt_get_install,
|
apt_get_install,
|
||||||
apt_get_purge,
|
apt_get_purge,
|
||||||
@@ -43,9 +43,9 @@ def nginx(c):
|
|||||||
'-subj "/C=US/ST=Dummy/L=Dummy/O=Dummy/CN=example.com"'
|
'-subj "/C=US/ST=Dummy/L=Dummy/O=Dummy/CN=example.com"'
|
||||||
)
|
)
|
||||||
|
|
||||||
put(c, f'{templates}/nginx/nginx.conf', '/etc/nginx/')
|
put(c, f'{config}/nginx/nginx.conf', '/etc/nginx/')
|
||||||
put(c, f'{templates}/nginx/default_disable.conf', '/data/nginx/sites')
|
put(c, f'{config}/nginx/default_disable.conf', '/data/nginx/sites')
|
||||||
put(c, f'{templates}/nginx/cloudflare.conf', '/data/nginx/config')
|
put(c, f'{config}/nginx/cloudflare.conf', '/data/nginx/config')
|
||||||
|
|
||||||
c.sudo('service nginx restart')
|
c.sudo('service nginx restart')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user