Skip to content

Commit

Permalink
Merge pull request #472 from OpenHistoricalMap/staging
Browse files Browse the repository at this point in the history
 Tiler Cache Refactor, Tegola Upgrade & OHM-website Upstream Catch-Up
  • Loading branch information
Rub21 authored Feb 12, 2025
2 parents 5b72c82 + b34e985 commit c2e621d
Show file tree
Hide file tree
Showing 56 changed files with 1,187 additions and 1,060 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/frontend-nominatim.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
if: github.ref == 'refs/heads/staging'
uses: allenevans/set-env@v2.0.0
with:
NOMINATIM_API: 'https://nominatim-api.staging.openhistoricalmap.org/'
NOMINATIM_BUCKET: 'nominatim-staging.openhistoricalmap.org'
NOMINATIM_API: https://nominatim-api.staging.openhistoricalmap.org/
NOMINATIM_BUCKET: nominatim-staging.openhistoricalmap.org
CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.STAGING_NOMINATIM_CLOUDFRONT_ID }}

- name: Set environment variables - Production
Expand All @@ -30,20 +30,19 @@ jobs:
CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.PRODUCTION_NOMINATIM_CLOUDFRONT_ID }}

- name: Checkout nominatim-ui repo
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
repository: OpenHistoricalMap/nominatim-ui
ref: 81e184d68b5bbe09a18eca79e9a73c08971bcf74
# token: ${{ env.DEV_GITHUB_TOKEN }}

- name: Use Node.js 10
uses: actions/setup-node@v1
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 10
node-version: 20

- name: Cache node modules
id: cache-node-modules
uses: actions/cache@v2
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
Expand All @@ -62,8 +61,9 @@ jobs:
run: |
echo "Nominatim_Config.Nominatim_API_Endpoint = '${NOMINATIM_API}';" >> dist/theme/config.theme.js
npm run build
- uses: actions/setup-python@v2
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.8'

Expand All @@ -79,4 +79,4 @@ jobs:
aws cloudfront create-invalidation --distribution-id=${CLOUDFRONT_DISTRIBUTION_ID} --paths=/
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
18 changes: 14 additions & 4 deletions .github/workflows/frontend-rapid.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
uses: styfle/cancel-workflow-action@0.8.0
with:
access_token: ${{ github.token }}

- name: Set environment variables - Staging
if: github.ref == 'refs/heads/staging'
uses: allenevans/set-env@v2.0.0
Expand All @@ -22,6 +23,7 @@ jobs:
OHM_API_URL: https://staging.openhistoricalmap.org
OHM_CLIENT_ID: vwLXYrZ29YiwxWR5LvAcsiG9paLwE7hBod27O-tl16Q
OHM_CLIENT_SECRET: ${{ secrets.STAGING_RAPID_CLIENT_SECRET }}

- name: Set environment variables - Production
if: github.ref == 'refs/heads/main'
uses: allenevans/set-env@v2.0.0
Expand All @@ -32,18 +34,21 @@ jobs:
OHM_API_URL: https://www.openhistoricalmap.org
OHM_CLIENT_ID: RIIz9U-oZmYzi_LXCKMHwHPgbJxALWAZRcgk9F8cppk
OHM_CLIENT_SECRET: ${{ secrets.PRODUCTION_RAPID_CLIENT_SECRET }}

- name: Checkout rapid repo
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
repository: OpenHistoricalMap/Rapid
ref: 042f2e27ab0b9a5192549fc17a1ee0f91acab67f

- name: Use Node.js 18
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: 18

- name: Cache node modules
id: cache-node-modules
uses: actions/cache@v2
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
Expand All @@ -53,9 +58,11 @@ jobs:
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install modules
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm install

- name: Build rapid frontend
run: |
export OSM_URL=https://www.openstreetmap.org
Expand All @@ -73,13 +80,16 @@ jobs:
npm run build
npm run dist
sed -e "s|i.client_id|i.client_id,client_secret:\"${OHM_CLIENT_SECRET}\"|g" dist/rapid.min.js > tmpfile && mv tmpfile dist/rapid.min.js
- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
with:
python-version: '3.8'

