Commit 95743a82 by Jason Bau

one full run through the stage-app playbook

parent 678809bb
......@@ -108,7 +108,7 @@ EDXAPP_MKTG_URL_LINK_MAP: {}
# whether to setup the python sandbox or not
EDXAPP_PYTHON_SANDBOX: false
EDXAPP_SANDBOX_VENV_DIR: '/opt/edx-sandbox'
EDXAPP_SANDBOX_VENV_DIR: '{{ edxapp_venvs_dir }}/edxapp-sandbox'
EDXAPP_SANDBOX_USER: 'sandbox'
EDXAPP_SANDBOX_GROUP: 'sandbox'
# this next setting, if true, turns on actual sandbox enforcement. If not true,
......
......@@ -205,9 +205,9 @@
- name: Install sandbox requirements into sandbox venv
shell: >
cd {{ edxapp_app_dir }} &&
{{ EDXAPP_SANDBOX_VENV_DIR }}/bin/pip install -i {{ COMMON_PYPI_MIRROR_URL }} --exists-action w --use-mirrors
--upgrade --no-deps -r {{ item }}
cd {{ edxapp_code_dir }} &&
{{ EDXAPP_SANDBOX_VENV_DIR }}/bin/pip install -i {{ edxapp_pypi_local_mirror }} --exists-action w --use-mirrors
-r {{ item }}
with_items:
- "{{ sandbox_base_requirements }}"
- "{{ sandbox_local_requirements }}"
......
......@@ -63,7 +63,7 @@
executable=/bin/bash
chdir={{ edxapp_code_dir }}
sudo_user: "{{ edxapp_user }}"
when: celery_worker is not defined
when: celery_worker is not defined and not devstack and item != "lms-preview"
with_items: service_variants_enabled
notify:
- "edxapp | restart edxapp"
......@@ -72,7 +72,6 @@
tags:
- deploy
- name: edxapp | syncdb and migrate
shell: SERVICE_VARIANT=lms {{ edxapp_venv_bin}}/django-admin.py syncdb --migrate --noinput --settings=lms.envs.aws --pythonpath={{ edxapp_code_dir }}
when: migrate_db is defined and migrate_db|lower == "yes"
......
# gunicorn
description "gunicorn server"
author "Calen Pennington <cpennington@mitx.mit.edu>"
start on started edxapp
stop on stopped edxapp
respawn
respawn limit 3 30
env PID=/var/tmp/lms.pid
[program:lms-preview]
{% if ansible_processor|length > 0 %}
env WORKERS={{ ansible_processor|length * worker_core_mult.lms_preview }}
command={{ edxapp_venv_dir }}/bin/gunicorn --preload -b {{ edxapp_lms_preview_gunicorn_host }}:{{ edxapp_lms_preview_gunicorn_port }} -w {{ ansible_processor|length * worker_core_mult.lms_preview }} --timeout=300 --pythonpath={{ edxapp_code_dir }} lms.wsgi
{% else %}
env WORKERS={{ worker_core_mult.lms_preview }}
command={{ edxapp_venv_dir }}/bin/gunicorn --preload -b {{ edxapp_lms_preview_gunicorn_host }}:{{ edxapp_lms_preview_gunicorn_port }} -w {{ worker_core_mult.lms_preview }} --timeout=300 --pythonpath={{ edxapp_code_dir }} lms.wsgi
{% endif %}
env PORT={{edxapp_lms_preview_gunicorn_port}}
env ADDRESS={{edxapp_lms_preview_gunicorn_host}}
env LANG=en_US.UTF-8
env DJANGO_SETTINGS_MODULE=lms.envs.aws
env SERVICE_VARIANT="lms-preview"
chdir {{edxapp_code_dir}}
setuid www-data
exec {{edxapp_venv_dir}}/bin/gunicorn --preload -b $ADDRESS:$PORT -w $WORKERS --timeout=300 --pythonpath={{edxapp_code_dir}} lms.wsgi
post-start script
while true
do
if $(curl -s -i localhost:$PORT/heartbeat | egrep -q '200 OK'); then
break;
else
sleep 1;
fi
done
end script
user={{ common_web_user }}
directory={{ edxapp_code_dir }}
environment=PORT={{edxapp_lms_preview_gunicorn_port}},ADDRESS={{edxapp_lms_preview_gunicorn_host}},LANG={{ EDXAPP_LANG }},DJANGO_SETTINGS_MODULE={{ edxapp_lms_env }},SERVICE_VARIANT="lms-preview"
stdout_logfile={{ supervisor_log_dir }}/%(program_name)-stdout.log
stderr_logfile={{ supervisor_log_dir }}/%(program_name)-stderr.log
killasgroup=true
stopasgroup=true
......@@ -49,7 +49,7 @@
notify: nginx | reload nginx
- name: nginx | Copying nginx configs for {{ nginx_sites }}
template: src={{nginx_template_directory}}{{ item }}.j2 dest=/etc/nginx/sites-available/{{ item }} owner=root group=root mode=0600
template: src={{ nginx_template_directory }}{{ item }}.j2 dest={{ nginx_sites_available_dir }}/{{ item }} owner=root group=root mode=0600
notify: nginx | reload nginx
with_items: nginx_sites
......
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