Commit 693fa0da by Will Daly

Updated devstack role to include ORA

parent 9a600f3d
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
localdev_accounts: localdev_accounts:
- { user: "{{ edxapp_user}}", home: "{{ edxapp_app_dir }}" } - { user: "{{ edxapp_user}}", home: "{{ edxapp_app_dir }}" }
- { user: "{{ forum_user }}", home: "{{ forum_app_dir }}" } - { user: "{{ forum_user }}", home: "{{ forum_app_dir }}" }
- { user: "{{ ora_user }}", home: "{{ ora_app_dir }}" }
localdev_env: localdev_env:
DISPLAY: "{{ browser_xvfb_display }}" DISPLAY: "{{ browser_xvfb_display }}"
......
#! /usr/bin/env bash
# {{ ansible_managed }}
source "{{ ora_app_dir }}/ora_env"
cd {{ ora_code_dir }}
...@@ -9,6 +9,7 @@ ora_venvs_dir: "{{ ora_app_dir }}/venvs" ...@@ -9,6 +9,7 @@ ora_venvs_dir: "{{ ora_app_dir }}/venvs"
ora_venv_dir: "{{ ora_venvs_dir }}/ora" ora_venv_dir: "{{ ora_venvs_dir }}/ora"
ora_venv_bin: "{{ ora_venv_dir }}/bin" ora_venv_bin: "{{ ora_venv_dir }}/bin"
ora_user: "ora" ora_user: "ora"
ora_deploy_path: "{{ ora_venv_bin }}:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
ora_nltk_data_dir: "{{ ora_data_dir}}/nltk_data" ora_nltk_data_dir: "{{ ora_data_dir}}/nltk_data"
ora_source_repo: https://github.com/edx/edx-ora.git ora_source_repo: https://github.com/edx/edx-ora.git
...@@ -135,6 +136,12 @@ ora_auth_config: ...@@ -135,6 +136,12 @@ ora_auth_config:
AWS_ACCESS_KEY_ID: $ORA_AWS_ACCESS_KEY_ID AWS_ACCESS_KEY_ID: $ORA_AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $ORA_AWS_SECRET_ACCESS_KEY AWS_SECRET_ACCESS_KEY: $ORA_AWS_SECRET_ACCESS_KEY
ora_environment:
SERVICE_VARIANT: ora
NLTK_DATA: $ora_nltk_data_dir
LANG: $ORA_LANG
PATH: $ora_deploy_path
ora_debian_pkgs: ora_debian_pkgs:
- python-software-properties - python-software-properties
- pkg-config - pkg-config
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
supervisorctl_path={{ supervisor_ctl }} supervisorctl_path={{ supervisor_ctl }}
config={{ supervisor_cfg }} config={{ supervisor_cfg }}
state=restarted state=restarted
when: not devstack
tags: deploy tags: deploy
- name: ora | restart ora_celery - name: ora | restart ora_celery
...@@ -13,4 +14,5 @@ ...@@ -13,4 +14,5 @@
supervisorctl_path={{ supervisor_ctl }} supervisorctl_path={{ supervisor_ctl }}
config={{ supervisor_cfg }} config={{ supervisor_cfg }}
state=restarted state=restarted
when: not devstack
tags: deploy tags: deploy
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
- ora | restart ora - ora | restart ora
- ora | restart ora_celery - ora | restart ora_celery
with_items: ['ora', 'ora_celery'] with_items: ['ora', 'ora_celery']
when: not devstack
tags: tags:
- deploy - deploy
...@@ -23,6 +24,17 @@ ...@@ -23,6 +24,17 @@
tags: tags:
- deploy - deploy
- name: ora | setup the ora env
notify:
- "ora | restart ora"
- "ora | restart ora_celery"
template: >
src=ora_env.j2 dest={{ ora_app_dir }}/ora_env
owner={{ ora_user }} group={{ common_web_user }}
mode=0644
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 }}
git: dest={{ ora_code_dir }} repo={{ ora_source_repo }} version={{ ora_version }} git: dest={{ ora_code_dir }} repo={{ ora_source_repo }} version={{ ora_version }}
...@@ -94,6 +106,7 @@ ...@@ -94,6 +106,7 @@
- name: ora | update supervisor configuration - name: ora | update supervisor configuration
shell: "{{ supervisor_ctl }} -c {{ supervisor_cfg }} update" shell: "{{ supervisor_ctl }} -c {{ supervisor_cfg }} update"
register: supervisor_update register: supervisor_update
when: not devstack
changed_when: supervisor_update.stdout != "" changed_when: supervisor_update.stdout != ""
tags: deploy tags: deploy
...@@ -103,6 +116,7 @@ ...@@ -103,6 +116,7 @@
supervisorctl_path={{ supervisor_ctl }} supervisorctl_path={{ supervisor_ctl }}
config={{ supervisor_cfg }} config={{ supervisor_cfg }}
state=started state=started
when: not devstack
tags: deploy tags: deploy
- name: ora | ensure ora_celery is started - name: ora | ensure ora_celery is started
...@@ -111,4 +125,5 @@ ...@@ -111,4 +125,5 @@
supervisorctl_path={{ supervisor_ctl }} supervisorctl_path={{ supervisor_ctl }}
config={{ supervisor_cfg }} config={{ supervisor_cfg }}
state=started state=started
when: not devstack
tags: deploy tags: deploy
...@@ -56,5 +56,3 @@ ...@@ -56,5 +56,3 @@
with_items: with_items:
- python - python
- pip - pip
# {{ ansible_managed }}
{% for name,value in ora_environment.items() %}
{%- if value %}
export {{ name }}="{{ value }}"
{% endif %}
{% endfor %}
...@@ -17,5 +17,6 @@ ...@@ -17,5 +17,6 @@
- oraclejdk - oraclejdk
- elasticsearch - elasticsearch
- forum - forum
- ora
- browsers - browsers
- local_dev - local_dev
...@@ -3,11 +3,13 @@ CPU_COUNT = 2 ...@@ -3,11 +3,13 @@ CPU_COUNT = 2
edx_platform_mount_dir = "edx-platform" edx_platform_mount_dir = "edx-platform"
forum_mount_dir = "cs_comments_service" forum_mount_dir = "cs_comments_service"
ora_mount_dir = "ora"
if ENV['VAGRANT_MOUNT_BASE'] if ENV['VAGRANT_MOUNT_BASE']
edx_platform_mount_dir = ENV['VAGRANT_MOUNT_BASE'] + "/" + edx_platform_mount_dir edx_platform_mount_dir = ENV['VAGRANT_MOUNT_BASE'] + "/" + edx_platform_mount_dir
forum_mount_dir = ENV['VAGRANT_MOUNT_BASE'] + "/" + forum_mount_dir forum_mount_dir = ENV['VAGRANT_MOUNT_BASE'] + "/" + forum_mount_dir
ora_mount_dir = ENV['VAGRANT_MOUNT_BASE'] + "/" + ora_mount_dir
end end
...@@ -25,6 +27,7 @@ Vagrant.configure("2") do |config| ...@@ -25,6 +27,7 @@ Vagrant.configure("2") do |config|
config.vm.synced_folder "#{edx_platform_mount_dir}", "/edx/app/edxapp/edx-platform", :create => true, nfs: true config.vm.synced_folder "#{edx_platform_mount_dir}", "/edx/app/edxapp/edx-platform", :create => true, nfs: true
config.vm.synced_folder "#{forum_mount_dir}", "/edx/app/forum/cs_comments_service", :create => true, nfs: true config.vm.synced_folder "#{forum_mount_dir}", "/edx/app/forum/cs_comments_service", :create => true, nfs: true
config.vm.synced_folder "#{ora_mount_dir}", "/edx/app/ora/ora", :create => true, nfs: true
config.hostsupdater.aliases = ["preview.localhost"] config.hostsupdater.aliases = ["preview.localhost"]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment