From e21e72919db6e674e7d14d3e32da2e3e28a33b9a Mon Sep 17 00:00:00 2001 From: Rub21 Date: Tue, 19 Mar 2024 11:30:02 -0500 Subject: [PATCH] Adjust Simplification in tiler. Update config to use var envs files Set --acl public-read for rapid bucket files Remove deployment rapid in branch deploy/rapid Update helm deployment for staging and production --- .github/workflows/chartpress.yaml | 6 +++++- .github/workflows/frontend-rapid.yaml | 5 ++--- .gitignore | 4 +++- compose/tiler.yml | 2 +- compose/web.yml | 4 ++-- images/tiler-server/config/config.toml | 10 +++++----- 6 files changed, 18 insertions(+), 13 deletions(-) diff --git a/.github/workflows/chartpress.yaml b/.github/workflows/chartpress.yaml index 13c7fc87..1d33ac80 100644 --- a/.github/workflows/chartpress.yaml +++ b/.github/workflows/chartpress.yaml @@ -1,5 +1,9 @@ name: Chartpress Publish and Deploy -on: push +on: + push: + branches: + - 'main' + - 'staging' jobs: build: runs-on: ubuntu-20.04 diff --git a/.github/workflows/frontend-rapid.yaml b/.github/workflows/frontend-rapid.yaml index 0ded9cce..6b99c4b5 100644 --- a/.github/workflows/frontend-rapid.yaml +++ b/.github/workflows/frontend-rapid.yaml @@ -4,7 +4,6 @@ on: branches: - 'main' - 'staging' - - 'deploy/rapid' jobs: rapid: runs-on: ubuntu-latest @@ -14,7 +13,7 @@ jobs: with: access_token: ${{ github.token }} - name: Set environment variables - Staging - if: github.ref == 'refs/heads/staging' || github.ref == 'refs/heads/deploy/rapid' + if: github.ref == 'refs/heads/staging' uses: allenevans/set-env@v2.0.0 with: RAPID_BUCKET: rapid-staging.openhistoricalmap.org @@ -84,7 +83,7 @@ jobs: - name: Push data to s3 and clean cloudfront cache if: ${{ success() }} run: | - aws s3 sync dist/ s3://${RAPID_BUCKET}/ + aws s3 sync dist/ s3://${RAPID_BUCKET}/ --acl public-read aws cloudfront create-invalidation --distribution-id=${CLOUDFRONT_DISTRIBUTION_ID} --paths=/ env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} diff --git a/.gitignore b/.gitignore index e4531d40..418eec33 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,6 @@ images/.env images/tiler.yml values.dev.yaml secrets -tegola \ No newline at end of file +tegola +envs/.env.tiler +envs/.env.web \ No newline at end of file diff --git a/compose/tiler.yml b/compose/tiler.yml index 054efd6b..335d4aa6 100644 --- a/compose/tiler.yml +++ b/compose/tiler.yml @@ -11,5 +11,5 @@ services: ports: - "9090:9090" env_file: - - ../envs/.env.tiler.example + - ../envs/.env.tiler restart: always diff --git a/compose/web.yml b/compose/web.yml index ad5c56a3..e825d9b6 100644 --- a/compose/web.yml +++ b/compose/web.yml @@ -11,7 +11,7 @@ services: volumes: - ./data/db-data:/var/lib/postgresql/data env_file: - - ./.env.web.example + - ./.env.web web: image: osmseed-web:v1 build: @@ -20,7 +20,7 @@ services: ports: - '80:80' env_file: - - ./.env.web.example + - ./.env.web ####### Enable for development mode # volumes: # - ./../../ohm-website:/var/www diff --git a/images/tiler-server/config/config.toml b/images/tiler-server/config/config.toml index 3d752189..af103e03 100644 --- a/images/tiler-server/config/config.toml +++ b/images/tiler-server/config/config.toml @@ -36,35 +36,35 @@ max_connections = 40 geometry_fieldname = "geometry" geometry_type = "multipolygon" id_fieldname = "ogc_fid" - sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 750),!BBOX!) AS geometry, ogc_fid FROM land_polygons WHERE wkb_geometry && !BBOX!" + sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 500),!BBOX!) AS geometry, ogc_fid FROM land_polygons WHERE wkb_geometry && !BBOX!" [[providers.layers]] name = "land_3-5" geometry_fieldname = "geometry" geometry_type = "multipolygon" id_fieldname = "ogc_fid" - sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 300),!BBOX!) AS geometry, ogc_fid FROM land_polygons WHERE wkb_geometry && !BBOX!" + sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 200),!BBOX!) AS geometry, ogc_fid FROM land_polygons WHERE wkb_geometry && !BBOX!" [[providers.layers]] name = "land_6-7" geometry_fieldname = "geometry" geometry_type = "multipolygon" id_fieldname = "ogc_fid" - sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 150),!BBOX!) AS geometry, ogc_fid FROM land_polygons WHERE wkb_geometry && !BBOX!" + sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 70),!BBOX!) AS geometry, ogc_fid FROM land_polygons WHERE wkb_geometry && !BBOX!" [[providers.layers]] name = "land_8-9" geometry_fieldname = "geometry" geometry_type = "multipolygon" id_fieldname = "ogc_fid" - sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 75),!BBOX!) AS geometry, ogc_fid FROM land_polygons WHERE wkb_geometry && !BBOX!" + sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 30),!BBOX!) AS geometry, ogc_fid FROM land_polygons WHERE wkb_geometry && !BBOX!" [[providers.layers]] name = "land_10-12" geometry_fieldname = "geometry" geometry_type = "multipolygon" id_fieldname = "ogc_fid" - sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 30),!BBOX!) AS geometry, ogc_fid FROM land_polygons WHERE wkb_geometry && !BBOX!" + sql = "SELECT ST_AsMVTGeom(ST_Simplify(wkb_geometry, 10),!BBOX!) AS geometry, ogc_fid FROM land_polygons WHERE wkb_geometry && !BBOX!" [[providers.layers]] name = "land_13-15"