Commit 47f5ef03 by Matjaz Gregoric

Let edxapp role conditionally install openstack requirements.

Based on the value of COMMON_ENABLE_OPENSTACK_INTEGRATION.

Installing requirements from the openstack role created role ordering
issues where openstack role had to run after the edxapp role so that the
required folders and the virtual environment are already created, BUT
edxapp migrations can also depend on the default file storage, which
will fail when using openstack storage if openstack requirements haven't
been installed yet.

Letting edxapp role install the requirements solves this problem.
parent 1b3a9ef7
......@@ -1126,6 +1126,7 @@ base_requirements_file: "{{ edxapp_code_dir }}/requirements/edx/base.txt"
post_requirements_file: "{{ edxapp_code_dir }}/requirements/edx/post.txt"
paver_requirements_file: "{{ edxapp_code_dir }}/requirements/edx/paver.txt"
private_requirements_file: "{{ edxapp_code_dir }}/requirements/edx/edx-private.txt"
openstack_requirements_file: "{{ edxapp_code_dir }}/requirements/edx/openstack.txt"
sandbox_base_requirements: "{{ edxapp_code_dir }}/requirements/edx-sandbox/base.txt"
sandbox_local_requirements: "{{ edxapp_code_dir }}/requirements/edx-sandbox/local.txt"
......@@ -1136,6 +1137,8 @@ sandbox_post_requirements: "{{ edxapp_code_dir }}/requirements/edx-sandbox/post
# edx-solutions fork of edx-platform when if you consider reordering this list.)
# private_requirements_file is not included in this list, since it is only installed
# conditionally based on the value of EDXAPP_INSTALL_PRIVATE_REQUIREMENTS.
# openstack_requirements_file is not included in this list, because it is only installed
# conditionally based on the value of COMMON_ENABLE_OPENSTACK_INTEGRATION.
edxapp_requirements_files:
- "{{ pre_requirements_file }}"
- "{{ github_requirements_file }}"
......@@ -1156,6 +1159,7 @@ edxapp_requirements_with_github_urls:
- "{{ post_requirements_file }}"
- "{{ paver_requirements_file }}"
- "{{ private_requirements_file }}"
- "{{ openstack_requirements_file }}"
- "{{ sandbox_post_requirements }}"
- "{{ sandbox_local_requirements }}"
- "{{ sandbox_base_requirements }}"
......
......@@ -164,6 +164,21 @@
- install
- install:app-requirements
# Conditinally install openstack requirements.
- name: install python private requirements
shell: "{{ edxapp_venv_dir }}/bin/pip install {{ COMMON_PIP_VERBOSITY }} -i {{ COMMON_PYPI_MIRROR_URL }} --exists-action w -r {{ item }}"
args:
chdir: "{{ edxapp_code_dir }}"
with_items:
- "{{ openstack_requirements_file }}"
become_user: "{{ edxapp_user }}"
environment:
GIT_SSH: "{{ edxapp_git_ssh }}"
when: COMMON_ENABLE_OPENSTACK_INTEGRATION
tags:
- install
- install:app-requirements
# Install any custom extra requirements if defined in EDXAPP_EXTRA_REQUIREMENTS.
- name: install python extra requirements
pip:
......
......@@ -33,8 +33,6 @@ openstack_dirs:
group: "syslog"
mode: "0650"
openstack_requirements_file: "{{ edxapp_code_dir }}/requirements/edx/openstack.txt"
openstack_log_sync_script: "{{ openstack_dirs.home.path }}/send-logs-to-swift"
openstack_log_sync_script_environment: "{{ openstack_dirs.home.path }}/log-sync-env.sh"
openstack_swift_logfile: "{{ openstack_dirs.logs.path }}/log-sync.log"
......
......@@ -58,18 +58,3 @@
src: "{{ openstack_log_sync_script }}"
dest: "{{ COMMON_SWIFT_LOG_SYNC_SCRIPT }}"
when: COMMON_SWIFT_LOG_SYNC
# Install openstack python requirements into {{ edxapp_venv_dir }}
- name : Install python requirements
# Need to use command rather than pip so that we can maintain the context of our current working directory;
# some requirements are pathed relative to the edx-platform repo.
# Using the pip from inside the virtual environment implicitly installs everything into that virtual environment.
command: "{{ edxapp_venv_dir }}/bin/pip install {{ COMMON_PIP_VERBOSITY }} -i {{ COMMON_PYPI_MIRROR_URL }} --exists-action w -r {{ openstack_requirements_file }}"
args:
chdir: "{{ edxapp_code_dir }}"
sudo_user: "{{ edxapp_user }}"
environment: "{{ edxapp_environment }}"
when: edxapp_code_dir is defined
tags:
- install
- install:app-requirements
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