Commit e65b6661 by arbabnazar Committed by Edward Zarecor

modified the course_discovery instances inside all templates

parent 0b0ca78a
......@@ -8,7 +8,7 @@
# license: https://github.com/edx/configuration/blob/master/LICENSE.TXT
#
##
# Role includes for role course_discovery
# Role includes for role discovery
#
# Example:
#
......
......@@ -2,29 +2,30 @@
# {{ ansible_managed }}
source {{ course_discovery_home }}/course_discovery_env
source {{ discovery_home }}/discovery_env
COMMAND=$1
case $COMMAND in
start)
{% set course_discovery_venv_bin = course_discovery_home + "/venvs/" + course_discovery_service_name + "/bin" %}
{% set executable = course_discovery_venv_bin + '/gunicorn' %}
{% set discovery_venv_bin = discovery_home + "/venvs/" + discovery_service_name + "/bin" %}
{% set executable = discovery_venv_bin + '/gunicorn' %}
cd /edx/app/edx_ansible/edx_ansible/docker/plays
sudo ansible-playbook course_discovery.yml -c local -i '127.0.0.1,' \
sudo ansible-playbook discovery.yml -c local -i '127.0.0.1,' \
-t 'install:app-requirements,assets:gather,devstack,migrate' \
--extra-vars="migrate_db=yes" \
--extra-vars="@/ansible_overrides.yml"
{{ executable }} -c {{ course_discovery_home }}/course_discovery_gunicorn.py \
{{ COURSE_DISCOVERY_GUNICORN_EXTRA }} \
{{ executable }} -c {{ discovery_home }}/discovery_gunicorn.py \
{{ DISCOVERY_GUNICORN_EXTRA }} \
--reload \
course_discovery.wsgi:application
discovery.wsgi:application
;;
open)
cd {{ course_discovery_code_dir }}
. {{ course_discovery_venv_bin }}/activate
cd {{ discovery_code_dir }}
. {{ discovery_venv_bin }}/activate
/bin/bash
;;
esac
......@@ -2,17 +2,17 @@
# {{ ansible_managed }}
{% set course_discovery_venv_bin = course_discovery_home + "/venvs/" + course_discovery_service_name + "/bin" %}
{% set discovery_venv_bin = discovery_home + "/venvs/" + discovery_service_name + "/bin" %}
{% if COMMON_ENABLE_NEWRELIC_APP %}
{% set executable = course_discovery_venv_bin + '/newrelic-admin run-program ' + course_discovery_venv_bin + '/gunicorn' %}
{% set executable = discovery_venv_bin + '/newrelic-admin run-program ' + discovery_venv_bin + '/gunicorn' %}
{% else %}
{% set executable = course_discovery_venv_bin + '/gunicorn' %}
{% set executable = discovery_venv_bin + '/gunicorn' %}
{% endif %}
{% if COMMON_ENABLE_NEWRELIC_APP %}
export NEW_RELIC_APP_NAME="{{ COURSE_DISCOVERY_NEWRELIC_APPNAME }}"
export NEW_RELIC_APP_NAME="{{ DISCOVERY_NEWRELIC_APPNAME }}"
export NEW_RELIC_LICENSE_KEY="{{ NEWRELIC_LICENSE_KEY }}"
{% endif -%}
source {{ course_discovery_home }}/course_discovery_env
{{ executable }} -c {{ course_discovery_home }}/course_discovery_gunicorn.py {{ COURSE_DISCOVERY_GUNICORN_EXTRA }} course_discovery.wsgi:application
source {{ discovery_home }}/discovery_env
{{ executable }} -c {{ discovery_home }}/discovery_gunicorn.py {{ DISCOVERY_GUNICORN_EXTRA }} discovery.wsgi:application
# {{ ansible_managed }}
{% for name,value in course_discovery_environment.items() -%}
{% for name,value in discovery_environment.items() -%}
{%- if value -%}
export {{ name }}="{{ value }}"
{% endif %}
......
......@@ -3,10 +3,10 @@ gunicorn configuration file: http://docs.gunicorn.org/en/develop/configure.html
{{ ansible_managed }}
"""
timeout = {{ course_discovery_gunicorn_timeout }}
bind = "{{ course_discovery_gunicorn_host }}:{{ course_discovery_gunicorn_port }}"
pythonpath = "{{ course_discovery_code_dir }}"
workers = {{ COURSE_DISCOVERY_GUNICORN_WORKERS }}
worker_class = "{{ COURSE_DISCOVERY_GUNICORN_WORKER_CLASS }}"
timeout = {{ discovery_gunicorn_timeout }}
bind = "{{ discovery_gunicorn_host }}:{{ discovery_gunicorn_port }}"
pythonpath = "{{ discovery_code_dir }}"
workers = {{ DISCOVERY_GUNICORN_WORKERS }}
worker_class = "{{ DISCOVERY_GUNICORN_WORKER_CLASS }}"
{{ COURSE_DISCOVERY_GUNICORN_EXTRA_CONF }}
{{ DISCOVERY_GUNICORN_EXTRA_CONF }}
......@@ -3,25 +3,25 @@
#
{% if nginx_default_sites is defined and "course_discovery" in nginx_default_sites %}
{% if nginx_default_sites is defined and "discovery" in nginx_default_sites %}
{% set default_site = "default" %}
{% else %}
{% set default_site = "" %}
{% endif %}
upstream course_discovery_app_server {
{% for host in nginx_course_discovery_gunicorn_hosts %}
server {{ host }}:{{ course_discovery_gunicorn_port }} fail_timeout=0;
upstream discovery_app_server {
{% for host in nginx_discovery_gunicorn_hosts %}
server {{ host }}:{{ discovery_gunicorn_port }} fail_timeout=0;
{% endfor %}
}
server {
server_name {{ COURSE_DISCOVERY_HOSTNAME }};
server_name {{ DISCOVERY_HOSTNAME }};
{% if NGINX_ENABLE_SSL %}
listen {{ COURSE_DISCOVERY_NGINX_PORT }} {{ default_site }};
listen {{ COURSE_DISCOVERY_SSL_NGINX_PORT }} ssl;
listen {{ DISCOVERY_NGINX_PORT }} {{ default_site }};
listen {{ DISCOVERY_SSL_NGINX_PORT }} ssl;
ssl_certificate /etc/ssl/certs/{{ NGINX_SSL_CERTIFICATE|basename }};
ssl_certificate_key /etc/ssl/private/{{ NGINX_SSL_KEY|basename }};
......@@ -29,11 +29,11 @@ server {
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
{% else %}
listen {{ COURSE_DISCOVERY_NGINX_PORT }} {{ default_site }};
listen {{ DISCOVERY_NGINX_PORT }} {{ default_site }};
{% endif %}
location ~ ^/static/(?P<file>.*) {
root {{ COMMON_DATA_DIR }}/{{ course_discovery_service_name }};
root {{ COMMON_DATA_DIR }}/{{ discovery_service_name }};
try_files /staticfiles/$file =404;
}
......@@ -61,7 +61,7 @@ server {
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://course_discovery_app_server;
proxy_pass http://discovery_app_server;
}
# Forward to HTTPS if we're an HTTP request...
......
#
# {{ ansible_managed }}
#
[program:{{ course_discovery_service_name }}]
[program:{{ discovery_service_name }}]
command={{ course_discovery_home }}/{{ course_discovery_service_name }}.sh
command={{ discovery_home }}/{{ discovery_service_name }}.sh
user={{ common_web_user }}
directory={{ course_discovery_code_dir }}
directory={{ discovery_code_dir }}
stdout_logfile={{ supervisor_log_dir }}/%(program_name)s-stdout.log
stderr_logfile={{ supervisor_log_dir }}/%(program_name)s-stderr.log
killasgroup=true
......
......@@ -57,7 +57,7 @@ repos_to_cmd["edx-ora2"]="$edx_ansible_cmd ora2.yml -e 'ora2_version=$2'"
repos_to_cmd["insights"]="$edx_ansible_cmd insights.yml -e 'INSIGHTS_VERSION=$2'"
repos_to_cmd["ecommerce"]="$edx_ansible_cmd ecommerce.yml -e 'ECOMMERCE_VERSION=$2'"
repos_to_cmd["programs"]="$edx_ansible_cmd programs.yml -e 'PROGRAMS_VERSION=$2'"
repos_to_cmd["course_discovery"]="$edx_ansible_cmd course_discovery.yml -e 'COURSE_DISCOVERY_VERSION=$2'"
repos_to_cmd["discovery"]="$edx_ansible_cmd discovery.yml -e 'DISCOVERY_VERSION=$2'"
if [[ -z $1 || -z $2 ]]; then
......
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