Skip to content

Commit edf314f

Browse files
authoredJan 26, 2024
Release 2024-01-26 (FixMyBerlin/atlas-geo#85)
2 parents 1efc206 + e535863 commit edf314f

33 files changed

+17
-1449
lines changed
 

‎atlas-geo/.env.example

-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ SKIP_TAG_FILTER=0 # skips tag filtering
1515
DEBUG=1 # enables the generation of exclude tables
1616
ID_FILTER='' # if not empty only the objects with these ids are processed. See https://docs.osmcode.org/osmium/latest/osmium-getid.html
1717

18-
# Internal API secret
19-
API_SECRET=myapisecret
2018

2119
# Token for Synology log. Leave blank to disable logging
2220
SYNOLOGY_LOG_TOKEN=

‎atlas-geo/.github/workflows/deployment.production.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ jobs:
1010
uses: ./.github/workflows/deployment.yml
1111
with:
1212
ENVIRONMENT: production
13-
URL: https://tiles.radverkehrsatlas.de
14-
TILES_URL: tiles.radverkehrsatlas.de
15-
API_URL: api.radverkehrsatlas.de
13+
URL: tiles.radverkehrsatlas.de
1614
secrets:
1715
SERVICE_NAME: ${{ secrets.SERVICE_NAME }}
1816
DATABASE_NAME: ${{ secrets.DATABASE_NAME }}

‎atlas-geo/.github/workflows/deployment.staging.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ jobs:
1010
uses: ./.github/workflows/deployment.yml
1111
with:
1212
ENVIRONMENT: staging
13-
URL: https://staging-tiles.radverkehrsatlas.de
14-
TILES_URL: staging-tiles.radverkehrsatlas.de
15-
API_URL: staging-api.radverkehrsatlas.de
13+
URL: staging-tiles.radverkehrsatlas.de
1614
secrets:
1715
SERVICE_NAME: ${{ secrets.SERVICE_NAME }}
1816
DATABASE_NAME: ${{ secrets.DATABASE_NAME }}

‎atlas-geo/.github/workflows/deployment.yml

+2-26
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,13 @@ on:
3636
URL:
3737
type: string
3838
required: true
39-
TILES_URL:
40-
type: string
41-
required: true
42-
API_URL:
43-
type: string
44-
required: true
4539

4640
jobs:
4741
build_and_deploy:
4842
runs-on: ubuntu-latest
4943
environment:
5044
name: ${{ inputs.ENVIRONMENT }}
51-
url: ${{ inputs.URL }}
45+
url: https://${{ inputs.URL }}
5246
steps:
5347
- uses: actions/checkout@v4
5448

@@ -89,22 +83,6 @@ jobs:
8983
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/n0p8j4k5/
9084
docker push public.ecr.aws/n0p8j4k5/atlas/app:${{ github.sha }}
9185
92-
- name: Build api image
93-
uses: docker/build-push-action@v5
94-
with:
95-
context: .
96-
file: ./api.Dockerfile
97-
push: false
98-
load: true
99-
cache-from: type=gha
100-
cache-to: type=gha,mode=max
101-
tags: public.ecr.aws/n0p8j4k5/atlas/api:${{ github.sha }}
102-
103-
- name: Push API image
104-
run: |
105-
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/n0p8j4k5/
106-
docker push public.ecr.aws/n0p8j4k5/atlas/api:${{ github.sha }}
107-
10886
- name: Copy files to server
10987
uses: appleboy/scp-action@master
11088
with:
@@ -134,10 +112,8 @@ jobs:
134112
echo PGPASSWORD='${{ secrets.DATABASE_PASSWORD }}' >> .env
135113
echo PGDATABASE='${{ secrets.DATABASE_NAME }}' >> .env
136114
echo OSM_DOWNLOAD_URL='${{ vars.OSM_DOWNLOAD_URL }}' >> .env
137-
echo TILES_URL='${{ inputs.TILES_URL }}' >> .env
138-
echo API_URL='${{ inputs.API_URL }}' >> .env
115+
echo URL='${{ inputs.URL }}' >> .env
139116
echo GITHUB_SHA='${{ github.sha }}' >> .env
140-
echo API_SECRET=$(echo $RANDOM | md5sum | head -c 20) >> .env
141117
echo "Reload containers"
142118
docker compose -f docker-compose.traefik.yml up -d
143119
docker compose up -d

‎atlas-geo/api.Dockerfile

-7
This file was deleted.

‎atlas-geo/api/INIT_FUNCTIONS.sql

-24
This file was deleted.

‎atlas-geo/api/INIT_VERIFICATION_VIEWS.sql

-65
This file was deleted.

‎atlas-geo/api/README.md

-3
This file was deleted.

‎atlas-geo/api/db.py

-11
This file was deleted.

‎atlas-geo/api/db_configuration.py

-45
This file was deleted.

‎atlas-geo/api/generate_test_data.py

-40
This file was deleted.

‎atlas-geo/api/main.py

-185
This file was deleted.

‎atlas-geo/api/requirements.txt

-3
This file was deleted.

‎atlas-geo/app/process/boundaries/boundaries.lua

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ local table = osm2pgsql.define_table({
1414
}
1515
})
1616

