Skip to content

Commit

Permalink
ImpOSM update sequence (#313)
Browse files Browse the repository at this point in the history
* Update script to keep state of sequence files - imposm

* Update docker file and start.sh - imposm

* Add liveness probe - imposm

* Add UPLOAD_EXPIRED_FILES env var for imposm

* Add default value for UPLOAD_EXPIRED_FILES in imposm

* set initialDelaySeconds: 3600 in liveness probe - imposm

* Increase initialDelaySeconds to 2 hours

---------
  • Loading branch information
Rub21 authored Feb 20, 2024
1 parent f87b744 commit 2a7e77f
Show file tree
Hide file tree
Showing 6 changed files with 186 additions and 155 deletions.
57 changes: 31 additions & 26 deletions compose/tiler.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '3'
version: '3.8'
services:
# ######################################################
# ### Tiler DB
Expand All @@ -9,11 +9,12 @@ services:
context: ../images/tiler-db
dockerfile: Dockerfile
ports:
- "5433:5432"
- "5433:5432"
volumes:
- ../data/tiler-db-data:/var/lib/postgresql/data
- ../data/tiler-db-data:/var/lib/postgresql/data
env_file:
- ../envs/.env.tiler-db
- ../envs/.env.tiler-db
restart: always
# ######################################################
# ### Tiler imposm for importing data
# ######################################################
Expand All @@ -23,18 +24,23 @@ services:
context: ../images/tiler-imposm
dockerfile: Dockerfile
volumes:
- ../data/tiler-imposm-data:/mnt/data
- ../data/tiler-imposm-data:/mnt/data
# - ../images/tiler-imposm:/osm
depends_on:
- tiler-db
command: >
/bin/bash -c "
echo starting imposm!;
sleep 1m;
./start.sh;
"
- tiler-db
command:
- sh
- -c
- "sleep 60 && ./start.sh"
env_file:
- ../envs/.env.tiler-db
- ../envs/.env.tiler-imposm
- ../envs/.env.tiler-db
- ../envs/.env.tiler-imposm
healthcheck:
test: ["CMD", "./liveness.sh"]
interval: 30s
timeout: 10s
retries: 3
restart: always
# ######################################################
# ### Tiler imposm for importing data
# ######################################################
Expand All @@ -44,18 +50,17 @@ services:
context: ../images/tiler-server
dockerfile: Dockerfile
volumes:
- ../data/tiler-server-data:/mnt/data
- ../data/tiler-server-data:/mnt/data
depends_on:
- tiler-db
- tiler-imposm
- tiler-db
- tiler-imposm
ports:
- "9090:9090"
command: >
/bin/bash -c "
echo Starting tiles server!;
sleep 2m;
./start.sh;
"
- "9090:9090"
command:
- sh
- -c
- "sleep 60 && ./start.sh"
env_file:
- ../envs/.env.tiler-db
- ../envs/.env.tiler-server
- ../envs/.env.tiler-db
- ../envs/.env.tiler-server
restart: always
10 changes: 5 additions & 5 deletions images/tiler-imposm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ RUN apt-get install -y \
curl \
wget \
unzip \
software-properties-common
software-properties-common && \
rm -rf /var/lib/apt/lists/*

# # Install python
RUN add-apt-repository ppa:deadsnakes/ppa && \
apt-get update && \
apt-get install -y build-essential python3.6 python3.6-dev python3-pip && \
rm -rf /var/lib/apt/lists/* && \
python3 -m pip install pip --upgrade && \
python3 -m pip install wheel

Expand Down Expand Up @@ -53,7 +55,5 @@ WORKDIR $IMPOSMDATA
VOLUME $IMPOSMDATA

WORKDIR /osm
COPY config config
COPY scripts scripts
COPY start.sh start.sh
CMD ./start.sh
COPY . .
CMD ./start.sh
8 changes: 8 additions & 0 deletions images/tiler-imposm/liveness.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
if ps aux | grep -v grep | grep "imposm" >/dev/null; then
echo "imposm process is running."
exit 0
else
echo "imposm process is not running." 1>&2
exit 1
fi
Loading

0 comments on commit 2a7e77f

Please sign in to comment.