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
OpenEdx
configuration
Commits
93b21d05
Commit
93b21d05
authored
Sep 19, 2013
by
Feanil Patel
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #234 from antoviaque/sandbox-ora
sandbox-ora: Include xqueue & ORA on the `edx_sandbox` playbook
parents
132dcb26
c14c8454
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
60 additions
and
53 deletions
+60
-53
playbooks/edx_sandbox.yml
+11
-1
playbooks/roles/edxapp/vars/main.yml
+2
-2
playbooks/roles/ora/tasks/deploy.yml
+3
-3
playbooks/roles/ora/tasks/ease.yml
+1
-1
playbooks/roles/ora/tasks/main.yml
+3
-18
playbooks/roles/ora/templates/edx-ora-celery.conf.j2
+2
-1
playbooks/roles/ora/templates/edx-ora.conf.j2
+2
-1
playbooks/roles/ora/vars/main.yml
+4
-2
playbooks/roles/rabbitmq/templates/rabbitmq-env.conf.j2
+1
-1
playbooks/roles/rabbitmq/vars/main.yml
+5
-3
playbooks/roles/xqueue/tasks/deploy.yml
+8
-8
playbooks/roles/xqueue/tasks/main.yml
+3
-7
playbooks/roles/xqueue/templates/xqueue.conf.j2
+7
-3
playbooks/roles/xqueue/templates/xqueue_consumer.conf.j2
+3
-2
playbooks/roles/xqueue/vars/main.yml
+5
-0
No files found.
playbooks/edx_sandbox.yml
View file @
93b21d05
...
...
@@ -26,7 +26,7 @@
-
nginx
-
edxlocal
-
edxapp
-
rabbitmq
-
{
role
:
'
rabbitmq'
,
rabbitmq_ip
:
'
127.0.0.1'
}
-
{
role
:
'
edxapp'
,
celery_worker
:
True
}
-
oraclejdk
-
elasticsearch
...
...
@@ -35,3 +35,13 @@
rbenv_user_home
:
"
{{
forum_home
}}"
rbenv_ruby_version
:
"
{{
forum_ruby_version
}}"
-
forum
-
role
:
virtualenv
virtualenv_user
:
"
{{
xqueue_user
}}"
virtualenv_user_home
:
"
{{
xqueue_user_home
}}"
virtualenv_name
:
"
{{
xqueue_user
}}"
-
{
role
:
"
xqueue"
,
update_users
:
True
}
-
role
:
virtualenv
virtualenv_user
:
"
{{
ora_user
}}"
virtualenv_user_home
:
"
{{
ora_user_home
}}"
virtualenv_name
:
"
{{
ora_user
}}"
-
role
:
ora
playbooks/roles/edxapp/vars/main.yml
View file @
93b21d05
...
...
@@ -23,7 +23,7 @@ edxapp_generic_auth_config: &edxapp_generic_auth
'
basic_auth'
:
[
'
edx'
,
'
edx'
]
'
django_auth'
:
{
'
password'
:
'
password'
,
'
username'
:
'
lms'
}
'
url'
:
'
http
s
://localhost:18040'
'
url'
:
'
http://localhost:18040'
'
CONTENTSTORE'
:
'
ENGINE'
:
'
xmodule.contentstore.mongo.MongoContentStore'
'
OPTIONS'
:
...
...
@@ -59,7 +59,7 @@ edxapp_generic_auth_config: &edxapp_generic_auth
'
PORT'
:
'
3306'
'
PEARSON_TEST_PASSWORD'
:
'
'
'
OPEN_ENDED_GRADING_INTERFACE'
:
'
url'
:
'
http://localhost:18091'
'
url'
:
'
http://localhost:18091
/
'
'
password'
:
'
password'
'
peer_grading'
:
'
peer_grading'
'
staff_grading'
:
'
staff_grading'
...
...
playbooks/roles/ora/tasks/deploy.yml
View file @
93b21d05
...
...
@@ -41,7 +41,7 @@
# Do Post Checkout Tasks.
-
name
:
ora | change permissions on ora code dir
file
:
path={{ora_code_dir}} state=directory owner=
www-data group=www-data
mode=755 recurse=yes
file
:
path={{ora_code_dir}} state=directory owner=
{{ ora_user }} group={{ ora_user }}
mode=755 recurse=yes
notify
:
-
ora | restart edx-ora
-
ora | restart edx-ora-celery
...
...
@@ -85,7 +85,7 @@
-
deploy
-
name
:
ora | syncdb and migrate
shell
:
sudo -u
www-dat
a {{ora_venv_dir}}/bin/django-admin.py syncdb --migrate --noinput --settings=edx_ora.aws --pythonpath={{ora_code_dir}}
shell
:
sudo -u
{{ ora_user }} SERVICE_VARIANT=or
a {{ora_venv_dir}}/bin/django-admin.py syncdb --migrate --noinput --settings=edx_ora.aws --pythonpath={{ora_code_dir}}
when
:
migrate_db is defined and migrate_db|lower == "yes"
notify
:
-
ora | restart edx-ora
...
...
@@ -96,7 +96,7 @@
-
deploy
-
name
:
ora | create users
shell
:
sudo -u
www-dat
a {{ora_venv_dir}}/bin/django-admin.py update_users --settings=edx_ora.aws --pythonpath={{ora_code_dir}}
shell
:
sudo -u
{{ ora_user }} SERVICE_VARIANT=or
a {{ora_venv_dir}}/bin/django-admin.py update_users --settings=edx_ora.aws --pythonpath={{ora_code_dir}}
notify
:
-
ora | restart edx-ora
-
ora | restart edx-ora-celery
...
...
playbooks/roles/ora/tasks/ease.yml
View file @
93b21d05
...
...
@@ -37,7 +37,7 @@
# Do Post Checkout Tasks.
-
name
:
ora | change permissions on ease code dir
file
:
path={{ease_code_dir}} state=directory owner=
www-data group=www-data
mode=755 recurse=yes
file
:
path={{ease_code_dir}} state=directory owner=
{{ ora_user }} group={{ ora_user }}
mode=755 recurse=yes
tags
:
-
ease
-
deploy
...
...
playbooks/roles/ora/tasks/main.yml
View file @
93b21d05
...
...
@@ -3,13 +3,8 @@
# - common/tasks/main.yml
# - nginx/tasks/main.yml
---
-
name
:
ora | Change permissions on datadir
file
:
path={{ora_code_dir}}/../data state=directory owner=www-data group=www-data
tags
:
-
ora
-
name
:
ora | Create ml_models directory
file
:
path={{ora_code_dir}}/../ml_models state=directory owner=
www-data group=www-data
file
:
path={{ora_code_dir}}/../ml_models state=directory owner=
{{ ora_user }} group={{ ora_user }}
tags
:
-
ora
...
...
@@ -20,12 +15,12 @@
-
ora
-
name
:
ora | create ora application config
template
:
src=ora.env.json.j2 dest={{ora_code_dir}}/../
env.json mode=0640 owner=www-data
group=adm
template
:
src=ora.env.json.j2 dest={{ora_code_dir}}/../
ora.env.json mode=0640 owner={{ ora_user }}
group=adm
tags
:
-
ora
-
name
:
ora | create ora auth file
template
:
src=ora.auth.json.j2 dest={{ora_code_dir}}/../
auth.json mode=0640 owner=www-data
group=adm
template
:
src=ora.auth.json.j2 dest={{ora_code_dir}}/../
ora.auth.json mode=0640 owner={{ ora_user }}
group=adm
tags
:
-
ora
...
...
@@ -45,16 +40,6 @@
tags
:
-
ora
-
name
:
ora | create the ora virtual environment
file
:
path={{ ora_venv_dir }} owner=root group=adm mode=2775 state=directory
tags
:
-
ora
-
name
:
ora | bootstrap the ora virtual environment
command
:
/usr/local/bin/virtualenv {{ ora_venv_dir }} --distribute creates={{ora_venv_dir}}/bin/activate
tags
:
-
ora
# Install nginx site
-
include
:
../../nginx/tasks/nginx_site.yml state=link site_name=ora
...
...
playbooks/roles/ora/templates/edx-ora-celery.conf.j2
View file @
93b21d05
...
...
@@ -10,8 +10,9 @@ respawn
respawn limit 3 30
env DJANGO_SETTINGS_MODULE=edx_ora.aws
env SERVICE_VARIANT=ora
chdir {{ ora_code_dir }}
setuid
www-data
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
playbooks/roles/ora/templates/edx-ora.conf.j2
View file @
93b21d05
...
...
@@ -14,11 +14,12 @@ env WORKERS={{ ora_gunicorn_workers }}
env PORT={{ ora_gunicorn_port }}
env LANG=en_US.UTF-8
env DJANGO_SETTINGS_MODULE=edx_ora.aws
env SERVICE_VARIANT=ora
pre-start script
end script
chdir {{ ora_code_dir }}
setuid
www-data
setuid
{{ ora_user }}
exec {{ ora_venv_dir}}/bin/gunicorn --preload -b 127.0.0.1:$PORT -w $WORKERS --timeout=90 --pythonpath={{ ora_code_dir}} edx_ora.wsgi
playbooks/roles/ora/vars/main.yml
View file @
93b21d05
...
...
@@ -4,8 +4,10 @@ ora_code_dir: "{{ app_base_dir }}/edx-ora"
# Default nginx listen port
# These should be overrided if you want
# to serve all content on port 80
ora_venv_dir
:
"
{{
venv_dir
}}"
ease_venv_dir
:
"
{{
venv_dir
}}"
ora_user
:
"
edx-ora"
ora_user_home
:
"
/opt/edx-ora"
ora_venv_dir
:
"
{{
ora_user_home
}}/virtualenvs/{{
ora_user
}}"
ease_venv_dir
:
"
{{
ora_venv_dir
}}"
ora_gunicorn_workers
:
4
ora_nginx_port
:
18091
ora_gunicorn_port
:
8091
...
...
playbooks/roles/rabbitmq/templates/rabbitmq-env.conf.j2
View file @
93b21d05
RABBITMQ_NODE_PORT={{ rabbitmq_port }}
RABBITMQ_NODE_IP_ADDRESS={{
ansible_default_ipv4.address
}}
RABBITMQ_NODE_IP_ADDRESS={{
rabbitmq_ip
}}
playbooks/roles/rabbitmq/vars/main.yml
View file @
93b21d05
...
...
@@ -14,12 +14,15 @@ rabbitmq_mnesia_folder: "{{rabbitmq_cookie_dir}}/mnesia"
rabbitmq_port
:
5672
rabbitmq_management_port
:
15672
rabbitmq_ip
:
"
{{
ansible_default_ipv4.address
}}"
rabbitmq_auth_config
:
erlang_cookie
:
"
CHANGE
ME"
admin
:
admin
s
:
-
name
:
'
admin'
password
:
'
the
example
admin
password'
-
name
:
'
edx'
password
:
'
edx'
# If the system is running out of an Amazon Web Services
# cloudformation stack, this group name can used to pull out
...
...
@@ -29,4 +32,4 @@ rabbitmq_aws_stack_name: "tag_aws_cloudformation_stack-name_"
rabbitmq_clustered_hosts
:
[]
rabbitmq_plugins
:
-
rabbitmq_management
\ No newline at end of file
-
rabbitmq_management
playbooks/roles/xqueue/tasks/deploy.yml
View file @
93b21d05
...
...
@@ -20,7 +20,7 @@
# Do Post Checkout Tasks.
-
name
:
xqueue | create xqueue code dir
file
:
path={{xqueue_code_dir}} state=directory owner=
www-data group=www-data
mode=755
file
:
path={{xqueue_code_dir}} state=directory owner=
{{ xqueue_user }} group={{ xqueue_user }}
mode=755
tags
:
-
xqueue
-
deploy
...
...
@@ -30,29 +30,29 @@
# portions of the deploy needs to be incorporated here.
-
name
:
xqueue | sets permissions on xqueue code dir and contents
file
:
path={{xqueue_code_dir}} state=directory owner=
www-data group=www-data
recurse=yes
file
:
path={{xqueue_code_dir}} state=directory owner=
{{ xqueue_user }} group={{ xqueue_user }}
recurse=yes
# Post Checkout tasks will get run as handlers when the {{ xqueue_code_dir }} is ready.
# Look at the handlers/main.yml in this role for a description of the tasks stated below.
tags
:
-
xqueue
-
deploy
# Install the python pre requirements into {{ venv_dir }}
# Install the python pre requirements into {{
xqueue_
venv_dir }}
-
name
:
install python pre-requirements
pip
:
requirements="{{xqueue_pre_requirements_file}}" virtualenv="{{venv_dir}}" state=present
pip
:
requirements="{{xqueue_pre_requirements_file}}" virtualenv="{{
xqueue_
venv_dir}}" state=present
tags
:
-
xqueue
-
deploy
# Install the python post requirements into {{ venv_dir }}
# Install the python post requirements into {{
xqueue_
venv_dir }}
-
name
:
install python post-requirements
pip
:
requirements="{{xqueue_post_requirements_file}}" virtualenv="{{venv_dir}}" state=present
pip
:
requirements="{{xqueue_post_requirements_file}}" virtualenv="{{
xqueue_
venv_dir}}" state=present
tags
:
-
xqueue
-
deploy
-
name
:
xqueue | syncdb and migrate
shell
:
sudo -u
www-data /opt/edx
/bin/django-admin.py syncdb --migrate --noinput --settings=xqueue.aws_settings --pythonpath=/opt/wwc/xqueue
shell
:
sudo -u
{{ xqueue_user }} SERVICE_VARIANT=xqueue {{ xqueue_venv_dir }}
/bin/django-admin.py syncdb --migrate --noinput --settings=xqueue.aws_settings --pythonpath=/opt/wwc/xqueue
when
:
migrate_db is defined and migrate_db|lower == "yes"
tags
:
-
xqueue
...
...
@@ -60,7 +60,7 @@
-
deploy
-
name
:
xqueue | create users
shell
:
sudo -u
www-data /opt/edx
/bin/django-admin.py update_users --settings=xqueue.aws_settings --pythonpath=/opt/wwc/xqueue
shell
:
sudo -u
{{ xqueue_user }} SERVICE_VARIANT=xqueue {{ xqueue_venv_dir }}
/bin/django-admin.py update_users --settings=xqueue.aws_settings --pythonpath=/opt/wwc/xqueue
when
:
update_users is defined
tags
:
-
xqueue
...
...
playbooks/roles/xqueue/tasks/main.yml
View file @
93b21d05
...
...
@@ -3,11 +3,6 @@
# - common/tasks/main.yml
# - nginx/tasks/main.yml
---
-
name
:
xqueue | Change permissions on datadir
file
:
path={{app_base_dir}}/data state=directory owner=www-data group=www-data
tags
:
-
xqueue
# Check out xqueue repo to {{xqueue_code_dir}}
-
name
:
xqueue | install git and its recommends
apt
:
pkg=git state=present install_recommends=yes
...
...
@@ -30,9 +25,10 @@
login_password={{xqueue_auth_config.DATABASES.default.PASSWORD}}
state=present
encoding=utf8
when
:
xqueue_create_db is defined and xqueue_create_db|lower == "yes"
-
name
:
xqueue | create xqueue application config
template
:
src=xqueue.env.json.j2 dest={{app_base_dir}}/
env.json mode=0640 owner=www-data
group=adm
template
:
src=xqueue.env.json.j2 dest={{app_base_dir}}/
xqueue.env.json mode=0640 owner={{ xqueue_user }}
group=adm
notify
:
-
xqueue | restart xqueue
-
xqueue | restart xqueue consumer
...
...
@@ -40,7 +36,7 @@
-
xqueue
-
name
:
xqueue | create xqueue auth file
template
:
src=xqueue.auth.json.j2 dest={{app_base_dir}}/
auth.json mode=0640 owner=www-data
group=adm
template
:
src=xqueue.auth.json.j2 dest={{app_base_dir}}/
xqueue.auth.json mode=0640 owner={{ xqueue_user }}
group=adm
notify
:
-
xqueue | restart xqueue
-
xqueue | restart xqueue consumer
...
...
playbooks/roles/xqueue/templates/xqueue.conf.j2
View file @
93b21d05
...
...
@@ -7,7 +7,11 @@ respawn
respawn limit 3 30
env PID=/var/tmp/xqueue.pid
env WORKERS={{ ansible_processor_cores * 2 }}
{% if ansible_processor|length > 0 %}
env WORKERS={{ ansible_processor|length * 2 }}
{% else %}
env WORKERS=2
{% endif %}
env PORT={{ xqueue_gunicorn_port }}
env LANG=en_US.UTF-8
env DJANGO_SETTINGS_MODULE=xqueue.aws_settings
...
...
@@ -15,6 +19,6 @@ env SERVICE_VARIANT="xqueue"
chdir {{ xqueue_code_dir }}
setuid
www-data
setuid
{{ xqueue_user }}
exec {{ venv_dir }}/bin/gunicorn --preload -b 127.0.0.1:$PORT -w $WORKERS --timeout=300 --pythonpath={{ xqueue_code_dir }} xqueue.wsgi
exec {{
xqueue_
venv_dir }}/bin/gunicorn --preload -b 127.0.0.1:$PORT -w $WORKERS --timeout=300 --pythonpath={{ xqueue_code_dir }} xqueue.wsgi
playbooks/roles/xqueue/templates/xqueue_consumer.conf.j2
View file @
93b21d05
...
...
@@ -11,7 +11,8 @@ respawn limit 3 30
env LANG=en_US.UTF-8
env WORKERS_PER_QUEUE={{xqueue_env_config.XQUEUE_WORKERS_PER_QUEUE}}
env SERVICE_VARIANT="xqueue"
chdir {{xqueue_code_dir}}
setuid
www-data
setuid
{{ xqueue_user }}
exec {{venv_dir}}/bin/django-admin.py run_consumer --pythonpath={{xqueue_code_dir}} --settings=xqueue.aws_settings $WORKERS_PER_QUEUE
exec {{
xqueue_
venv_dir}}/bin/django-admin.py run_consumer --pythonpath={{xqueue_code_dir}} --settings=xqueue.aws_settings $WORKERS_PER_QUEUE
playbooks/roles/xqueue/vars/main.yml
View file @
93b21d05
...
...
@@ -10,6 +10,10 @@ xqueue_code_dir: "{{ app_base_dir }}/xqueue"
xqueue_nginx_port
:
18040
xqueue_gunicorn_port
:
8040
xqueue_user
:
"
xqueue"
xqueue_user_home
:
"
/opt/xqueue"
xqueue_venv_dir
:
"
{{
xqueue_user_home
}}/virtualenvs/{{
xqueue_user
}}"
xqueue_env_config
:
'
XQUEUES'
:
# push queue
...
...
@@ -35,6 +39,7 @@ xqueue_auth_config:
'
DATABASES'
:
'
default'
:
{
'
ENGINE'
:
'
django.db.backends.mysql'
,
'
NAME'
:
'
xqueue'
,
'
USER'
:
'
root'
,
'
PASSWORD'
:
'
'
,
'
HOST'
:
'
localhost'
,
'
PORT'
:
'
3306'
}
xqueue_create_db
:
'
yes'
xqueue_source_repo
:
https://github.com/edx/xqueue.git
xqueue_version
:
'
HEAD'
xqueue_pre_requirements_file
:
"
{{
xqueue_code_dir
}}/pre-requirements.txt"
...
...
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