Skip to content
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
16 changes: 8 additions & 8 deletions .github/workflows/chartpress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
branches:
- 'main'
- 'staging'
- 'tiler_cache_paths'
- 'vtiles_admin_attr'
jobs:
build:
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -71,7 +71,7 @@ jobs:
OHM_SLACK_WEBHOOK_URL: ${{ secrets.OHM_SLACK_WEBHOOK_URL }}
################ Staging secrets ################
- name: Staging - substitute secrets
if: github.ref == 'refs/heads/staging' || github.ref == 'refs/heads/tiler_cache_paths'
if: github.ref == 'refs/heads/staging' || github.ref == 'refs/heads/vtiles_admin_attr'
uses: bluwy/substitute-string-action@v1
with:
_input-file: 'values.staging.template.yaml'
Expand Down Expand Up @@ -189,14 +189,14 @@ jobs:
PRODUCTION_OPENSTREETMAP_AUTH_SECRET: ${{ secrets.PRODUCTION_OPENSTREETMAP_AUTH_SECRET }}

- name: AWS Credentials
if: github.ref == 'refs/heads/staging' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/tiler_cache_paths'
if: github.ref == 'refs/heads/staging' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/vtiles_admin_attr'
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Setup Kubectl and Helm Dependencies
if: github.ref == 'refs/heads/staging' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/tiler_cache_paths'
if: github.ref == 'refs/heads/staging' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/vtiles_admin_attr'
run: |
sudo pip install awscli --ignore-installed six
sudo curl -L -o /usr/bin/kubectl https://amazon-eks.s3.us-west-2.amazonaws.com/1.17.7/2020-07-08/bin/linux/amd64/kubectl
Expand All @@ -210,22 +210,22 @@ jobs:
helm version

- name: Update kube-config staging
if: github.ref == 'refs/heads/staging' || github.ref == 'refs/heads/tiler_cache_paths'
if: github.ref == 'refs/heads/staging' || github.ref == 'refs/heads/vtiles_admin_attr'
run: aws eks --region us-east-1 update-kubeconfig --name osmseed-staging
- name: Update kube-config prod
if: github.ref == 'refs/heads/main'
run: aws eks --region us-east-1 update-kubeconfig --name osmseed-production-v2
- name: Add Helm repository
if: github.ref == 'refs/heads/staging' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/tiler_cache_paths'
if: github.ref == 'refs/heads/staging' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/vtiles_admin_attr'
run: |
helm repo add osm-seed https://osm-seed.github.io/osm-seed-chart/
helm repo update
- name: Install helm dependencies for
if: github.ref == 'refs/heads/staging' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/tiler_cache_paths'
if: github.ref == 'refs/heads/staging' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/vtiles_admin_attr'
run: cd ohm && helm dep up
# Staging
- name: Staging - helm deploy
if: github.ref == 'refs/heads/staging' || github.ref == 'refs/heads/tiler_cache_paths'
if: github.ref == 'refs/heads/staging' || github.ref == 'refs/heads/vtiles_admin_attr'
run: helm upgrade --install staging --wait ohm/ -f values.staging.yaml -f ohm/values.yaml
# Production
- name: Production - helm deploy
Expand Down
39 changes: 23 additions & 16 deletions compose/tiler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ services:
- "54321:5432"
volumes:
- tiler_pgdata:/var/lib/postgresql/data
- ../hetzner/tiler/config/postgresql.staging.conf:/etc/postgresql/postgresql.conf
environment:
- POSTGRES_CONFIG_FILE=/etc/postgresql/postgresql.conf
command:
- postgres
- "-c"
- "config_file=/etc/postgresql/postgresql.conf"
env_file:
- ../envs/.env.tiler
restart: always
Expand All @@ -33,22 +40,22 @@ services:
networks:
- ohm_network

tiler:
image: rub21/tiler-server:v1
container_name: tiler
build:
context: ../images/tiler-server
dockerfile: Dockerfile
volumes:
- ../hetzner:/hetzner
- ../images/tiler-server:/app
ports:
- "9090:9090"
env_file:
- ../envs/.env.tiler
restart: always
networks:
- ohm_network
# tiler:
# image: rub21/tiler-server:v1
# container_name: tiler
# build:
# context: ../images/tiler-server
# dockerfile: Dockerfile
# volumes:
# - ../hetzner:/hetzner
# - ../images/tiler-server:/app
# ports:
# - "9090:9090"
# env_file:
# - ../envs/.env.tiler
# restart: always
# networks:
# - ohm_network

# tiler-cache:
# image: rub21/tiler-cache:v2
Expand Down
4 changes: 2 additions & 2 deletions hetzner/tiler/config/postgresql.production.conf
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ autovacuum_vacuum_cost_limit = -1 # Let PostgreSQL adjust vacuum cost d
# QUERY TUNING
#------------------------------------------------------------------------------
effective_io_concurrency = 300 # For SSD; helps the planner estimate IO concurrency
parallel_tuple_cost = 0.1 # Lower cost to encourage parallelization
parallel_setup_cost = 500 # Lower to encourage more parallel plans
parallel_tuple_cost = 0.001 # Lower cost to encourage parallelization
parallel_setup_cost = 100 # Lower to encourage more parallel plans
max_worker_processes = 28 # Allow up to 28 worker processes
max_parallel_workers_per_gather = 8 # Max workers that can help a single query
max_parallel_workers = 28 # Total number of parallel workers across all queries
Expand Down
6 changes: 3 additions & 3 deletions hetzner/tiler/config/postgresql.staging.conf
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ autovacuum_vacuum_cost_limit = -1 # Allow PostgreSQL to auto-adjust vacuu
#------------------------------------------------------------------------------

