Commit 6da9f55e by Jason Bau

Merge pull request #74 from edx/jbau/fix/new-requirements-files

Jbau/fix/new requirements files
parents 94250149 a9e91437
......@@ -3,6 +3,7 @@ app_base_dir: /opt/wwc
log_base_dir: /mnt/logs
venv_dir: /opt/edx
platform_code_dir: $app_base_dir/edx-platform
os_name: ubuntu
# these pathes are relative to the playbook dir
# directory for secret settings (keys, etc)
......
......@@ -18,10 +18,10 @@ env LANG=en_US.UTF-8
env DJANGO_SETTINGS_MODULE=lms.envs.aws
env SERVICE_VARIANT="lms-preview"
chdir ${app_base_dir}/mitx
chdir {{platform_code_dir}}
setuid www-data
exec ${venv_dir}/bin/gunicorn --preload -b 127.0.0.1:$PORT -w $WORKERS --timeout=300 --pythonpath=${app_base_dir}/mitx lms.wsgi
exec ${venv_dir}/bin/gunicorn --preload -b 127.0.0.1:$PORT -w $WORKERS --timeout=300 --pythonpath={{platform_code_dir}} lms.wsgi
post-start script
while true
......
......@@ -76,7 +76,7 @@
## Install the debian package requirements system-wide
- name: store remote apt_repos list for ansible use
command: cat {{platform_code_dir}}/apt-repos.txt
command: cat {{ apt_sources_file }}
register: apt_repos_list
tags:
- lms
......@@ -103,7 +103,7 @@
- install
- name: store remote apt_packages list for ansible use
command: cat {{platform_code_dir}}/apt-packages.txt
command: cat {{ apt_packages_file }}
register: apt_packages_list
tags:
- lms
......@@ -118,25 +118,42 @@
- cms
- install
# Install the python requirements into $venv_dir
- name : install python pre-requirements
pip: requirements="{{platform_code_dir}}/pre-requirements.txt" virtualenv="{{venv_dir}}" state=present
# Install the python modules into {{ venv_dir }}
- name : install base python packages using the shell
# Need to use shell 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.
shell: cd {{ platform_code_dir }} && {{ venv_dir }}/bin/pip install --use-mirrors -r {{ base_requirements_file }}
tags:
- lms
- cms
- install
# Install the python post requirements into {{ venv_dir }}
- name : install python post-requirements
pip: requirements="{{ post_requirements_file }}" virtualenv="{{ venv_dir }}" state=present
tags:
- lms
- cms
- install
# Install the python modules into $venv_dir
- name : install python packages using the shell
#pip: requirements="{{platform_code_dir}}/requirements.txt" virtualenv="{{venv_dir}}"
# Install the final python modules into {{ venv_dir }}
- name : install python post-post requirements using the shell
# Need to use shell 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.
shell: cd {{platform_code_dir}} && {{venv_dir}}/bin/pip install --use-mirrors -r {{platform_code_dir}}/requirements.txt
shell: cd {{ platform_code_dir }} && {{ venv_dir }}/bin/pip install --use-mirrors -r {{ item }}
with_items:
- "{{ repo_requirements_file }}"
- "{{ github_requirements_file }}"
- "{{ local_requirements_file }}"
tags:
- lms
- cms
- install
# Creates LMS upstart file
- include: ../../gunicorn/tasks/upstart.yml service_variant=lms
......@@ -4,6 +4,16 @@
lms_auth_config: {}
lms_env_config: {}
lms_source_repo: git@github.com:edx/edx-platform.git
apt_sources_file: "{{ platform_code_dir }}/requirements/system/{{os_name}}/apt-repos.txt"
apt_packages_file: "{{ platform_code_dir }}/requirements/system/{{os_name}}/apt-packages.txt"
local_requirements_file: "{{ platform_code_dir }}/requirements/local.txt"
post_requirements_file: "{{ platform_code_dir }}/requirements/post.txt"
base_requirements_file: "{{ platform_code_dir }}/requirements/base.txt"
github_requirements_file: "{{ platform_code_dir }}/requirements/github.txt"
repo_requirements_file: "{{ platform_code_dir }}/requirements/repo.txt"
lms_debian_pkgs:
- apparmor-utils
- aspell
......
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