Skip to content

Commit ec665eb

Browse files
authored
Taginfo container and scripts updates (#321)
* Update ingress for web container * Update ingress for nominatim and overpass api * Update ingress for osmcha * Update ingress for taginfo * Update ingress for task manager * Update ingress for tiler server * Update ingress domain in values and hp * Add api.<domain> for web ingress * Update web ingress for main domain * Disable domain route * Update service name in ingress - tm * Enable rules for root domain - web * update cromjob for osmcha * Update proxy-body-size in ingress * Updata start taginfo script Install awscli in taginfo Simplify taginfo container Update taginfo container Update taginfo script Update taginfo script * Updata helm charts for taginfo * Update docker continaer taginfo * Update tag info start script * Update taginfo container and config * Update comment - taginfo Update taginfo charts Update overwrite url for config - taginfo Update taginfo to get data from s3 * Update ingress for services (#319) * Update ingress for web container * Update ingress for nominatim and overpass api * Update ingress for osmcha * Update ingress for taginfo * Update ingress for task manager * Update ingress for tiler server * Update ingress domain in values and hp * Add api.<domain> for web ingress * Update web ingress for main domain * Disable domain route * Update service name in ingress - tm * Enable rules for root domain - web * update cromjob for osmcha * Update proxy-body-size in ingress * Set SERVER_URL from Values.web.ingressDomain in case we use ClusterIP Update interval env var * Update cronjob for taginfo * Update cronjob and config for taginfo * Remove pytho script - taginfo Fix script to download files Fix the download of the custom config file for Taginfo Update service port Enable livenessProbe for taginfo Update port for taginfo Update source code Update port for service chart- taginfo Update Fix not exposing port in taginfo * Enable livenessProbe taginfo * Compress files to download * Update script to sync lates version of taginfo data * Fix name of the env var for AWS_S3_BUCKET * Update script * Fix deployment - taginfo * Fix service for taginfo
1 parent 03ba6f3 commit ec665eb

File tree

10 files changed

+265
-179
lines changed

10 files changed

+265
-179
lines changed

compose/taginfo.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ services:
99
context: ../images/taginfo
1010
dockerfile: Dockerfile
1111
ports:
12-
- '4567:80'
12+
- '8000:80'
1313
volumes:
14-
- ../data/taginfo-data:/apps/data/
14+
- ../data/taginfo-data:/usr/src/app/data
1515
command: >
16-
/bin/bash -c "
17-
./start.sh"
16+
/bin/bash -c "/usr/src/app/start.sh web"
17+
1818
env_file:
19-
- ../envs/.env.taginfo
19+
- ../envs/.env.taginfo

images/taginfo/Dockerfile

Lines changed: 50 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
1-
FROM ruby:2.4
2-
ENV workdir /apps
1+
FROM ruby:3.0-slim
2+
3+
ARG workdir=/usr/src/app
34
WORKDIR $workdir
5+
46
RUN apt-get update && apt-get install -y \
5-
curl \
6-
sqlite3 \
7-
sqlite3-pcre \
8-
ruby-passenger \
9-
libapache2-mod-passenger \
10-
git \
117
cmake \
128
libbz2-dev \
139
libexpat1-dev \
@@ -18,32 +14,60 @@ RUN apt-get update && apt-get install -y \
1814
libsqlite3-dev \
1915
make \
2016
zlib1g-dev \
17+
curl \
18+
sqlite3 \
19+
sqlite3-pcre \
20+
passenger \
21+
libapache2-mod-passenger \
22+
libreadline-dev \
23+
tcl \
24+
git \
2125
jq \
22-
ca-certificates \
23-
osmium-tool \
24-
pyosmium \
25-
rsync \
26-
tmux \
27-
zsh \
28-
nano \
29-
vim \
30-
&& rm -rf /var/lib/apt/lists/* # Clean up to reduce image size
31-
32-
# Clone and setup taginfo-tools
26+
python3-pip \
27+
wget \
28+
&& apt-get clean \
29+
&& rm -rf /var/lib/apt/lists/*
30+
3331
RUN git clone https://github.com/taginfo/taginfo-tools.git $workdir/taginfo-tools && \
3432
cd $workdir/taginfo-tools && \
3533
git submodule update --init && \
3634
mkdir build && cd build && \
3735
cmake .. && make
36+
RUN gem install json rack-contrib puma sinatra:'<3' sinatra-r18n:'5.0.2'
37+
38+
# Install AWS CLI
39+
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \
40+
unzip awscliv2.zip && \
41+
./aws/install && \
42+
rm awscliv2.zip
3843

39-
# Clone and setup taginfo
4044
RUN git clone https://github.com/taginfo/taginfo.git $workdir/taginfo && \
4145
cd $workdir/taginfo && \
42-
git checkout ae5a950f7aa4c0de4e706839619a1dc05fc4450a && \
43-
echo "gem 'thin' " >> Gemfile && \
44-
gem install bundler -v 2.3.27 && \
4546
bundle install
4647

47-
COPY overwrite_config.py $workdir/
48-
COPY start.sh $workdir/
49-
CMD $workdir/start.sh
48+
# Download and prepare uWSGI
49+
RUN wget http://projects.unbit.it/downloads/uwsgi-latest.tar.gz \
50+
&& tar zxvf uwsgi-latest.tar.gz \
51+
&& rm uwsgi-latest.tar.gz && \
52+
mv $(ls | grep uwsgi-) uwsgi-dir && \
53+
cd uwsgi-dir && \
54+
make PROFILE=nolang && \
55+
PYTHON=python3 UWSGI_PROFILE_OVERRIDE="ssl=true,rack=true,http=true" make
56+
57+
# # Set non-root user
58+
# RUN groupadd -r taginfo && useradd -m -r -g taginfo taginfo
59+
# RUN chown -R taginfo:taginfo $workdir
60+
# RUN chmod -R 777 $workdir
61+
# USER taginfo
62+
63+
# RUN chown -R www-data: $workdir
64+
65+
WORKDIR $workdir
66+
67+
# Copy configuration files and scripts
68+
COPY config/taginfo-config.json $workdir/
69+
COPY start.sh .
70+
71+
# Expose port and set default command
72+
EXPOSE 80
73+
CMD ["./start.sh"]
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
{
2+
"instance": {
3+
"url": "http://localhost:80",
4+
"name": "OpenStreetMap Taginfo",
5+
"description": "This is a <b>taginfo test instance</b>. Change this text in your <tt>taginfo-config.json</tt>.",
6+
"about": "<p>This site is maintained by osm-seed",
7+
"icon": "/img/logo/test.png",
8+
"contact": "info@osm-seed.org",
9+
"area": "World",
10+
"access_control_allow_origin": "*",
11+
"sections": ["download", "taginfo"]
12+
},
13+
"geodistribution": {
14+
"left": -180,
15+
"bottom": -90,
16+
"right": 180,
17+
"top": 90,
18+
"width": 360,
19+
"height": 180,
20+
"scale_image": 2,
21+
"scale_compare_image" : 1,
22+
"background_image": "/img/mapbg/world.png",
23+
"image_attribution": "osm-seed"
24+
},
25+
"paths": {
26+
"data_dir": "/usr/src/app/data",
27+
"download_dir": "/usr/src/app/taginfo/web/public/download",
28+
"bin_dir": "/usr/src/app/taginfo-tools/build/src",
29+
"sqlite3_pcre_extension": "/usr/lib/sqlite3/pcre.so"
30+
},
31+
"xapi": {
32+
"max_results": 1000,
33+
"url_prefix": "https://overpass-api.de/api/xapi_meta?"
34+
},
35+
"turbo": {
36+
"max_auto": 1000,
37+
"url_prefix": "https://overpass-turbo.eu/?",
38+
"wizard_area": "global"
39+
},
40+
"level0": {
41+
"max_results": 50,
42+
"overpass_url_prefix": "https://overpass-api.de/api/interpreter?",
43+
"level0_url_prefix": "http://level0.osmz.ru/?"
44+
},
45+
"opensearch": {
46+
"shortname": "Taginfo Test Instance",
47+
"contact": "somebody@example.com",
48+
"description": "Find metadata about OpenStreetMap tags",
49+
"tags": "osm openstreetmap tag tags taginfo"
50+
},
51+
"sources": {
52+
"download": "languages wiki wikidata",
53+
"create": "db projects chronology",
54+
"db": {
55+
"planetfile": "/osm/planet/var/current-planet.osm.pbf",
56+
"bindir": "/apps/data/update/build/src"
57+
},
58+
"chronology": {
59+
"osm_history_file": "/osm/planet/var/current-history-planet.osh.pbf"
60+
},
61+
"master": {
62+
"min_count_tags": 10,
63+
"min_tag_combination_count": 10,
64+
"min_count_for_map": 10,
65+
"min_count_relations_per_type": 10
66+
}
67+
},
68+
"logging": {
69+
"directory": "/usr/src/app/logs",
70+
"min_duration": 0.1
71+
},
72+
"tagstats": {
73+
"geodistribution": "FlexMem"
74+
}
75+
}

images/taginfo/overwrite_config.py

Lines changed: 0 additions & 45 deletions
This file was deleted.

0 commit comments

Comments
 (0)