From 0ea4d80b39c80618bdf0c769b56da7421bf2ec70 Mon Sep 17 00:00:00 2001 From: Ben Bright Date: Tue, 10 Dec 2024 08:08:20 -0600 Subject: [PATCH 1/4] Changed way supervisor.conf gets copied --- docker/ckan/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/ckan/Dockerfile b/docker/ckan/Dockerfile index 4c6bb85..a966124 100644 --- a/docker/ckan/Dockerfile +++ b/docker/ckan/Dockerfile @@ -263,10 +263,10 @@ RUN ckan config-tool ${APP_DIR}/production.ini "ckan.plugins = ${CKAN__PLUGINS}" ckan config-tool ${APP_DIR}/production.ini "googleanalytics.download_handler = ckanext.s3filestore.views:resource_download" && \ # Change ownership to app user chown -R ckan:ckan /srv/app && \ - # Setup supervisor - cp -v /srv/app/src/ckan/ckanext-twdh_theme/ckanext/twdh_theme/config/supervisor-ckan-worker.conf /etc/supervisor/conf.d/ && \ mkdir -v /var/log/ckan +# Setup supervisor +COPY ./supervisor-ckan-worker.conf /etc/supervisor/conf.d/ # install Rust, then qsvdp RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \ From 56f141d7b6713d1e62473f62b102a55e1ddfa3ec Mon Sep 17 00:00:00 2001 From: Ben Bright Date: Tue, 10 Dec 2024 08:08:43 -0600 Subject: [PATCH 2/4] Added supervisor-ckan-worker.conf config file --- docker/ckan/supervisor-ckan-worker.conf | 44 +++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 docker/ckan/supervisor-ckan-worker.conf diff --git a/docker/ckan/supervisor-ckan-worker.conf b/docker/ckan/supervisor-ckan-worker.conf new file mode 100644 index 0000000..3df276e --- /dev/null +++ b/docker/ckan/supervisor-ckan-worker.conf @@ -0,0 +1,44 @@ +; ======================================================= +; 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/lib/ckan/default/bin/ckan -c /etc/ckan/default/ckan.ini jobs worker +command=/srv/app/virtualenv/bin/ckan -c production.ini jobs worker + + +; User the worker runs as. +; user=www-data +user=ckan + + +; 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=/var/log/ckan/ckan-worker.stdout.log +stderr_logfile=/var/log/ckan/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 From 841d61de2f726b600068b795dac56bb8cb3d72da Mon Sep 17 00:00:00 2001 From: Ben Bright Date: Tue, 10 Dec 2024 13:48:46 -0600 Subject: [PATCH 3/4] Added supervisord.conf --- docker/ckan/Dockerfile | 1 + docker/ckan/supervisord.conf | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 docker/ckan/supervisord.conf diff --git a/docker/ckan/Dockerfile b/docker/ckan/Dockerfile index a966124..2fcca14 100644 --- a/docker/ckan/Dockerfile +++ b/docker/ckan/Dockerfile @@ -266,6 +266,7 @@ RUN ckan config-tool ${APP_DIR}/production.ini "ckan.plugins = ${CKAN__PLUGINS}" mkdir -v /var/log/ckan # Setup supervisor +COPY ./supervisord.conf /etc/supervisor/ COPY ./supervisor-ckan-worker.conf /etc/supervisor/conf.d/ # install Rust, then qsvdp diff --git a/docker/ckan/supervisord.conf b/docker/ckan/supervisord.conf new file mode 100644 index 0000000..a3f6671 --- /dev/null +++ b/docker/ckan/supervisord.conf @@ -0,0 +1,23 @@ +[unix_http_server] +file = /tmp/supervisor.sock +chmod = 0777 +chown = nobody:nogroup + +[supervisord] +logfile = /tmp/supervisord.log +logfile_maxbytes = 50MB +logfile_backups=10 +loglevel = info +pidfile = /tmp/supervisord.pid +nodaemon = true +umask = 022 +identifier = supervisor + +[supervisorctl] +serverurl = unix:///tmp/supervisor.sock + +[rpcinterface:supervisor] +supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface + +[include] +files = /etc/supervisord.d/*.conf From d071ac40bd984491207892ea050e775b5812344e Mon Sep 17 00:00:00 2001 From: Ben Bright Date: Tue, 10 Dec 2024 15:41:41 -0600 Subject: [PATCH 4/4] Fixed /etc/supervisor/conf.d/ path in supervisord.conf --- docker/ckan/supervisord.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/ckan/supervisord.conf b/docker/ckan/supervisord.conf index a3f6671..e62a3ca 100644 --- a/docker/ckan/supervisord.conf +++ b/docker/ckan/supervisord.conf @@ -20,4 +20,4 @@ serverurl = unix:///tmp/supervisor.sock supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface [include] -files = /etc/supervisord.d/*.conf +files = /etc/supervisor/conf.d/*