ckan / ckan-docker-base

This is the Git repo of the official Docker images for CKAN.
17 stars 19 forks source link

Investigate dropping Supervisor in the CKAN image/container #59

Open kowh-ai opened 2 months ago

kowh-ai commented 2 months ago

Investigate if Docker (specifically Docker Compose) can provide built-in mechanisms for managing processes within containers

kowh-ai commented 2 months ago

Will wait until the python 3.10 (bookworm-slim) base image is rolled into master and then will work on the following

Get rid of all references to supervisor in the following files:

  1. Dockerfile.python.3.10
  2. start_ckan.python.3.10.sh

To test: kill processes in the running CKAN container and see if the container restarts. There are the following processes running:

The start_ckan.sh process has an pid of 1 (the root process) so this cannot be killed. however the others can so we kill -9 the uwsgi processes

What about the difference between the following:

  1. Docker.python.3.10

HEALTHCHECK --interval=60s --timeout=5s --retries=5 CMD curl --fail http://localhost:5000/api/3/action/status_show || exit CMD ["/srv/app/start_ckan.sh"]

  1. docker compose yaml file

healthcheck: test: ["CMD", "wget", "-qO", "/dev/null", "http://localhost:5000"] interval: 60s timeout: 10s retries: 3s

The docker compose yaml file will override the Dockerfile file - so we can remove these lines from the Dockerfile

As far as healthchecks make sure the datapusher service has the same healthchecks as ckan service

This could be done just for the CKAN 2.11 and CKAN master branches...in that case the Docker file and start script is the normal one

Markus92 commented 3 weeks ago

Hi, has any work already been done on this? We notice in the latest version of the CKAN 2.10.4 docker image (the one from 6 days ago), supervisorctl and crond aren't running anymore and this leads to our harvester not harvesting (we use the supervisor to run the fetch and gather as recommended here: https://github.com/ckan/ckanext-harvest?tab=readme-ov-file#setting-up-the-harvesters-on-a-production-server)