17-
local tableLabel = osm2pgsql.define_table({
18-
name = 'boundariesLabel',
17+
local labelTable = osm2pgsql.define_table({
18+
name = 'boundaryLabels',
1919
ids = { type = 'any', id_column = 'osm_id', type_column = 'osm_type' },
2020
columns = {
2121
{ column = 'tags', type = 'jsonb' },
@@ -76,7 +76,7 @@ function osm2pgsql.process_relation(object)
7676
meta = Metadata(object),
7777
geom = object:as_multipolygon()
7878
})
79-
tableLabel:insert({
79+
labelTable:insert({
8080
tags = results_tags,
8181
meta = Metadata(object),
8282
geom = object:as_multipolygon():centroid()

‎atlas-geo/app/process/helper/CheckDataWithinYears.lua

-66
This file was deleted.

‎atlas-geo/app/process/helper/HasAreaTags.lua

-54
This file was deleted.

‎atlas-geo/app/process/helper/__tests__/CheckDateWithinYears.test.lua

-55
This file was deleted.

‎atlas-geo/app/process/legacy_bikelanes/bikelanesPresence.lua

-186
This file was deleted.

‎atlas-geo/app/process/legacy_boundaries/boundaries.lua

-28
This file was deleted.

‎atlas-geo/app/process/legacy_lit/lit.lua

-108
This file was deleted.

‎atlas-geo/app/process/legacy_maxspeed/maxspeed.lua

-132
This file was deleted.

‎atlas-geo/app/process/legacy_roadClassification/roadClassification.lua

-132
This file was deleted.

‎atlas-geo/app/process/legacy_surfaceQuality/surfaceQuality.lua

-101
This file was deleted.

‎atlas-geo/app/process/shared/IsFresh.lua

-44
This file was deleted.

‎atlas-geo/app/process/shared/__test__/IsFresh.test.lua

-56
This file was deleted.

‎atlas-geo/app/run-1-download.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ fi
1717
echo "Downloading file: ${OSM_DOWNLOAD_URL}"
1818
# Note: Showing the progress (locally) is very verbose, unfortunately
1919
if wget --timestamping --no-verbose ${OSM_DOWNLOAD_URL} --directory-prefix=${OSM_DATADIR}; then
20-
mv ${OSM_DOWNLOAD_FILE} ${OSM_LOCAL_FILE}
20+
ln -f ${OSM_DOWNLOAD_FILE} ${OSM_LOCAL_FILE}
2121
else
2222
echo "Error: Failed to download the file from ${OSM_DOWNLOAD_URL}"
2323
fi

‎atlas-geo/app/run-4-process.sh

+3-8
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@ run_psql "roads_bikelanes/bikelanes/bikelanes"
1414

1515
run_lua "bicycleParking/bicycleParking"
1616

17-
# run_lua "legacy_bikelanes/bikelanesPresence"
18-
# run_lua "legacy_surfaceQuality/surfaceQuality"
19-
# run_lua "legacy_roadClassification/roadClassification"
20-
# run_lua "legacy_maxspeed/maxspeed"
21-
# run_lua "legacy_lit/lit"
22-
2317
run_lua "trafficSigns/trafficSigns"
2418
run_psql "trafficSigns/trafficSigns"
2519

@@ -38,6 +32,7 @@ echo "✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅
3832
echo -e "\e[1m\e[7m PROCESS – END \e[27m\e[21m – End Time: $(date)\e[0m"
3933
echo "Completed:"
4034
echo "Development http://localhost:3000/catalog"
41-
echo "Staging https://staging-tiles.radverkehrsatlas.de/"
42-
echo "Production https://tiles.radverkehrsatlas.de"
35+
echo "Staging https://staging-tiles.radverkehrsatlas.de/catalog"
36+
echo "Production https://tiles.radverkehrsatlas.de/catalog"
37+
echo "Test-Map https://data.radverkehrsatlas.de/"
4338
echo "✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ ✅ "
File renamed without changes.

‎atlas-geo/app/run-6-api.sh

-9
This file was deleted.
File renamed without changes.

‎atlas-geo/app/run.sh

+5-9
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,13 @@ process_end_time=$(date +%s)
4646
export PROCESS_RUN_TIME_DIFF=$((process_end_time - process_start_time)) # used by metadata.sh
4747

4848
if ! ./run-5-postprocess.sh; then
49-
alert '*ERROR*: #run-6-postprocess exited with non-zero status code'
49+
alert '*ERROR*: #run-5-postprocess exited with non-zero status code'
5050
fi
5151

52-
if ! ./run-6-api.sh; then
53-
alert '*ERROR*: #run-7-api exited with non-zero status code'
52+
if ! ./run-6-analysis.sh; then
53+
alert '*ERROR*: #run-6-analysis exited with non-zero status code'
5454
fi
5555

56-
if ! ./run-7-analysis.sh; then
57-
alert '*ERROR*: #run-5-analysis exited with non-zero status code'
58-
fi
59-
60-
if ! ./run-8-metadata.sh; then
61-
alert '*ERROR*: #run-8-metadata exited with non-zero status code'
56+
if ! ./run-7-metadata.sh; then
57+
alert '*ERROR*: #run-7-metadata exited with non-zero status code'
6258
fi

‎atlas-geo/docker-compose.development.yml

-16
Original file line numberDiff line numberDiff line change
@@ -39,22 +39,6 @@ services:
3939
depends_on:
4040
db:
4141
condition: service_healthy
42-
api:
43-
build:
44-
context: .
45-
dockerfile: ./api.Dockerfile
46-
container_name: api
47-
environment:
48-
PGHOST:
49-
PGDATABASE:
50-
PGUSER:
51-
PGPASSWORD:
52-
API_SECRET:
53-
ports:
54-
- 80:80
55-
depends_on:
56-
db:
57-
condition: service_healthy
5842
db:
5943
image: postgis/postgis:14-3.3-alpine
6044
shm_size: 1gb

‎atlas-geo/docker-compose.yml

+1-24
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ services:
3737
- 3333:3000
3838
labels:
3939
- "traefik.enable=true"
40-
- "traefik.http.routers.tiles.rule=Host(`${TILES_URL}`)"
40+
- "traefik.http.routers.tiles.rule=Host(`${URL}`)"
4141
- "traefik.http.routers.tiles.entrypoints=websecure"
4242
- "traefik.http.routers.tiles.tls.certresolver=letsencrypt"
4343
- "traefik.http.routers.tiles.tls=true"
@@ -46,29 +46,6 @@ services:
4646
depends_on:
4747
db:
4848
condition: service_healthy
49-
api:
50-
image: public.ecr.aws/n0p8j4k5/atlas/api:${GITHUB_SHA}
51-
container_name: api
52-
environment:
53-
PGHOST:
54-
PGDATABASE:
55-
PGUSER:
56-
PGPASSWORD:
57-
API_SECRET:
58-
restart: unless-stopped
59-
ports:
60-
- "8020:80"
61-
labels:
62-
- "traefik.enable=true"
63-
- "traefik.http.routers.api.rule=Host(`${API_URL}`)"
64-
- "traefik.http.routers.api.entrypoints=websecure"
65-
- "traefik.http.routers.api.tls.certresolver=letsencrypt"
66-
- "traefik.http.routers.api.tls=true"
67-
networks:
68-
- app_bridge
69-
depends_on:
70-
db:
71-
condition: service_healthy
7249
db:
7350
image: postgis/postgis:14-3.3-alpine
7451
container_name: db

0 commit comments

Comments
 (0)
Please sign in to comment.