Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
iPPIDB
ippidb-web
Commits
4b3c5074
Commit
4b3c5074
authored
Jan 13, 2020
by
Hervé MENAGER
Browse files
deploy celery with ansible, WIP
WIP on #174 and #175
parent
dbebbef7
Pipeline
#21908
passed with stage
in 8 minutes and 45 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
ansible/celery.service
0 → 100644
View file @
4b3c5074
[Unit]
Description
=
Celery Service
After
=
network.target
[Service]
Type
=
forking
User
=
jass
Group
=
nginx
EnvironmentFile
=
-/etc/default/ippidb-{{ http_port }}-celeryd
WorkingDirectory
=
/var/ippidb-{{ http_port }}
ExecStart
=
/bin/sh -c '${CELERY_BIN} multi start ${CELERYD_NODES}
\
-A ${CELERY_APP} --pidfile=${CELERYD_PID_FILE}
\
--logfile=${CELERYD_LOG_FILE} --loglevel=${CELERYD_LOG_LEVEL} ${CELERYD_OPTS}'
ExecStop
=
/bin/sh -c '${CELERY_BIN} multi stopwait ${CELERYD_NODES}
\
--pidfile=${CELERYD_PID_FILE}'
ExecReload
=
/bin/sh -c '${CELERY_BIN} multi restart ${CELERYD_NODES}
\
-A ${CELERY_APP} --pidfile=${CELERYD_PID_FILE}
\
--logfile=${CELERYD_LOG_FILE} --loglevel=${CELERYD_LOG_LEVEL} ${CELERYD_OPTS}'
[Install]
WantedBy
=
multi-user.target
ansible/celeryd
0 → 100644
View file @
4b3c5074
CELERYD_NODES="worker"
CELERY_BIN="celery"
CELERY_APP="ippisite"
CELERYD_CHDIR="/var/ippidb-{{ http_port }}-celery"
CELERYD_OPTS="--time-limit=3000 --concurrency=1 --max-tasks-per-child=1"
CELERYD_LOG_FILE="/var/ippidb-{{ http_port }}-celery/celery%N.log"
CELERYD_PID_FILE="/var/ippidb-{{ http_port }}-celery/celery%N.pid"
CELERYD_LOG_LEVEL="DEBUG"
CELERYD_USER=""
CELERYD_GROUP="nginx"
CELERY_CREATE_DIRS=1
ansible/deploy.yaml
View file @
4b3c5074
...
@@ -121,6 +121,24 @@
...
@@ -121,6 +121,24 @@
systemd
:
state=stopped name=ippidb-web
systemd
:
state=stopped name=ippidb-web
#ignore fail (i.e. when service does not exist yet)
#ignore fail (i.e. when service does not exist yet)
ignore_errors
:
yes
ignore_errors
:
yes
-
name
:
stop celery service
systemd
:
state=stopped name=celery enabled=true
ignore_errors
:
yes
#
# Set up celery service
#
-
name
:
copy celeryd configuration file
copy
:
src
:
celeryd
dest
:
/etc/default
owner
:
root
group
:
root
-
name
:
copy celery systemd service
copy
:
src
:
celery.service
dest
:
/lib/systemd/system/celery.service
owner
:
root
group
:
root
#
#
# Fetch/Update code and prep django app for publication
# Fetch/Update code and prep django app for publication
#
#
...
@@ -186,7 +204,7 @@
...
@@ -186,7 +204,7 @@
('EMAIL_ADMIN', 'hmenager@pasteur.fr'),
('EMAIL_ADMIN', 'hmenager@pasteur.fr'),
]
]
MANAGERS = [
MANAGERS = [
('EMAIL_MANAGER', '
hmenager
@pasteur.fr'),
('EMAIL_MANAGER', '
ippidb
@pasteur.fr'),
]
]
LOGGING = {
LOGGING = {
'version': 1,
'version': 1,
...
@@ -290,4 +308,9 @@
...
@@ -290,4 +308,9 @@
# Start web server
# Start web server
#
#
-
name
:
start iPPIDB service if relevant
-
name
:
start iPPIDB service if relevant
systemd
:
state=started name=ippidb{{ http_port }}-web enabled=true
systemd
:
state=started name=ippidb{{ http_port }}-web enabled=true
\ No newline at end of file
#
# Start celery service
#
-
name
:
start celery service if relevant
systemd
:
state=started name=celery enabled=true daemon_reload=true
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment