Skip to content

Commit

Permalink
Add init/default files for onadata, celery and nginx
Browse files Browse the repository at this point in the history
  • Loading branch information
ukanga committed May 14, 2018
1 parent 86a65f0 commit ee58546
Show file tree
Hide file tree
Showing 7 changed files with 848 additions and 1 deletion.
1 change: 0 additions & 1 deletion docs/install.rst
Expand Up @@ -141,7 +141,6 @@ Step 1: Install dependencies using brew

.. code-block:: sh
brew install mongo
brew install postgis
brew install gdal
brew install rabbitmq
Expand Down
28 changes: 28 additions & 0 deletions script/etc/default/celerybeat-generic
@@ -0,0 +1,28 @@
# Where to chdir at start.
CELERYBEAT_CHDIR="/srv/onadata"

# Python interpreter from environment, if using virtualenv
ENV_PYTHON="/srv/onadata/.virtualenv/bin/python"
CELERY_BIN="/srv/onadata/.virtualenv/bin/celery"

# Name of the celery config module, don't change this.
CELERY_APP="onadata.celery"

# %n will be replaced with the nodename.

# Workers should run as an unprivileged user.
CELERYBEAT_USER="onadata"
CELERYBEAT_GROUP="onadata"

# Set any other env vars here too!
C_FORCE_ROOT=1
CELERY_CREATE_DIRS=1
CELERYBEAT_LOG_LEVEL="INFO"
CELERYBEAT_LOG_FILE="/var/log/onadata/celerybeat.log"
CELERYBEAT_SCHEDULE="/var/run/onadata/celerybeat-schedule"
CELERYBEAT_STATE_DIR="/var/run/onadata/celerybeat"
CELERYBEAT_PID_FILE="/var/run/onadata/celerybeat.pid"
# Name of the projects settings module.
# in this case is just settings and not the full path because it will change the dir to
# the project folder first.
DJANGO_SETTINGS_MODULE="onadata.settings.common"
34 changes: 34 additions & 0 deletions script/etc/default/celeryd-generic
@@ -0,0 +1,34 @@
# Name of nodes to start, here we have a single node
CELERYD_NODES="default export-node publish-xls-form-node"

# Where to chdir at start.
CELERYD_CHDIR="/srv/onadata"

# Python interpreter from environment, if using virtualenv
ENV_PYTHON="/srv/onadata/.virtualenv/bin/python"

# How to call "manage.py celeryd_multi"
#CELERYD_MULTI="{{ venv_path }}/bin/celeryd-multi"

# How to call "manage.py celeryctl"
#CELERYCTL="$ENV_PYTHON $CELERYD_CHDIR/manage.py celeryctl"
CELERY_BIN="/srv/onadata/.virtualenv/bin/celery"
# Extra arguments to celeryd
CELERYD_OPTS="-Ofair --concurrency=4 --autscalse=4,1 -Q:default celert -Q:export-node exports -Q:publish-xls-form-node publish_xlsform"

CELERY_APP="onadata.celery"
# Name of the celery config module, don't change this.
#CELERY_CONFIG_MODULE="celeryconfig"

# %n will be replaced with the nodename.
CELERYD_LOG_FILE="/var/log/onadata/celery-%n.log"
CELERYD_PID_FILE="/run/onadata/celery-%n.pid"

# Workers should run as an unprivileged user.
CELERYD_USER="onadata"
CELERYD_GROUP="onadata"

CELERY_CREATE_DIRS=1
C_FORCE_ROOT=1
CELERYD_LOG_LEVEL="INFO"
DJANGO_SETTINGS_MODULE="onadata.settings.common"

0 comments on commit ee58546

Please sign in to comment.