effective_io_concurrency = 100 # Reduce IO concurrency to fit within staging constraints
parallel_tuple_cost = 0.1 # Encourage parallel execution
parallel_setup_cost = 200 # Lower parallel setup cost
parallel_tuple_cost = 0.001 # Encourage parallel execution
parallel_setup_cost = 100 # Lower parallel setup cost
max_worker_processes = 4 # Limit worker processes to available CPU cores
max_parallel_workers_per_gather = 2 # Limit per-query parallel workers
max_parallel_workers_per_gather = 4 # Allow more per-query parallel workers
max_parallel_workers = 4 # Total parallel workers for staging

#------------------------------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions hetzner/tiler/tiler.production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ services:

tiler_imposm:
container_name: tiler_imposm
image: ghcr.io/openhistoricalmap/tiler-imposm:0.0.1-0.dev.git.3309.h529b5183
image: ghcr.io/openhistoricalmap/tiler-imposm:0.0.1-0.dev.git.3325.hb9f97989
volumes:
- tiler_imposm_data:/mnt/data
env_file:
Expand Down Expand Up @@ -136,10 +136,10 @@ services:
volumes:
tiler_pgdata:
driver: local
name: tiler_db_25_02
name: tiler_db_10_03
tiler_imposm_data:
driver: local
name: tiler_imposm_25_02
name: tiler_imposm_10_03

networks:
ohm_network:
Expand Down
13 changes: 13 additions & 0 deletions hetzner/traefik/traefik.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,14 @@ http:
middlewares:
- secure-headers

martin-router:
rule: Host(`martin.{{OHM_DOMAIN}}`)
entryPoints:
- port-web
service: martin
middlewares:
- secure-headers

node-exporter-router:
rule: Host(`node-exporter.{{OHM_DOMAIN}}`)
entryPoints:
Expand Down Expand Up @@ -184,6 +192,11 @@ http:
servers:
- url: http://taginfo_web:4567

martin:
loadBalancer:
servers:
- url: http://martin:80

node_exporter:
loadBalancer:
servers:
Expand Down
20 changes: 20 additions & 0 deletions images/tiler-imposm/config/layers/admin_areas.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,26 @@
"name": "area",
"key": null
},
{
"type": "string",
"name": "border_type",
"key": "border_type"
},
{
"type": "string",
"name": "indefinite",
"key": "indefinite"
},
{
"type": "string",
"name": "disputed",
"key": "disputed"
},
{
"type": "string",
"name": "disputed_by",
"key": "disputed_by"
},
{
"type": "hstore_tags",
"name": "tags",
Expand Down
15 changes: 15 additions & 0 deletions images/tiler-imposm/config/layers/admin_lines.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,21 @@
"name": "maritime",
"key": "maritime"
},
{
"type": "string",
"name": "indefinite",
"key": "indefinite"
},
{
"type": "string",
"name": "disputed",
"key": "disputed"
},
{
"type": "string",
"name": "disputed_by",
"key": "disputed_by"
},
{
"type": "boolint",
"name": "has_label",
Expand Down
18 changes: 18 additions & 0 deletions images/tiler-imposm/config/layers/admin_relation_members.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,24 @@
"key": "maritime",
"from_member": true
},
{
"name": "me_indefinite",
"type": "string",
"key": "indefinite",
"from_member": true
},
{
"name": "me_disputed",
"type": "string",
"key": "disputed",
"from_member": true
},
{
"name": "me_disputed_by",
"type": "string",
"key": "disputed_by",
"from_member": true
},
{
"type": "hstore_tags",
"name": "me_tags",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
-- ============================================================================
-- Create materialized views for admin boundaries areas
-- ============================================================================

-- Index on admin_level to speed up filtering
CREATE INDEX IF NOT EXISTS idx_osm_admin_areas_admin_level
ON osm_admin_areas (admin_level) WHERE geometry IS NOT NULL;

-- Enable parallel workers on source table
ALTER TABLE osm_admin_areas SET (parallel_workers = 4);

DROP MATERIALIZED VIEW IF EXISTS mv_admin_boundaries_areas_z16_20 CASCADE;

SELECT create_areas_mview( 'osm_admin_areas', 'mv_admin_boundaries_areas_z16_20', 1, 0, 'id, osm_id, type', 'admin_level IN (1,2,3,4,5,6,7,8,9,10,11)');
SELECT create_areas_mview( 'osm_admin_areas', 'mv_admin_boundaries_areas_z16_20', 1, 0, 'id, osm_id, type', 'admin_level IN (1,2,3,4,5,6,7,8,9,10,11)', NULL);
SELECT create_area_mview_from_mview('mv_admin_boundaries_areas_z16_20','mv_admin_boundaries_areas_z13_15', 5, 0.0, NULL);
SELECT create_area_mview_from_mview('mv_admin_boundaries_areas_z13_15','mv_admin_boundaries_areas_z10_12', 20, 0.0, 'admin_level IN (1,2,3,4,5,6,7,8,9,10)');
SELECT create_area_mview_from_mview('mv_admin_boundaries_areas_z10_12','mv_admin_boundaries_areas_z8_9', 100, 0.0, 'admin_level IN (1,2,3,4,5,6,7,8,9)');
Expand Down
Loading
Loading