Skip to content

Commit

Permalink
Remove unused services from helm template (#345)
Browse files Browse the repository at this point in the history
* PG evaluation for livenessProbe web container

* Remove helm values services that is not used

* Remove tiler visor

* Delete iD editor service

* Liveness probe for apache, cgimap and postgres

* Install pg client in osm-processor

* Update osm-processor in images

* Install ps in replication job
  • Loading branch information
Rub21 authored Oct 30, 2024
1 parent 686c7c0 commit 5fab28a
Show file tree
Hide file tree
Showing 13 changed files with 68 additions and 263 deletions.
20 changes: 17 additions & 3 deletions compose/planet.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
version: '3'
services:
######################################################
### OSM minute replication files section
######################################################
osm-processor:
image: osmseed-osm-processor:v1
build:
context: ../images/osm-processor
dockerfile: Dockerfile
volumes:
- ../data/osm-processor-data:/mnt/data
command: /start.sh
env_file:
- ../envs/.env.db
- ../envs/.env.db-utils
- ../envs/.env.cloudprovider
restart: always

#####################################################
## OSM minute replication files section
#####################################################
replication-job:
image: osmseed-replication-job:v1
build:
Expand Down
2 changes: 1 addition & 1 deletion images/full-history/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM developmentseed/osmseed-osm-processor:0.1.0-n795.h1c8d32f
FROM developmentseed/osmseed-osm-processor:0.1.0-n802.h0d9f574

VOLUME /mnt/data
COPY ./start.sh /
Expand Down
12 changes: 7 additions & 5 deletions images/osm-processor/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,22 @@ FROM debian:bookworm-slim
ENV workdir /mnt/data
WORKDIR $workdir

# Installs osmosis v0.48.3 & osmium-tool v1.15.0
# Installs osmosis v0.48.3, osmium-tool v1.15.0, and PostgreSQL client
RUN set -ex \
&& apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install \
-y --no-install-recommends \
&& apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install \
-y --no-install-recommends \
"osmosis" \
"osmium-tool" \
# Cloud provider CLIs
"awscli" \
"gsutil" \
"azure-cli" \
# PostgreSQL client
"postgresql-client" \
# Other useful packages
"rsync" \
"pyosmium" \
"tmux" \
"zsh" \
&& rm -rf /var/lib/apt/lists/*
&& rm -rf /var/lib/apt/lists/*
2 changes: 1 addition & 1 deletion images/planet-dump/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM developmentseed/osmseed-osm-processor:0.1.0-n795.h1c8d32f
FROM developmentseed/osmseed-osm-processor:0.1.0-n802.h0d9f574

VOLUME /mnt/data
COPY ./start.sh /
Expand Down
2 changes: 1 addition & 1 deletion images/populate-apidb/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM developmentseed/osmseed-osm-processor:0.1.0-n795.h1c8d32f
FROM developmentseed/osmseed-osm-processor:0.1.0-n802.h0d9f574

VOLUME /mnt/data
COPY ./start.sh /
Expand Down
10 changes: 7 additions & 3 deletions images/replication-job/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
FROM developmentseed/osmseed-osm-processor:0.1.0-n795.h1c8d32f
FROM developmentseed/osmseed-osm-processor:0.1.0-n802.h0d9f574

RUN apt-get update && \
apt-get install -y nginx python3-pip python3-venv && \
apt-get install -y \
nginx \
python3-pip \
python3-venv \
procps && \
rm -rf /var/lib/apt/lists/*

RUN python3 -m venv /opt/venv
Expand All @@ -13,4 +17,4 @@ COPY monitoring.py /

WORKDIR /mnt/data

CMD /start.sh
CMD /start.sh
41 changes: 34 additions & 7 deletions images/web/liveness.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,36 @@
#!/usr/bin/env bash
# This is a script for the complex evaluation of whether Apache or other processes are running in the container.
if [ $(ps -ef | grep -E 'httpd|apache2' | grep -v grep | wc -l) -ge 1 ]; then
echo "Apache is running."
exit 0
# This is a script for evaluating if openstreetmap-cgimap, apache2, and PostgreSQL are running in the container.
check_process() {
if ps aux | grep "$1" | grep -v grep > /dev/null; then
return 0
else
return 1
fi
}

# Check for openstreetmap-cgimap process
check_process "/openstreetmap-cgimap/build/openstreetmap-cgimap"
cgimap_status=$?

# Check for apache2 process
check_process "apache2"
apache_status=$?

# Check PostgreSQL connection
check_postgres() {
PGPASSWORD=$POSTGRES_PASSWORD psql -h $POSTGRES_HOST -U $POSTGRES_USER -d $POSTGRES_DB -c "SELECT 1;" > /dev/null 2>&1
return $?
}

check_postgres
postgres_status=$?

if [ $cgimap_status -eq 0 ] && [ $apache_status -eq 0 ] && [ $postgres_status -eq 0 ]; then
echo "All services (openstreetmap-cgimap, apache2, PostgreSQL) are running."
exit 0
else
echo "Apache is not running!" 1>&2
exit 1
fi
[ $cgimap_status -ne 0 ] && echo "openstreetmap-cgimap is not running!" 1>&2
[ $apache_status -ne 0 ] && echo "apache2 is not running!" 1>&2
[ $postgres_status -ne 0 ] && echo "Failed to connect to PostgreSQL!" 1>&2
exit 1
fi
54 changes: 0 additions & 54 deletions osm-seed/templates/id-editor/id-editor-deployment.yaml

This file was deleted.

37 changes: 0 additions & 37 deletions osm-seed/templates/id-editor/id-editor-service.yaml

This file was deleted.

52 changes: 0 additions & 52 deletions osm-seed/templates/tiler-visor/tiler-visor-deployment.yaml

This file was deleted.

26 changes: 0 additions & 26 deletions osm-seed/templates/tiler-visor/tiler-visor-ingress.yaml

This file was deleted.

43 changes: 0 additions & 43 deletions osm-seed/templates/tiler-visor/tiler-visor-service.yaml

This file was deleted.

Loading

0 comments on commit 5fab28a

Please sign in to comment.