From 956aa639b6ae5b1ffe87feca7936923f150a512c Mon Sep 17 00:00:00 2001 From: Martin Bayr Date: Mon, 25 Mar 2024 13:52:15 +0100 Subject: [PATCH] install supervisor for xloader --- .github/workflows/edge-sddi-urban.yml | 5 +-- sddi-urban/Dockerfile | 6 +++ .../supervisor/supervisor-ckan-worker.conf | 42 +++++++++++++++++++ 3 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 sddi-urban/supervisor/supervisor-ckan-worker.conf diff --git a/.github/workflows/edge-sddi-urban.yml b/.github/workflows/edge-sddi-urban.yml index 9c8910a..d9b7032 100644 --- a/.github/workflows/edge-sddi-urban.yml +++ b/.github/workflows/edge-sddi-urban.yml @@ -39,10 +39,9 @@ jobs: with: images: | ${{ env.REGISTRY }}/it-at-m/ckan-${{ matrix.context }} - flavor: latest=true tags: | type=edge,branch=sddi-urban-2.9.9,suffix=-2.9.9-dev - type=raw,value=udp-katalog-1.1.3 + type=raw,value=udp-katalog-1.1.4-dev labels: | maintainer=it@m, Landeshauptstadt Muenchen (LHM) org.opencontainers.image.vendor=it@m, Landeshauptstadt Muenchen (LHM) @@ -66,7 +65,7 @@ jobs: ${{ env.REGISTRY }}/it-at-m/ckan-${{ matrix.context }} tags: | type=edge,branch=sddi-urban-2.9.9,suffix=-2.9.9-debug-dev - type=raw,value=udp-katalog-1.1.3-debug + type=raw,value=udp-katalog-1.1.4-debug-dev labels: | maintainer=it@m, Landeshauptstadt Muenchen (LHM) org.opencontainers.image.vendor=it@m, Landeshauptstadt Muenchen (LHM) diff --git a/sddi-urban/Dockerfile b/sddi-urban/Dockerfile index 9b32d02..5e5c7d3 100644 --- a/sddi-urban/Dockerfile +++ b/sddi-urban/Dockerfile @@ -199,6 +199,12 @@ RUN set -ex && \ RUN set -ex && \ pip install --no-index --find-links=${APP_DIR}/ext_wheels ckanext-iso +# install supervisor ######################################################## +RUN set -ex && \ + apt-get update && \ + apt-get install supervisor +COPY supervisor/supervisor-ckan-worker.conf /etc/supervisor/conf.d + RUN set -ex && \ ckan config-tool "${CKAN_INI}" "ckan.plugins = ${CKAN__PLUGINS}" && \ diff --git a/sddi-urban/supervisor/supervisor-ckan-worker.conf b/sddi-urban/supervisor/supervisor-ckan-worker.conf new file mode 100644 index 0000000..d7f5783 --- /dev/null +++ b/sddi-urban/supervisor/supervisor-ckan-worker.conf @@ -0,0 +1,42 @@ +; ======================================================= +; Supervisor configuration for CKAN background job worker +; ======================================================= + +; 1. Copy this file to /etc/supervisor/conf.d +; 2. Make sure the paths below match your setup + + +[program:ckan-worker] + +; Use the full paths to the virtualenv and your configuration file here. +command=/usr/local/bin/ckan -c /srv/app/production.ini jobs worker + + +; User the worker runs as. +user=www-data + + +; Start just a single worker. Increase this number if you have many or +; particularly long running background jobs. +numprocs=1 +process_name=%(program_name)s-%(process_num)02d + + +; Log files. +stdout_logfile=/srv/app/data/ckan-worker.stdout.log +stderr_logfile=/srv/app/data/ckan-worker.stderr.log + + +; Make sure that the worker is started on system start and automatically +; restarted if it crashes unexpectedly. +autostart=true +autorestart=true + + +; Number of seconds the process has to run before it is considered to have +; started successfully. +startsecs=10 + +; Need to wait for currently executing tasks to finish at shutdown. +; Increase this if you have very long running tasks. +stopwaitsecs = 600 \ No newline at end of file