[ckan-changes] commit/ckan: kindly: [config] add sample supervisor and celeryconfig files

Bitbucket commits-noreply at bitbucket.org
Sun Oct 30 01:29:20 UTC 2011


1 new commit in ckan:


https://bitbucket.org/okfn/ckan/changeset/ae5cd77638ac/
changeset:   ae5cd77638ac
branch:      feature-1371-task-status-logic-layer
user:        kindly
date:        2011-10-30 02:28:57
summary:     [config] add sample supervisor and celeryconfig files
affected #:  2 files

diff -r e07a44ebcc5a4490265009f9aae315316400e155 -r ae5cd77638ac5e3cd6d6ccc0fe3db3cb74604cf6 ckan/config/celery-supervisor.conf
--- /dev/null
+++ b/ckan/config/celery-supervisor.conf
@@ -0,0 +1,36 @@
+; ===============================
+; ckan celeryd supervisor example
+; ===============================
+
+; symlink or copy this file to /etc/supervisr/conf.d 
+; change the path/to/virtualenv below to the virtualenv ckan is in.
+
+[program:celery]
+; Path to executable, should be path to ckans virtural environment.
+command=/path/to/virtualenv/bin/celeryd --loglevel=INFO
+
+; THIS IS NEEDED IF YOU WANT TO RUN CELERY FROM A VIRTUAL ENVIRONMENT 
+; It is the same as doing source bin/activate
+environment=PATH="/path/to/virtualenv/bin"
+
+; Path that is changed to from start. Recomend that you put your
+; celeryconfig.py in this directory too.
+
+directory=/path/to/virtualenv/bin
+; user that owns virtual environment.
+user=ckan
+
+numprocs=1
+stdout_logfile=/var/log/celeryd.log
+stderr_logfile=/var/log/celeryd.log
+autostart=true
+autorestart=true
+startsecs=10
+
+; Need to wait for currently executing tasks to finish at shutdown.
+; Increase this if you have very long running tasks.
+stopwaitsecs = 600
+
+; if rabbitmq is supervised, set its priority higher
+; so it starts first
+priority=998


diff -r e07a44ebcc5a4490265009f9aae315316400e155 -r ae5cd77638ac5e3cd6d6ccc0fe3db3cb74604cf6 ckan/config/celeryconfig.py
--- /dev/null
+++ b/ckan/config/celeryconfig.py
@@ -0,0 +1,19 @@
+## Example celery config
+
+## It is recommended that this file be put in the /path/to/virtualenv/bin directory.  This way it will definitely get picked up by ckan and the deamons.
+
+#Broker can be whatever you like but can be ckan database too.
+BROKER_BACKEND = "sqlalchemy"
+BROKER_HOST = "postgres://ckan:pass@localhost/ckan.net"
+
+
+#Results backend should be the same as where the ckan database is.
+CELERY_RESULT_DBURI = "postgres://ckan:pass@localhost/ckan.net"
+CELERY_RESULT_BACKEND = "database"
+CELERY_RESULT_SERIALIZER = 'json'
+CELERY_TASK_SERIALIZER = 'json'
+
+
+
+#Inports of all the tasks you need. TODO add extension point to add these.
+CELERY_IMPORTS = ('ckanext.archiver.tasks', 'ckanext.webstorer.tasks')

Repository URL: https://bitbucket.org/okfn/ckan/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.




More information about the ckan-changes mailing list