Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
configuration
Commits
e0293ffb
Commit
e0293ffb
authored
Oct 31, 2013
by
Xavier Antoviaque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
supervisor-ora: Move ora from upstart to supervisord
parent
5b627096
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
44 deletions
+33
-44
playbooks/roles/ora/defaults/main.yml
+1
-1
playbooks/roles/ora/tasks/deploy.yml
+17
-8
playbooks/roles/ora/templates/ora.conf.j2
+8
-22
playbooks/roles/ora/templates/ora_celery.conf.j2
+7
-13
No files found.
playbooks/roles/ora/defaults/main.yml
View file @
e0293ffb
...
@@ -55,7 +55,7 @@ ORA_USERS:
...
@@ -55,7 +55,7 @@ ORA_USERS:
ORA_XQUEUE_URL
:
"
http://localhost:18040"
ORA_XQUEUE_URL
:
"
http://localhost:18040"
ORA_DJANGO_USER
NAME
:
"
lms"
ORA_DJANGO_USER
:
"
lms"
ORA_DJANGO_PASSWORD
:
"
password"
ORA_DJANGO_PASSWORD
:
"
password"
ORA_URL
:
"
http://localhost:18060"
ORA_URL
:
"
http://localhost:18060"
...
...
playbooks/roles/ora/tasks/deploy.yml
View file @
e0293ffb
...
@@ -13,14 +13,22 @@
...
@@ -13,14 +13,22 @@
# Stop ora service.
# Stop ora service.
-
name
:
ora | stop ora service
-
name
:
ora | stop ora service
service
:
name=edx-ora state=stopped
supervisorctl
:
>
name=ora
supervisorctl_path={{ supervisor_ctl }}
config={{ supervisor_cfg }}
state=stopped
when
:
ora_installed.stdout == 'Found'
when
:
ora_installed.stdout == 'Found'
notify
:
ora | restart ora
notify
:
ora | restart ora
tags
:
tags
:
-
deploy
-
deploy
-
name
:
ora | stop ora_celery service
-
name
:
ora | stop ora_celery service
service
:
name=ora_celery state=stopped
supervisorctl
:
>
name=ora_celery
supervisorctl_path={{ supervisor_ctl }}
config={{ supervisor_cfg }}
state=stopped
when
:
ora_celery_installed.stdout == 'Found'
when
:
ora_celery_installed.stdout == 'Found'
notify
:
ora | restart ora_celery
notify
:
ora | restart ora_celery
tags
:
tags
:
...
@@ -40,15 +48,16 @@
...
@@ -40,15 +48,16 @@
tags
:
tags
:
-
deploy
-
deploy
-
name
:
ora | create ora upstart script
-
name
:
ora | create supervisor scripts - ora, ora_celery
template
:
src=ora.conf.j2 dest=/etc/init/ora.conf
template
:
>
src={{ item }}.conf.j2 dest={{ supervisor_cfg_dir }}/{{ item }}.conf
owner={{ supervisor_user }} group={{ common_web_user }} mode=0644
with_items
:
[
'
ora'
,
'
ora_celery'
]
tags
:
tags
:
-
deploy
-
deploy
-
name
:
ora | create ora_celery upstart script
-
name
:
ora | reload supervisor to allow to start the new services
template
:
src=ora_celery.conf.j2 dest=/etc/init/ora_celery.conf
shell
:
"
{{
supervisor_ctl
}}
-c
{{
supervisor_cfg
}}
reload"
tags
:
-
deploy
# Do A Checkout
# Do A Checkout
-
name
:
ora | git checkout ora repo into {{ ora_app_dir }}
-
name
:
ora | git checkout ora repo into {{ ora_app_dir }}
...
...
playbooks/roles/ora/templates/ora.conf.j2
View file @
e0293ffb
# /etc/init/edx-ora.conf
[program:ora]
description "edX ORA server"
command={{ ora_venv_bin }}/gunicorn --preload -b {{ ora_gunicorn_host }}:{{ ora_gunicorn_port }} -w {{ ora_gunicorn_workers }} --timeout=90 --pythonpath={{ ora_code_dir}} edx_ora.wsgi
author "edx <info@edx.org>"
start on runlevel [2345]
user={{ common_web_user }}
stop on runlevel [!2345]
directory={{ ora_code_dir }}
respawn
# TODO: Make LANG a configuration variable
respawn limit 3 30
environment=PID=/var/run/gunicorn/edx-ora.pid,WORKERS={{ ora_gunicorn_workers }},PORT={{ ora_gunicorn_port }},ADDRESS={{ ora_gunicorn_host }},LANG=en_US.UTF-8,DJANGO_SETTINGS_MODULE=edx_ora.aws,SERVICE_VARIANT=ora,NLTK_DATA={{ ora_nltk_data_dir }}
env PID=/var/run/gunicorn/edx-ora.pid
stdout_logfile={{ supervisor_log_dir }}/%(program_name)-stdout.log
env WORKERS={{ ora_gunicorn_workers }}
stderr_logfile={{ supervisor_log_dir }}/%(program_name)-stderr.log
env PORT={{ ora_gunicorn_port }}
env ADDRESS={{ ora_gunicorn_host }}
env LANG=en_US.UTF-8
env DJANGO_SETTINGS_MODULE=edx_ora.aws
env SERVICE_VARIANT=ora
env NLTK_DATA={{ ora_nltk_data_dir }}
pre-start script
end script
chdir {{ ora_code_dir }}
setuid {{ ora_user }}
exec {{ ora_venv_dir}}/bin/gunicorn --preload -b $ADDRESS:$PORT -w $WORKERS --timeout=90 --pythonpath={{ ora_code_dir}} edx_ora.wsgi
playbooks/roles/ora/templates/ora_celery.conf.j2
View file @
e0293ffb
#Celery task for edx-ora
[program:ora_celery]
description "Celery grading controller"
command={{ ora_venv_bin }}/python {{ ora_code_dir }}/manage.py celeryd --loglevel=info --settings=edx_ora.aws --pythonpath={{ ora_code_dir }} -B --autoscale=4,1
author "Vik Paruchuri <vik@edx.org>"
start on runlevel [2345]
user={{ common_web_user }}
stop on runlevel [!2345]
directory={{ ora_code_dir }}
respawn
environment=DJANGO_SETTINGS_MODULE=edx_ora.aws,SERVICE_VARIANT=ora
respawn limit 3 30
env DJANGO_SETTINGS_MODULE=edx_ora.aws
stdout_logfile={{ supervisor_log_dir }}/%(program_name)-stdout.log
env SERVICE_VARIANT=ora
stderr_logfile={{ supervisor_log_dir }}/%(program_name)-stderr.log
chdir {{ ora_code_dir }}
setuid {{ ora_user }}
exec {{ ora_venv_dir }}/bin/python {{ ora_code_dir }}/manage.py celeryd --loglevel=info --settings=edx_ora.aws --pythonpath={{ ora_code_dir}} -B --autoscale=4,1
Write
Preview
Markdown
is supported
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