Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add harvest configs and supervisorctl #600

Merged
merged 6 commits into from
Dec 15, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions ckan-backend-dev/ckan/Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,10 @@ RUN ckan config-tool ${CKAN_INI} "ckan.root_path = /private-admin/{{LANG}}"

COPY setup/who.ini ${APP_DIR}/src/ckan/who.ini

COPY setup/supervisord.conf /etc/supervisord.d/supervisord.conf
COPY setup/supervisor.worker.conf /etc/supervisord.d/worker.conf
COPY setup/supervisor.harvest.conf /etc/supervisord.d/harvest.conf

RUN chown -R ckan:ckan /etc/supervisord.d

CMD ["sh", "-c", "${APP_DIR}/start_ckan_development.sh"]
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ then
fi

# Start supervisord
supervisord --configuration /etc/supervisord.conf &
supervisord --configuration /etc/supervisord.d/supervisord.conf &

# Start the development server with automatic reload
ckan -c $CKAN_INI run -H 0.0.0.0 --prefix /private-admin
26 changes: 26 additions & 0 deletions ckan-backend-dev/ckan/setup/supervisor.harvest.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[program:ckan-fetch]
command=ckan -c /srv/app/production.ini harvester fetch-consumer
priority=501
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stdout
stderr_logfile_maxbytes=0
user=ckan
environment=HOME="/srv/app",USER="ckan"


[program:ckan-gather]
command=ckan -c /srv/app/production.ini harvester gather-consumer
priority=501
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stdout
stderr_logfile_maxbytes=0
user=ckan
environment=HOME="/srv/app",USER="ckan"
12 changes: 12 additions & 0 deletions ckan-backend-dev/ckan/setup/supervisor.worker.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[program:ckan-worker]
command=ckan -c /srv/app/production.ini jobs worker
priority=501
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stdout
stderr_logfile_maxbytes=0
user=ckan
environment=HOME="/srv/app",USER="ckan"
23 changes: 23 additions & 0 deletions ckan-backend-dev/ckan/setup/supervisord.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[unix_http_server]
file = /tmp/supervisor.sock
chmod = 0777
chown = ckan:ckan

[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
6 changes: 6 additions & 0 deletions deployment/ckan/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,11 @@ USER root

RUN chown -R ckan:ckan ${APP_DIR}/src/

COPY setup/supervisord.conf /etc/supervisord.d/supervisord.conf
COPY setup/supervisor.worker.conf /etc/supervisord.d/worker.conf
COPY setup/supervisor.harvest.conf /etc/supervisord.d/harvest.conf

RUN chown -R ckan:ckan /etc/supervisord.d

USER ckan

2 changes: 1 addition & 1 deletion deployment/ckan/setup/start_ckan.sh.override
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export SCRIPT_NAME="/private-admin"
if [ $? -eq 0 ]
then
# Start supervisord
supervisord --configuration /etc/supervisord.conf &
supervisord --configuration /etc/supervisord.d/supervisord.conf &
# Start uwsgi
uwsgi $UWSGI_OPTS
else
Expand Down
2 changes: 1 addition & 1 deletion deployment/ckan/setup/start_ckan_development.sh.override
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ then
fi

# Start supervisord
supervisord --configuration /etc/supervisord.conf &
supervisord --configuration /etc/supervisord.d/supervisord.conf &

# Start the development server with automatic reload
sudo -u ckan -EH ckan -c $CKAN_INI run -H 0.0.0.0 --prefix /private-admin
26 changes: 26 additions & 0 deletions deployment/ckan/setup/supervisor.harvest.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[program:ckan-fetch]
command=ckan -c /srv/app/production.ini harvester fetch-consumer
priority=501
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stdout
stderr_logfile_maxbytes=0
user=ckan
environment=HOME="/srv/app",USER="ckan"


[program:ckan-gather]
command=ckan -c /srv/app/production.ini harvester gather-consumer
priority=501
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stdout
stderr_logfile_maxbytes=0
user=ckan
environment=HOME="/srv/app",USER="ckan"
12 changes: 12 additions & 0 deletions deployment/ckan/setup/supervisor.worker.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[program:ckan-worker]
command=ckan -c /srv/app/production.ini jobs worker
priority=501
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stdout
stderr_logfile_maxbytes=0
user=ckan
environment=HOME="/srv/app",USER="ckan"
23 changes: 23 additions & 0 deletions deployment/ckan/setup/supervisord.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[unix_http_server]
file = /tmp/supervisor.sock
chmod = 0777
chown = ckan:ckan

[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
Loading