- name: Install aws cli
run: |
python -m pip install --upgrade pip
pip install awscli
- name: Push data to s3 and clean cloudfront cache
if: ${{ success() }}
run: |
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ config.toml
!config.general.toml
!config.osm.template.toml
config.osm.toml
envs/.env.tm
values.staging.yaml

.DS_Store
*/.DS_Store
.env
values.dev.staging.yaml
images/tiler-server/utils/exec.sh
__pycache__/
8 changes: 8 additions & 0 deletions compose/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,11 @@ Make a coppy of the enviroment files `envs/.env.tiler.example` file and name it
docker compose -f compose/tiler.yml build
docker compose -f compose/tiler.yml run --service-ports tiler bash
```


## Tasking manager
Make a coppy of the enviroment files `envs/.env.tiler.example` file and name it `envs/.env.tiler`.

```sh
docker compose -f compose/tm.yml run --service-ports tm-web bash
```
74 changes: 44 additions & 30 deletions compose/tiler.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
services:
# db:
# image: ohm-tiler-db:v1
# build:
# context: ../images/tiler-db
# dockerfile: Dockerfile
# ports:
# - "5432:5432"
# # volumes:
# # - ../data/tiler-db-data2:/var/lib/postgresql/data
# env_file:
# - ../envs/.env.tiler
# restart: always
# networks:
# - tiler_network
db:
image: ohm-tiler-db:v1
build:
context: ../images/tiler-db
dockerfile: Dockerfile
ports:
- "5432:5432"
# volumes:
# - ../data/tiler-db-data2:/var/lib/postgresql/data
env_file:
- ../envs/.env.tiler
restart: always
networks:
- tiler_network

# imposm:
# image: rub21/tiler-imposm:v16
# build:
# context: ../images/tiler-imposm
# dockerfile: Dockerfile
# # volumes:
# # - ../data/tiler-imposm-data2:/mnt/data
# # - ../images/tiler-imposm:/osm
# command:
# - sh
# - -c
# - "./start.sh"
# env_file:
# - ../envs/.env.tiler
# networks:
# - tiler_network
imposm:
image: rub21/tiler-imposm:v16
build:
context: ../images/tiler-imposm
dockerfile: Dockerfile
# volumes:
# - ../data/tiler-imposm-data2:/mnt/data
# - ../images/tiler-imposm:/osm
command:
- sh
- -c
- "./start.sh"
env_file:
- ../envs/.env.tiler
networks:
- tiler_network

tiler:
image: ohm-tiler-server:v1
Expand All @@ -47,6 +47,20 @@ services:
networks:
- tiler_network

tiler-cache:
image: ohm-tiler-cache:v1
build:
context: ../images/tiler-cache
dockerfile: Dockerfile
volumes:
- ../images/tiler-cache:/app

env_file:
- ../envs/.env.tiler
restart: always
networks:
- tiler_network

networks:
tiler_network:
driver: bridge
2 changes: 1 addition & 1 deletion compose/tm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ services:
- ../envs/.env.tiler
restart: always
tm-web:
image: node:16
image: node:18
ports:
- "3000:3000"
env_file:
Expand Down
11 changes: 11 additions & 0 deletions hetzner/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@ https://github.com/orgs/OpenHistoricalMap/packages/container/tiler-db/versions
- Tiler Imposm
https://github.com/orgs/OpenHistoricalMap/packages/container/tiler-imposm/versions



## Deploy Staging

```sh
docker compose -f hetzner/tiler.staging.yml up db -d
docker compose -f hetzner/tiler.staging.yml up imposm -d
```

## Deploy Production

```sh
docker compose -f hetzner/tiler.production.yml up -d
```
91 changes: 0 additions & 91 deletions hetzner/config/postgresql.config

This file was deleted.

Loading

0 comments on commit c2e621d

Please # to comment.