diff --git a/.github/workflows/chartpress.yaml b/.github/workflows/chartpress.yaml index 78d5d8d2..238bc9a9 100644 --- a/.github/workflows/chartpress.yaml +++ b/.github/workflows/chartpress.yaml @@ -4,7 +4,7 @@ on: branches: - 'main' - 'staging' - - 'pg_user' + - 'k8s_deploy' jobs: build: runs-on: ubuntu-22.04 @@ -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/pg_user' + if: github.ref == 'refs/heads/staging' || github.ref == 'refs/heads/k8s_deploy' uses: bluwy/substitute-string-action@v1 with: _input-file: 'values.staging.template.yaml' @@ -189,46 +189,46 @@ 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/pg_user' + if: github.ref == 'refs/heads/staging' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/k8s_deploy' 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/pg_user' + if: github.ref == 'refs/heads/staging' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/k8s_deploy' 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 + sudo curl -L -o /usr/bin/kubectl https://dl.k8s.io/release/v1.33.0/bin/linux/amd64/kubectl sudo chmod +x /usr/bin/kubectl - sudo curl -o /usr/bin/aws-iam-authenticator https://amazon-eks.s3.us-west-2.amazonaws.com/1.17.7/2020-07-08/bin/linux/amd64/aws-iam-authenticator + sudo curl -o /usr/bin/aws-iam-authenticator https://amazon-eks.s3.us-west-2.amazonaws.com/1.21.2/2021-07-05/bin/linux/amd64/aws-iam-authenticator sudo chmod +x /usr/bin/aws-iam-authenticator - curl -L https://get.helm.sh/helm-v3.14.4-linux-amd64.tar.gz -o helm.tar.gz + curl -L https://get.helm.sh/helm-v3.17.3-linux-amd64.tar.gz -o helm.tar.gz tar -xvzf helm.tar.gz sudo mv linux-amd64/helm /usr/local/bin/ sudo chmod +x /usr/local/bin/helm helm version - name: Update kube-config staging - if: github.ref == 'refs/heads/staging' || github.ref == 'refs/heads/pg_user' + if: github.ref == 'refs/heads/staging' || github.ref == 'refs/heads/k8s_deploy' 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/pg_user' + if: github.ref == 'refs/heads/staging' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/k8s_deploy' 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/pg_user' + if: github.ref == 'refs/heads/staging' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/k8s_deploy' run: cd ohm && helm dep up # Staging - name: Staging - helm deploy - if: github.ref == 'refs/heads/staging' || github.ref == 'refs/heads/pg_user' - run: helm upgrade --install staging --wait ohm/ -f values.staging.yaml -f ohm/values.yaml + if: github.ref == 'refs/heads/staging' || github.ref == 'refs/heads/k8s_deploy' + run: helm upgrade --install staging --wait --timeout 10m ohm/ -f values.staging.yaml -f ohm/values.yaml # Production - name: Production - helm deploy if: github.ref == 'refs/heads/main' - run: helm upgrade --install production --wait ohm/ -f values.production.yaml -f ohm/values.yaml + run: helm upgrade --install production --wait --timeout 10m ohm/ -f values.production.yaml -f ohm/values.yaml \ No newline at end of file diff --git a/hetzner/tiler/tiler.production.yml b/hetzner/tiler/tiler.production.yml index 7fb106ee..ec45173d 100644 --- a/hetzner/tiler/tiler.production.yml +++ b/hetzner/tiler/tiler.production.yml @@ -39,7 +39,7 @@ services: # Tiler server tiler_server: container_name: tiler_server - image: ghcr.io/openhistoricalmap/tiler-server:0.0.1-0.dev.git.3296.h0e45d176 + image: ghcr.io/openhistoricalmap/tiler-server:0.0.1-0.dev.git.3292.h0f5e7d60 # ports: # - "9090:9090" restart: always diff --git a/images/cgimap/start.sh b/images/cgimap/start.sh index c5306aef..57066f49 100755 --- a/images/cgimap/start.sh +++ b/images/cgimap/start.sh @@ -41,7 +41,7 @@ else psql -h $POSTGRES_HOST -U $POSTGRES_USER -c "SHOW enable_mergejoin;" psql -h $POSTGRES_HOST -U $POSTGRES_USER -c "SHOW enable_hashjoin;" # Start the cgimap service - openstreetmap-cgimap --port=8000 --daemon --instances=10 + openstreetmap-cgimap --port=8000 --daemon --instances=5 # Sleep fo 3 sec for tail the logs sleep 3 # Keep container alive diff --git a/values.production.template.yaml b/values.production.template.yaml index ceebb445..4d89b6b6 100644 --- a/values.production.template.yaml +++ b/values.production.template.yaml @@ -64,13 +64,13 @@ osm-seed: max_connections = 200 shared_buffers = 4GB work_mem = 20MB - maintenance_work_mem = 512MB + maintenance_work_mem = 1GB dynamic_shared_memory_type = posix effective_io_concurrency = 200 - max_wal_size = 1GB - min_wal_size = 256MB - random_page_cost = 1.0 - effective_cache_size = 8GB + max_wal_size = 2GB + min_wal_size = 512MB + random_page_cost = 1.1 + effective_cache_size = 12GB log_min_duration_statement = 3000 log_connections = on log_disconnections = on @@ -86,9 +86,9 @@ osm-seed: lc_time = 'en_US.utf8' default_text_search_config = 'pg_catalog.english' # Parallelism settings - max_parallel_workers_per_gather = 2 - max_parallel_workers = 4 - max_worker_processes = 4 + max_parallel_workers_per_gather = 1 + max_parallel_workers = 2 + max_worker_processes = 2 parallel_tuple_cost = 0.05 parallel_setup_cost = 500 min_parallel_table_scan_size = 2MB