Commit cfabf00c by George Song

Merge pull request #3630 from open-release/ficus.master

Ficus release changes

# Conflicts:
#	playbooks/roles/discovery/tasks/main.yml
parents 60a898b7 7a639872
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
nginx_sites: nginx_sites:
- lms - lms
- cms - cms
- lms-preview
- xqueue - xqueue
- xserver - xserver
nginx_default_sites: nginx_default_sites:
......
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
when: SANDBOX_ENABLE_ECOMMERCE when: SANDBOX_ENABLE_ECOMMERCE
- role: ecomworker - role: ecomworker
when: SANDBOX_ENABLE_ECOMMERCE when: SANDBOX_ENABLE_ECOMMERCE
- programs
- analytics_api - analytics_api
- insights - insights
# not ready yet: - edx_notes_api # not ready yet: - edx_notes_api
......
...@@ -21,19 +21,6 @@ ...@@ -21,19 +21,6 @@
- dumpall - dumpall
- debug - debug
- name: Dump lms-preview auth|env file
template:
src: "../../edxapp/templates/lms-preview.{{ item }}.json.j2"
dest: "/tmp/lms-preview.{{ item }}.json"
mode: 0600
with_items:
- env
- auth
when: "'lms-preview' in service_variants_enabled"
tags:
- dumpall
- debug
- name: Dump cms auth|env file - name: Dump cms auth|env file
template: template:
src: "../../edxapp/templates/cms.{{ item }}.json.j2" src: "../../edxapp/templates/cms.{{ item }}.json.j2"
......
browser_deb_pkgs: browser_deb_pkgs:
- xvfb
- dbus-x11 - dbus-x11
- gdebi
- libcurl3
- libgconf2-4 - libgconf2-4
- libxss1
- libnss3-1d - libnss3-1d
- libcurl3 - libxss1
- xdg-utils - xdg-utils
- gdebi - xvfb
# Firefox for Xenial
firefox_version: version 45.*
# Debian packages we host in S3 to ensure correct browser version # Packages we host in S3 to ensure correct browser version Both Chrome and
# Both Chrome and FireFox update their apt repos with the latest version, # FireFox update their apt repos with the latest version, which often causes
# which often causes spurious acceptance test failures. # spurious acceptance test failures.
browser_s3_deb_pkgs: browser_s3_deb_pkgs:
- { name: "firefox-mozilla-build_42.0-0ubuntu1_amd64.deb", url: "https://s3.amazonaws.com/vagrant.testeng.edx.org/firefox-mozilla-build_42.0-0ubuntu1_amd64.deb" } - name: firefox_45.0.2+build1-0ubuntu1_amd64
- { name: "google-chrome-stable_55.0.2883.87-1_amd64.deb", url: "https://s3.amazonaws.com/vagrant.testeng.edx.org/google-chrome-stable_55.0.2883.87-1_amd64.deb" } url: https://s3.amazonaws.com/vagrant.testeng.edx.org/firefox_45.0.2%2Bbuild1-0ubuntu1_amd64.deb
- name: google-chrome-stable_55.0.2883.87-1_amd64.deb
url: https://s3.amazonaws.com/vagrant.testeng.edx.org/google-chrome-stable_55.0.2883.87-1_amd64.deb
# ChromeDriver # ChromeDriver
chromedriver_version: 2.27 chromedriver_version: 2.27
......
# Install browsers required to run the JavaScript # Install browsers required to run the JavaScript
# and acceptance test suite locally without a display # and acceptance test suite locally without a display
--- ---
- name: lock Firefox version
copy:
dest: /etc/apt/preferences.d/firefox-pinned-version
content: |
Package: firefox
Pin: {{ firefox_version }}
Pin-Priority: 1001
tags:
- install
- install:system-requirements
- name: install system packages - name: install system packages
apt: pkg={{','.join(browser_deb_pkgs)}} apt:
state=present update_cache=yes name: "{{ item }}"
update_cache: yes
with_items: "{{ browser_deb_pkgs }}"
tags:
- install
- install:system-requirements
- name: download browser debian packages from S3 - name: download browser packages from S3
get_url: dest="/tmp/{{ item.name }}" url="{{ item.url }}" get_url:
dest: /tmp/{{ item.name }}
url: "{{ item.url }}"
register: download_deb register: download_deb
with_items: "{{ browser_s3_deb_pkgs }}" with_items: "{{ browser_s3_deb_pkgs }}"
tags:
- install
- install:system-requirements
- name: install browser debian packages - name: install browser packages
shell: gdebi -nq /tmp/{{ item.name }} shell: gdebi -nq /tmp/{{ item.name }}
when: download_deb.changed when: download_deb.changed
with_items: "{{ browser_s3_deb_pkgs }}" with_items: "{{ browser_s3_deb_pkgs }}"
tags:
# Because the source location has been deprecated, we need to - install
# ensure it does not interfere with subsequent apt commands - install:system-requirements
- name: remove google chrome debian source list
file:
path: /etc/apt/sources.list.d/google-chrome.list
state: absent
- name: download ChromeDriver - name: download ChromeDriver
get_url: get_url:
url={{ chromedriver_url }} url: "{{ chromedriver_url }}"
dest=/var/tmp/chromedriver_{{ chromedriver_version }}.zip dest: /var/tmp/chromedriver_{{ chromedriver_version }}.zip
register: download_chromedriver register: download_chromedriver
tags:
- install
- install:system-requirements
- name: unzip ChromeDriver tarfile - name: unzip ChromeDriver tarfile
shell: unzip /var/tmp/chromedriver_{{ chromedriver_version }}.zip shell: unzip /var/tmp/chromedriver_{{ chromedriver_version }}.zip
chdir=/var/tmp args:
chdir: /var/tmp
when: download_chromedriver.changed when: download_chromedriver.changed
tags:
- install
- install:system-requirements
- name: move ChromeDriver binary to /usr/local - name: move ChromeDriver binary to /usr/local
shell: mv /var/tmp/chromedriver /usr/local/bin/chromedriver shell: mv /var/tmp/chromedriver /usr/local/bin/chromedriver
when: download_chromedriver.changed when: download_chromedriver.changed
tags:
- install
- install:system-requirements
- name: make ChromeDriver binary executable - name: make ChromeDriver binary executable
file: path=/usr/local/bin/chromedriver mode=0755 file:
path: /usr/local/bin/chromedriver
mode: 0755
when: download_chromedriver.changed when: download_chromedriver.changed
tags:
- install
- install:system-requirements
- name: verify ChromeDriver location and mode - name: verify ChromeDriver location and mode
stat: path=/usr/local/bin/chromedriver stat:
path: /usr/local/bin/chromedriver
register: chromedriver register: chromedriver
tags:
- install
- install:system-requirements
- assert: - assert:
that: that:
- "chromedriver.stat.exists" - "chromedriver.stat.exists"
- "chromedriver.stat.mode == '0755'" - "chromedriver.stat.mode == '0755'"
tags:
- install
- install:system-requirements
- name: download PhantomJS - name: download PhantomJS
get_url: get_url:
url: "{{ phantomjs_url }}" url: "{{ phantomjs_url }}"
dest: "/var/tmp/{{ phantomjs_tarfile }}" dest: "/var/tmp/{{ phantomjs_tarfile }}"
register: download_phantom_js register: download_phantom_js
tags:
- install
- install:system-requirements
- name: unpack the PhantomJS tarfile - name: unpack the PhantomJS tarfile
shell: "tar -xjf /var/tmp/{{ phantomjs_tarfile }}" shell: "tar -xjf /var/tmp/{{ phantomjs_tarfile }}"
args: args:
chdir: "/var/tmp" chdir: "/var/tmp"
when: download_phantom_js.changed when: download_phantom_js.changed
tags:
- install
- install:system-requirements
- name: move PhantomJS binary to /usr/local - name: move PhantomJS binary to /usr/local
shell: mv /var/tmp/{{ phantomjs_version }}/bin/phantomjs /usr/local/bin/phantomjs shell: mv /var/tmp/{{ phantomjs_version }}/bin/phantomjs /usr/local/bin/phantomjs
when: download_phantom_js.changed when: download_phantom_js.changed
tags:
- install
- install:system-requirements
- name: verify phantomjs location - name: verify phantomjs location
stat: path=/usr/local/bin/phantomjs stat: path=/usr/local/bin/phantomjs
register: phantomjs register: phantomjs
- assert:
that: "phantomjs.stat.exists"
- name: create xvfb upstart script for Precise and Trusty (12.04 and 14.04)
template:
src: xvfb.conf.j2
dest: /etc/init/xvfb.conf
owner: root
group: root
when: ansible_distribution_release == 'precise' or ansible_distribution_release == 'trusty'
tags: tags:
- install - install
- install:configuration - install:system-requirements
- name: start xvfb upstart script for Precise and Trusty (12.04 and 14.04) - assert:
shell: start xvfb that: "phantomjs.stat.exists"
ignore_errors: yes
when: ansible_distribution_release == 'precise' or ansible_distribution_release == 'trusty'
tags: tags:
- install - install
- install:configuration - install:system-requirements
- name: create xvfb systemd service for Xenial (16.04) - name: create xvfb systemd service
template: template:
src: xvfb.service.j2 src: xvfb.service.j2
dest: /etc/systemd/system/xvfb.service dest: /etc/systemd/system/xvfb.service
owner: root owner: root
group: root group: root
when: ansible_distribution_release == 'xenial'
tags: tags:
- install - install
- install:configuration - install:configuration
- name: enable and start xvfb systemd service for Xenial (16.04) - name: enable and start xvfb systemd service
systemd: systemd:
name: xvfb name: xvfb
enabled: yes enabled: yes
state: started state: started
when: ansible_distribution_release == 'xenial'
tags: tags:
- install - install
- install:configuration - install:configuration
description "Xvfb X Server"
start on (net-device-up and local-filesystems and runlevel [2345])
stop on runlevel [016]
exec /usr/bin/Xvfb {{ browser_xvfb_display }} -screen 0 1024x768x24
respawn
respawn limit 15 5
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
Description=Xvfb X Server Description=Xvfb X Server
After=network.target After=network.target
[Service] [Service]
ExecStart=/usr/bin/Xvfb {{ browser_xvfb_display }} -screen 0 1024x768x24 ExecStart=/usr/bin/Xvfb {{ browser_xvfb_display }} -screen 0 1024x768x24
[Install] [Install]
......
...@@ -45,7 +45,7 @@ common_directories: ...@@ -45,7 +45,7 @@ common_directories:
- path: "/etc/logrotate.d/hourly" - path: "/etc/logrotate.d/hourly"
- path: "/etc/rsyslog.d/50-default.conf" - path: "/etc/rsyslog.d/50-default.conf"
state: absent state: absent
COMMON_ENVIRONMENT: 'default_env' COMMON_ENVIRONMENT: 'default_env'
COMMON_DEPLOYMENT: 'default_deployment' COMMON_DEPLOYMENT: 'default_deployment'
COMMON_PIP_VERBOSITY: '' COMMON_PIP_VERBOSITY: ''
...@@ -98,6 +98,7 @@ COMMON_ENABLE_NEWRELIC_APP: False ...@@ -98,6 +98,7 @@ COMMON_ENABLE_NEWRELIC_APP: False
COMMON_ENABLE_MINOS: False COMMON_ENABLE_MINOS: False
COMMON_TAG_EC2_INSTANCE: False COMMON_TAG_EC2_INSTANCE: False
common_boto_version: '2.34.0' common_boto_version: '2.34.0'
common_node_version: '6.9.4'
common_redhat_pkgs: common_redhat_pkgs:
- ntp - ntp
- lynx - lynx
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
# #
## ##
# Defaults for role credentials # Defaults for role credentials
# #
CREDENTIALS_GIT_IDENTITY: !!null CREDENTIALS_GIT_IDENTITY: !!null
# depends upon Newrelic being enabled via COMMON_ENABLE_NEWRELIC # depends upon Newrelic being enabled via COMMON_ENABLE_NEWRELIC
...@@ -219,6 +219,7 @@ credentials_nodeenv_dir: "{{ credentials_home }}/nodeenvs/{{ credentials_service ...@@ -219,6 +219,7 @@ credentials_nodeenv_dir: "{{ credentials_home }}/nodeenvs/{{ credentials_service
credentials_nodeenv_bin: "{{ credentials_nodeenv_dir }}/bin" credentials_nodeenv_bin: "{{ credentials_nodeenv_dir }}/bin"
credentials_node_modules_dir: "{{ credentials_code_dir }}/node_modules" credentials_node_modules_dir: "{{ credentials_code_dir }}/node_modules"
credentials_node_bin: "{{ credentials_node_modules_dir }}/.bin" credentials_node_bin: "{{ credentials_node_modules_dir }}/.bin"
credentials_node_version: "{{ common_node_version }}"
credentials_environment: credentials_environment:
DJANGO_SETTINGS_MODULE: "{{ CREDENTIALS_DJANGO_SETTINGS_MODULE }}" DJANGO_SETTINGS_MODULE: "{{ CREDENTIALS_DJANGO_SETTINGS_MODULE }}"
......
...@@ -42,14 +42,23 @@ ...@@ -42,14 +42,23 @@
- install - install
- install:app-requirements - install:app-requirements
# See https://github.com/ekalinin/nodeenv/issues/182
# This can be removed once https://github.com/ekalinin/nodeenv/pull/183 is merged
- name: Remove nodeenv src
file:
path: "{{ credentials_nodeenv_dir }}/src"
state: absent
become_user: "{{ credentials_user }}"
tags:
- install
- install:system-requirements
- name: create nodeenv - name: create nodeenv
shell: "{{ credentials_venv_dir }}/bin/nodeenv {{ credentials_nodeenv_dir }} --prebuilt" shell: "{{ credentials_venv_dir }}/bin/nodeenv {{ credentials_nodeenv_dir }} --node={{ credentials_node_version }} --prebuilt --force"
args:
creates: "{{ credentials_nodeenv_dir }}"
become_user: "{{ credentials_user }}" become_user: "{{ credentials_user }}"
tags: tags:
- install - install
- install:app-requirements - install:system-requirements
- name: install development requirements - name: install development requirements
command: make requirements command: make requirements
......
...@@ -99,7 +99,7 @@ DISCOVERY_MEDIA_STORAGE_BACKEND: ...@@ -99,7 +99,7 @@ DISCOVERY_MEDIA_STORAGE_BACKEND:
DEFAULT_FILE_STORAGE: 'django.core.files.storage.FileSystemStorage' DEFAULT_FILE_STORAGE: 'django.core.files.storage.FileSystemStorage'
MEDIA_ROOT: '{{ DISCOVERY_MEDIA_ROOT }}' MEDIA_ROOT: '{{ DISCOVERY_MEDIA_ROOT }}'
MEDIA_URL: '{{ DISCOVERY_MEDIA_URL }}' MEDIA_URL: '{{ DISCOVERY_MEDIA_URL }}'
DISCOVERY_STATICFILES_STORAGE: 'django.contrib.staticfiles.storage.StaticFilesStorage' DISCOVERY_STATICFILES_STORAGE: 'django.contrib.staticfiles.storage.StaticFilesStorage'
# You can set different email backends with django: # You can set different email backends with django:
...@@ -241,7 +241,7 @@ discovery_nodeenv_dir: "{{ discovery_home }}/nodeenvs/{{ discovery_service_name ...@@ -241,7 +241,7 @@ discovery_nodeenv_dir: "{{ discovery_home }}/nodeenvs/{{ discovery_service_name
discovery_nodeenv_bin: "{{ discovery_nodeenv_dir }}/bin" discovery_nodeenv_bin: "{{ discovery_nodeenv_dir }}/bin"
discovery_node_modules_dir: "{{ discovery_code_dir }}/node_modules" discovery_node_modules_dir: "{{ discovery_code_dir }}/node_modules"
discovery_node_bin: "{{ discovery_node_modules_dir }}/.bin" discovery_node_bin: "{{ discovery_node_modules_dir }}/.bin"
discovery_node_version: "6.9.4" discovery_node_version: "{{ common_node_version }}"
discovery_gunicorn_host: "127.0.0.1" discovery_gunicorn_host: "127.0.0.1"
discovery_gunicorn_port: 8381 discovery_gunicorn_port: 8381
......
...@@ -67,10 +67,19 @@ ...@@ -67,10 +67,19 @@
- install - install
- install:system-requirements - install:system-requirements
# See https://github.com/ekalinin/nodeenv/issues/182
# This can be removed once https://github.com/ekalinin/nodeenv/pull/183 is merged
- name: remove nodeenv src
file:
path: "{{ discovery_nodeenv_dir }}/src"
state: absent
become_user: "{{ discovery_user }}"
tags:
- install
- install:system-requirements
- name: create nodeenv - name: create nodeenv
shell: "{{ discovery_venv_dir }}/bin/nodeenv {{ discovery_nodeenv_dir }} --node={{ discovery_node_version }} --prebuilt" shell: "{{ discovery_venv_dir }}/bin/nodeenv {{ discovery_nodeenv_dir }} --node={{ discovery_node_version }} --prebuilt --force"
args:
creates: "{{ discovery_nodeenv_dir }}"
become_user: "{{ discovery_user }}" become_user: "{{ discovery_user }}"
tags: tags:
- install - install
...@@ -238,4 +247,3 @@ ...@@ -238,4 +247,3 @@
tags: tags:
- install - install
- install:vhosts - install:vhosts
...@@ -214,6 +214,7 @@ ecommerce_nodeenv_dir: "{{ ecommerce_home }}/nodeenvs/{{ ecommerce_service_name ...@@ -214,6 +214,7 @@ ecommerce_nodeenv_dir: "{{ ecommerce_home }}/nodeenvs/{{ ecommerce_service_name
ecommerce_nodeenv_bin: "{{ ecommerce_nodeenv_dir }}/bin" ecommerce_nodeenv_bin: "{{ ecommerce_nodeenv_dir }}/bin"
ecommerce_node_modules_dir: "{{ ecommerce_code_dir }}/node_modules" ecommerce_node_modules_dir: "{{ ecommerce_code_dir }}/node_modules"
ecommerce_node_bin: "{{ ecommerce_node_modules_dir }}/.bin" ecommerce_node_bin: "{{ ecommerce_node_modules_dir }}/.bin"
ecommerce_node_version: "{{ common_node_version }}"
ecommerce_gunicorn_host: "127.0.0.1" ecommerce_gunicorn_host: "127.0.0.1"
ecommerce_gunicorn_port: "8130" ecommerce_gunicorn_port: "8130"
......
...@@ -40,20 +40,30 @@ ...@@ -40,20 +40,30 @@
- install - install
- install:app-requirements - install:app-requirements
# See https://github.com/ekalinin/nodeenv/issues/182
# This can be removed once https://github.com/ekalinin/nodeenv/pull/183 is merged
- name: Remove nodeenv src
file:
path: "{{ ecommerce_nodeenv_dir }}/src"
state: absent
become_user: "{{ ecommerce_user }}"
tags:
- install
- install:system-requirements
- name: Create nodeenv - name: Create nodeenv
shell: "{{ ecommerce_venv_dir }}/bin/nodeenv {{ ecommerce_nodeenv_dir }} --prebuilt" shell: "{{ ecommerce_venv_dir }}/bin/nodeenv {{ ecommerce_nodeenv_dir }} --node={{ ecommerce_node_version }} --prebuilt --force"
args:
creates: "{{ ecommerce_nodeenv_dir }}"
become_user: "{{ ecommerce_user }}" become_user: "{{ ecommerce_user }}"
tags: tags:
- install - install
- install:app-requirements - install:system-requirements
- name: Install node dependencies - name: Install node dependencies
npm: npm:
executable: "{{ ecommerce_nodeenv_bin }}/npm" executable: "{{ ecommerce_nodeenv_bin }}/npm"
path: "{{ ecommerce_code_dir }}" path: "{{ ecommerce_code_dir }}"
production: yes production: yes
state: latest
become_user: "{{ ecommerce_user }}" become_user: "{{ ecommerce_user }}"
environment: "{{ ecommerce_environment }}" environment: "{{ ecommerce_environment }}"
tags: tags:
......
...@@ -13,8 +13,9 @@ apt-get autoclean -y ...@@ -13,8 +13,9 @@ apt-get autoclean -y
# Clean out pip caches. # Clean out pip caches.
find / -type d -path '*/.cache/pip' -print -exec rm -rf '{}/*' \; find / -type d -path '*/.cache/pip' -print -exec rm -rf '{}/*' \;
# Remove all the .pyc files. # We used to remove all .pyc files. This caused problems in sandboxes,
find /edx/app -name '*.pyc' -delete # where code couldn't write .pyc files, and everything took too long.
# find /edx/app -name '*.pyc' -delete
# Last thing: fill the disk with zeros so they'll compress well. # Last thing: fill the disk with zeros so they'll compress well.
# The dd command fails because the disk fills, which is the point, so silence # The dd command fails because the disk fills, which is the point, so silence
......
...@@ -24,7 +24,7 @@ EDXAPP_DJFS: ...@@ -24,7 +24,7 @@ EDXAPP_DJFS:
url_root : '/static/django-pyfs' url_root : '/static/django-pyfs'
EDXAPP_LMS_BASE: "{{ EDXAPP_LMS_SITE_NAME }}:{{ EDXAPP_LMS_NGINX_PORT }}" EDXAPP_LMS_BASE: "{{ EDXAPP_LMS_SITE_NAME }}:{{ EDXAPP_LMS_NGINX_PORT }}"
EDXAPP_PREVIEW_LMS_BASE: "preview.{{ EDXAPP_LMS_SITE_NAME }}:{{ EDXAPP_LMS_PREVIEW_NGINX_PORT }}" EDXAPP_PREVIEW_LMS_BASE: "preview.{{ EDXAPP_LMS_SITE_NAME }}:{{ EDXAPP_LMS_NGINX_PORT }}"
EDXAPP_CMS_BASE: "{{ EDXAPP_CMS_SITE_NAME }}:{{ EDXAPP_CMS_NGINX_PORT }}" EDXAPP_CMS_BASE: "{{ EDXAPP_CMS_SITE_NAME }}:{{ EDXAPP_CMS_NGINX_PORT }}"
EDXAPP_LMS_GUNICORN_EXTRA: "" EDXAPP_LMS_GUNICORN_EXTRA: ""
...@@ -267,7 +267,6 @@ EDXAPP_RABBIT_HOSTNAME: 'localhost' ...@@ -267,7 +267,6 @@ EDXAPP_RABBIT_HOSTNAME: 'localhost'
EDXAPP_LMS_NGINX_PORT: 18000 EDXAPP_LMS_NGINX_PORT: 18000
EDXAPP_LMS_SSL_NGINX_PORT: 48000 EDXAPP_LMS_SSL_NGINX_PORT: 48000
EDXAPP_LMS_PREVIEW_NGINX_PORT: 18020
EDXAPP_CMS_NGINX_PORT: 18010 EDXAPP_CMS_NGINX_PORT: 18010
EDXAPP_CMS_SSL_NGINX_PORT: 48010 EDXAPP_CMS_SSL_NGINX_PORT: 48010
...@@ -643,7 +642,7 @@ edxapp_venv_bin: "{{ edxapp_venv_dir }}/bin" ...@@ -643,7 +642,7 @@ edxapp_venv_bin: "{{ edxapp_venv_dir }}/bin"
edxapp_nodeenv_dir: "{{ edxapp_app_dir }}/nodeenvs/edxapp" edxapp_nodeenv_dir: "{{ edxapp_app_dir }}/nodeenvs/edxapp"
edxapp_nodeenv_bin: "{{ edxapp_nodeenv_dir }}/bin" edxapp_nodeenv_bin: "{{ edxapp_nodeenv_dir }}/bin"
edxapp_settings: '{{ EDXAPP_SETTINGS }}' edxapp_settings: '{{ EDXAPP_SETTINGS }}'
edxapp_node_version: "6.9.2" edxapp_node_version: "{{ common_node_version }}"
# This is where node installs modules, not node itself # This is where node installs modules, not node itself
edxapp_node_bin: "{{ edxapp_code_dir }}/node_modules/.bin" edxapp_node_bin: "{{ edxapp_code_dir }}/node_modules/.bin"
edxapp_user: edxapp edxapp_user: edxapp
......
--- ---
- name: create edxapp configuration dir - name: create edxapp configuration dir
file: file:
path: "{{ EDXAPP_CFG_DIR }}" path: "{{ EDXAPP_CFG_DIR }}"
state: directory state: directory
owner: "{{ edxapp_user }}" owner: "{{ edxapp_user }}"
group: "{{ common_web_group }}" group: "{{ common_web_group }}"
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
template: template:
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "{{ item.dest }}" dest: "{{ item.dest }}"
owner: "{{ item.owner }}" owner: "{{ item.owner }}"
group: "{{ item.group }}" group: "{{ item.group }}"
mode: "{{ item.mode }}" mode: "{{ item.mode }}"
with_items: with_items:
...@@ -210,13 +210,21 @@ ...@@ -210,13 +210,21 @@
- install - install
- install:app-requirements - install:app-requirements
# See https://github.com/ekalinin/nodeenv/issues/182
# This can be removed once https://github.com/ekalinin/nodeenv/pull/183 is merged
- name: Remove nodeenv src
file:
path: "{{ edxapp_nodeenv_dir }}/src"
state: absent
tags:
- install
- install:system-requirements
- name: create nodeenv - name: create nodeenv
shell: "{{ edxapp_venv_dir }}/bin/nodeenv {{ edxapp_nodeenv_dir }} --node={{ edxapp_node_version }} --prebuilt" shell: "{{ edxapp_venv_dir }}/bin/nodeenv {{ edxapp_nodeenv_dir }} --node={{ edxapp_node_version }} --prebuilt --force"
args:
creates: "{{ edxapp_nodeenv_dir }}"
tags: tags:
- install - install
- install:app-requirements - install:system-requirements
# Set the npm registry # Set the npm registry
# This needs to be done as root since npm is weird about # This needs to be done as root since npm is weird about
...@@ -245,6 +253,7 @@ ...@@ -245,6 +253,7 @@
executable: "{{ edxapp_nodeenv_bin }}/npm" executable: "{{ edxapp_nodeenv_bin }}/npm"
path: "{{ edxapp_code_dir }}" path: "{{ edxapp_code_dir }}"
production: yes production: yes
state: latest
environment: "{{ edxapp_environment }}" environment: "{{ edxapp_environment }}"
become_user: "{{ edxapp_user }}" become_user: "{{ edxapp_user }}"
tags: tags:
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
# #
# #
# Defaults for role insights # Defaults for role insights
# #
INSIGHTS_LMS_BASE: 'http://127.0.0.1:8000' INSIGHTS_LMS_BASE: 'http://127.0.0.1:8000'
INSIGHTS_CMS_BASE: 'http://127.0.0.1:8010' INSIGHTS_CMS_BASE: 'http://127.0.0.1:8010'
...@@ -169,7 +169,7 @@ insights_environment: ...@@ -169,7 +169,7 @@ insights_environment:
ANALYTICS_DASHBOARD_CFG: "{{ COMMON_CFG_DIR }}/{{ insights_service_name }}.yml" ANALYTICS_DASHBOARD_CFG: "{{ COMMON_CFG_DIR }}/{{ insights_service_name }}.yml"
PATH: "{{ insights_nodeenv_bin }}:{{ insights_venv_dir }}/bin:{{ ansible_env.PATH }}" PATH: "{{ insights_nodeenv_bin }}:{{ insights_venv_dir }}/bin:{{ ansible_env.PATH }}"
insights_service_name: insights insights_service_name: insights
insights_venv_dir: "{{ insights_home }}/venvs/{{ insights_service_name }}" insights_venv_dir: "{{ insights_home }}/venvs/{{ insights_service_name }}"
insights_user: "{{ insights_service_name }}" insights_user: "{{ insights_service_name }}"
...@@ -185,6 +185,7 @@ insights_nodeenv_dir: "{{ insights_home }}/nodeenvs/{{ insights_service_name }}" ...@@ -185,6 +185,7 @@ insights_nodeenv_dir: "{{ insights_home }}/nodeenvs/{{ insights_service_name }}"
insights_nodeenv_bin: "{{ insights_nodeenv_dir }}/bin" insights_nodeenv_bin: "{{ insights_nodeenv_dir }}/bin"
insights_node_modules_dir: "{{ insights_code_dir }}/node_modules" insights_node_modules_dir: "{{ insights_code_dir }}/node_modules"
insights_node_bin: "{{ insights_node_modules_dir }}/.bin" insights_node_bin: "{{ insights_node_modules_dir }}/.bin"
insights_node_version: "{{ common_node_version }}"
insights_gunicorn_host: "127.0.0.1" insights_gunicorn_host: "127.0.0.1"
insights_gunicorn_port: "8110" insights_gunicorn_port: "8110"
......
...@@ -44,17 +44,30 @@ ...@@ -44,17 +44,30 @@
- install - install
- install:app-requirements - install:app-requirements
# See https://github.com/ekalinin/nodeenv/issues/182
# This can be removed once https://github.com/ekalinin/nodeenv/pull/183 is merged
- name: Remove nodeenv src
file:
path: "{{ insights_nodeenv_dir }}/src"
state: absent
become_user: "{{ insights_user }}"
tags:
- install
- install:system-requirements
- name: create nodeenv - name: create nodeenv
shell: "{{ insights_venv_dir }}/bin/nodeenv {{ insights_nodeenv_dir }} --prebuilt" shell: "{{ insights_venv_dir }}/bin/nodeenv {{ insights_nodeenv_dir }} --node={{ insights_node_version }} --prebuilt --force"
args:
creates: "{{ insights_nodeenv_dir }}"
become_user: "{{ insights_user }}" become_user: "{{ insights_user }}"
tags: tags:
- install - install
- install:base - install:system-requirements
- name: install node dependencies - name: install node dependencies
npm: executable={{ insights_nodeenv_bin }}/npm path={{ insights_code_dir }} production=yes npm:
executable: "{{ insights_nodeenv_bin }}/npm"
path: "{{ insights_code_dir }}"
production: yes
state: latest
become_user: "{{ insights_user }}" become_user: "{{ insights_user }}"
tags: tags:
- install - install
......
upstream lms-preview-backend {
{% for host in nginx_lms_preview_gunicorn_hosts %}
server {{ host }}:{{ edxapp_lms_preview_gunicorn_port }} fail_timeout=0;
{% endfor %}
}
server {
# LMS-preview configuration file for nginx, templated by ansible
listen {{ EDXAPP_LMS_PREVIEW_NGINX_PORT }};
server_name preview.*;
# CS184 requires uploads of up to 4MB for submitting screenshots.
# CMS requires larger value for course assest, values provided
# via hiera.
client_max_body_size 4M;
# request the browser to use SSL for all connections
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
rewrite ^(.*)/favicon.ico$ /static/images/favicon.ico last;
{% include "python_lib.zip.j2" %}
{% include "common-settings.j2" %}
location @proxy_to_lms-preview_app {
{% if NGINX_SET_X_FORWARDED_HEADERS %}
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-For $remote_addr;
{% else %}
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
proxy_set_header X-Forwarded-Port $http_x_forwarded_port;
proxy_set_header X-Forwarded-For $http_x_forwarded_for;
{% endif %}
# newrelic-specific header records the time when nginx handles a request.
proxy_set_header X-Queue-Start "t=${msec}";
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://lms-preview-backend;
}
location / {
{% if EDXAPP_LMS_PREVIEW_ENABLE_BASIC_AUTH|bool %}
{% include "basic-auth.j2" %}
{% endif %}
try_files $uri @proxy_to_lms-preview_app;
}
# No basic auth security on the github_service_hook url, so that github can use it for cms
location /github_service_hook {
try_files $uri @proxy_to_lms-preview_app;
}
# No basic auth security on the heartbeat url, so that ELB can use it
location /heartbeat {
try_files $uri @proxy_to_lms-preview_app;
}
{% include "robots.j2" %}
# Check security on this
location ~ ^/static/(?P<file>.*) {
root {{ edxapp_data_dir}};
try_files /staticfiles/$file /course_static/$file =404;
# return a 403 for static files that shouldn't be
# in the staticfiles directory
location ~ ^/static/(?:.*)(?:\.xml|\.json|README.TXT) {
return 403;
}
# Set django-pipelined files to maximum cache time
location ~ "/static/(?P<collected>.*\.[0-9a-f]{12}\..*)" {
expires max;
# Without this try_files, files that have been run through
# django-pipeline return 404s
try_files /staticfiles/$collected /course_static/$collected =404;
}
# Expire other static files immediately (there should be very few / none of these)
expires epoch;
}
# Nginx does not support nested condition or or conditions so
# there is an unfortunate mix of conditonals here.
{% if NGINX_REDIRECT_TO_HTTPS %}
{% if NGINX_HTTPS_REDIRECT_STRATEGY == "scheme" %}
# Redirect http to https over single instance
if ($scheme != "https")
{
set $do_redirect_to_https "true";
}
{% elif NGINX_HTTPS_REDIRECT_STRATEGY == "forward_for_proto" %}
# Forward to HTTPS if we're an HTTP request... and the server is behind ELB
if ($http_x_forwarded_proto = "http")
{
set $do_redirect_to_https "true";
}
{% endif %}
# Execute the actual redirect
if ($do_redirect_to_https = "true")
{
return 301 https://$host$request_uri;
}
{% endif %}
}
...@@ -69,7 +69,6 @@ ...@@ -69,7 +69,6 @@
#EDXAPP_LMS_SSL_NGINX_PORT: 443 #EDXAPP_LMS_SSL_NGINX_PORT: 443
#EDXAPP_CMS_SSL_NGINX_PORT: 443 #EDXAPP_CMS_SSL_NGINX_PORT: 443
#EDXAPP_LMS_NGINX_PORT: 80 #EDXAPP_LMS_NGINX_PORT: 80
#EDXAPP_LMS_PREVIEW_NGINX_PORT: 80
#EDXAPP_CMS_NGINX_PORT: 80 #EDXAPP_CMS_NGINX_PORT: 80
#EDXAPP_WORKERS: #EDXAPP_WORKERS:
# lms: 2 # lms: 2
......
...@@ -136,6 +136,11 @@ exec > >(tee $log_file) 2>&1 ...@@ -136,6 +136,11 @@ exec > >(tee $log_file) 2>&1
echo "Capturing output to $log_file" echo "Capturing output to $log_file"
echo "Installation started at $(date '+%Y-%m-%d %H:%M:%S')" echo "Installation started at $(date '+%Y-%m-%d %H:%M:%S')"
function finish {
echo "Installation finished at $(date '+%Y-%m-%d %H:%M:%S')"
}
trap finish EXIT
export OPENEDX_RELEASE=$release export OPENEDX_RELEASE=$release
echo "Installing release '$OPENEDX_RELEASE'" echo "Installing release '$OPENEDX_RELEASE'"
...@@ -188,6 +193,5 @@ else ...@@ -188,6 +193,5 @@ else
sudo bash -c "echo '192.168.33.10 preview.localhost' >> /etc/hosts" sudo bash -c "echo '192.168.33.10 preview.localhost' >> /etc/hosts"
fi fi
echo "Installation finished at $(date '+%Y-%m-%d %H:%M:%S')"
echo -e "${SUCCESS}Finished installing! You may now log in using 'vagrant ssh'" echo -e "${SUCCESS}Finished installing! You may now log in using 'vagrant ssh'"
echo -e "Refer to the edX wiki ($wiki_link) for more information on using $stack.${NC}" echo -e "Refer to the edX wiki ($wiki_link) for more information on using $stack.${NC}"
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
## ##
## Sanity check ## Sanity check
## ##
if [[ `lsb_release -rs` != "12.04" ]]; then if [[ `lsb_release -rs` != "16.04" ]]; then
echo "This script is only known to work on Ubuntu 12.04, exiting..."; echo "This script is only known to work on Ubuntu 16.04, exiting...";
exit; exit;
fi fi
...@@ -31,18 +31,12 @@ sudo apt-get upgrade -y ...@@ -31,18 +31,12 @@ sudo apt-get upgrade -y
## ##
## Install system pre-requisites ## Install system pre-requisites
## ##
sudo apt-get install -y build-essential software-properties-common curl git-core libxml2-dev libxslt1-dev python-pip libmysqlclient-dev python-apt python-dev libxmlsec1-dev libfreetype6-dev swig gcc-4.8 g++-4.8 sudo apt-get install -y build-essential software-properties-common curl git-core libxml2-dev libxslt1-dev python-pip libmysqlclient-dev python-apt python-dev libxmlsec1-dev libfreetype6-dev swig gcc g++
sudo pip install --upgrade pip==8.1.2 sudo pip install --upgrade pip==8.1.2
sudo pip install --upgrade setuptools==24.0.3 sudo pip install --upgrade setuptools==24.0.3
sudo -H pip install --upgrade virtualenv==15.0.2 sudo -H pip install --upgrade virtualenv==15.0.2
## ##
## Update alternatives so that gcc/g++ 4.8 is the default compiler
##
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 50
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 50
##
## Overridable version variables in the playbooks. Each can be overridden ## Overridable version variables in the playbooks. Each can be overridden
## individually, or with $OPENEDX_RELEASE. ## individually, or with $OPENEDX_RELEASE.
## ##
...@@ -56,9 +50,12 @@ VERSION_VARS=( ...@@ -56,9 +50,12 @@ VERSION_VARS=(
NOTIFIER_VERSION NOTIFIER_VERSION
INSIGHTS_VERSION INSIGHTS_VERSION
ANALYTICS_API_VERSION ANALYTICS_API_VERSION
ECOMMERCE_VERSION
ECOMMERCE_WORKER_VERSION
PROGRAMS_VERSION
) )
EXTRA_VARS="" EXTRA_VARS="-e SANDBOX_ENABLE_ECOMMERCE=True $EXTRA_VARS"
for var in ${VERSION_VARS[@]}; do for var in ${VERSION_VARS[@]}; do
# Each variable can be overridden by a similarly-named environment variable, # Each variable can be overridden by a similarly-named environment variable,
# or OPENEDX_RELEASE, if provided. # or OPENEDX_RELEASE, if provided.
...@@ -78,6 +75,7 @@ cd /var/tmp ...@@ -78,6 +75,7 @@ cd /var/tmp
git clone https://github.com/edx/configuration git clone https://github.com/edx/configuration
cd configuration cd configuration
git checkout $CONFIGURATION_VERSION git checkout $CONFIGURATION_VERSION
git pull
## ##
## Install the ansible requirements ## Install the ansible requirements
...@@ -88,4 +86,4 @@ sudo -H pip install -r requirements.txt ...@@ -88,4 +86,4 @@ sudo -H pip install -r requirements.txt
## ##
## Run the edx_sandbox.yml playbook in the configuration/playbooks directory ## Run the edx_sandbox.yml playbook in the configuration/playbooks directory
## ##
cd /var/tmp/configuration/playbooks && sudo ansible-playbook -c local ./edx_sandbox.yml -i "localhost," $EXTRA_VARS cd /var/tmp/configuration/playbooks && sudo -E ansible-playbook -c local ./edx_sandbox.yml -i "localhost," $EXTRA_VARS
...@@ -187,7 +187,6 @@ EDXAPP_COMPREHENSIVE_THEME_DIRS: $edxapp_comprehensive_theme_dirs ...@@ -187,7 +187,6 @@ EDXAPP_COMPREHENSIVE_THEME_DIRS: $edxapp_comprehensive_theme_dirs
EDXAPP_STATIC_URL_BASE: $static_url_base EDXAPP_STATIC_URL_BASE: $static_url_base
EDXAPP_LMS_NGINX_PORT: 80 EDXAPP_LMS_NGINX_PORT: 80
EDXAPP_LMS_PREVIEW_NGINX_PORT: 80
EDXAPP_CMS_NGINX_PORT: 80 EDXAPP_CMS_NGINX_PORT: 80
ECOMMERCE_NGINX_PORT: 80 ECOMMERCE_NGINX_PORT: 80
......
Vagrant.require_version ">= 1.5.3" Vagrant.require_version ">= 1.8.7"
unless Vagrant.has_plugin?("vagrant-vbguest") unless Vagrant.has_plugin?("vagrant-vbguest")
raise "Please install the vagrant-vbguest plugin by running `vagrant plugin install vagrant-vbguest`" raise "Please install the vagrant-vbguest plugin by running `vagrant plugin install vagrant-vbguest`"
end end
...@@ -31,9 +31,8 @@ VERSION_VARS = [ ...@@ -31,9 +31,8 @@ VERSION_VARS = [
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Creates a devstack from a base Ubuntu 12.04 image for virtualbox # Creates a devstack from a base Ubuntu 16.04 image for virtualbox
config.vm.box = "precise64" config.vm.box = "boxcutter/ubuntu1604"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.vm.network :private_network, ip: vm_guest_ip, nic_type: "virtio" config.vm.network :private_network, ip: vm_guest_ip, nic_type: "virtio"
...@@ -72,18 +71,20 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| ...@@ -72,18 +71,20 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
end end
# Make LC_ALL default to en_US.UTF-8 instead of en_US. # Make LC_ALL default to en_US.UTF-8 instead of en_US.
# See: https://github.com/mitchellh/vagrant/issues/1188 # See: https://github.com/mitchellh/vagrant/issues/1188
config.vm.provision "shell", inline: 'echo \'LC_ALL="en_US.UTF-8"\' > /etc/default/locale' config.vm.provision "shell", inline: 'echo \'LC_ALL="en_US.UTF-8"\' > /etc/default/locale'
# Get ready for ansible on this box.
config.vm.provision "shell", path: '../../../util/install/ansible-bootstrap.sh'
# Use vagrant-vbguest plugin to make sure Guest Additions are in sync # Use vagrant-vbguest plugin to make sure Guest Additions are in sync
config.vbguest.auto_reboot = true config.vbguest.auto_reboot = true
config.vbguest.auto_update = true config.vbguest.auto_update = true
config.vm.provision :ansible do |ansible| config.vm.provision :ansible do |ansible|
ansible.playbook = "../../../playbooks/vagrant-devstack.yml" ansible.playbook = "../../../playbooks/vagrant-devstack.yml"
ansible.verbose = "vvvv" ansible.verbose = "vv"
ansible.extra_vars = {} ansible.extra_vars = {}
VERSION_VARS.each do |var| VERSION_VARS.each do |var|
......
Vagrant.require_version ">= 1.5.3" Vagrant.require_version ">= 1.8.7"
VAGRANTFILE_API_VERSION = "2" VAGRANTFILE_API_VERSION = "2"
MEMORY = 4096 MEMORY = 4096
CPU_COUNT = 2 CPU_COUNT = 2
vm_guest_ip = "192.168.33.10"
if ENV["VAGRANT_GUEST_IP"]
vm_guest_ip = ENV["VAGRANT_GUEST_IP"]
end
# These are versioning variables in the roles. Each can be overridden, first # These are versioning variables in the roles. Each can be overridden, first
# with OPENEDX_RELEASE, and then with a specific environment variable of the # with OPENEDX_RELEASE, and then with a specific environment variable of the
# same name but upper-cased. # same name but upper-cased.
...@@ -15,19 +20,24 @@ VERSION_VARS = [ ...@@ -15,19 +20,24 @@ VERSION_VARS = [
'forum_version', 'forum_version',
'xqueue_version', 'xqueue_version',
'demo_version', 'demo_version',
'NOTIFIER_VERSION',
'ECOMMERCE_VERSION',
'ECOMMERCE_WORKER_VERSION',
'PROGRAMS_VERSION',
] ]
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box" # Creates a machine from a base Ubuntu 16.04 image for virtualbox
config.vm.box = "boxcutter/ubuntu1604"
config.vm.network :private_network, ip: vm_guest_ip, nic_type: "virtio"
config.ssh.insert_key = true config.ssh.insert_key = true
config.vm.synced_folder ".", "/vagrant", disabled: true config.vm.synced_folder ".", "/vagrant", disabled: true
config.vm.network :private_network, ip: "192.168.33.10"
config.vm.provider :virtualbox do |vb| config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--memory", MEMORY.to_s] vb.customize ["modifyvm", :id, "--memory", MEMORY.to_s]
# You can adjust this to the amount of CPUs your system has available
vb.customize ["modifyvm", :id, "--cpus", CPU_COUNT.to_s] vb.customize ["modifyvm", :id, "--cpus", CPU_COUNT.to_s]
# Allow DNS to work for Ubuntu 12.10 host # Allow DNS to work for Ubuntu 12.10 host
...@@ -41,8 +51,8 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| ...@@ -41,8 +51,8 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.provision :ansible do |ansible| config.vm.provision :ansible do |ansible|
# point Vagrant at the location of your playbook you want to run # point Vagrant at the location of your playbook you want to run
ansible.playbook = "../../../playbooks/vagrant-fullstack.yml" ansible.playbook = "../../../playbooks/edx_sandbox.yml"
ansible.verbose = "vvv" ansible.verbose = "vv"
# Set extra-vars here instead of in the vagrant play so that # Set extra-vars here instead of in the vagrant play so that
# they are written out to /edx/etc/server-vars.yml which can # they are written out to /edx/etc/server-vars.yml which can
......
Vagrant.require_version ">= 1.6.5" Vagrant.require_version ">= 1.8.7"
unless Vagrant.has_plugin?("vagrant-vbguest") unless Vagrant.has_plugin?("vagrant-vbguest")
raise "Please install the vagrant-vbguest plugin by running `vagrant plugin install vagrant-vbguest`" raise "Please install the vagrant-vbguest plugin by running `vagrant plugin install vagrant-vbguest`"
end end
...@@ -44,10 +44,14 @@ end ...@@ -44,10 +44,14 @@ end
# to a name and a file path, which are used for retrieving # to a name and a file path, which are used for retrieving
# a Vagrant box from the internet. # a Vagrant box from the internet.
openedx_releases = { openedx_releases = {
"open-release/ficus.master" => "ficus-devstack-2017-01-11",
"open-release/ficus.1rc1" => "ficus-devstack-2017-01-11",
"open-release/eucalyptus.master" => "eucalyptus-devstack-2016-09-01", "open-release/eucalyptus.master" => "eucalyptus-devstack-2016-09-01",
"open-release/eucalyptus.1rc2" => "eucalyptus-devstack-2016-08-19", "open-release/eucalyptus.1rc2" => "eucalyptus-devstack-2016-08-19",
"open-release/eucalyptus.1" => "eucalyptus-devstack-2016-08-19", "open-release/eucalyptus.1" => "eucalyptus-devstack-2016-08-19",
"open-release/eucalyptus.2" => "eucalyptus-devstack-2016-09-01", "open-release/eucalyptus.2" => "eucalyptus-devstack-2016-09-01",
"named-release/dogwood.rc" => "dogwood-devstack-2016-03-09", "named-release/dogwood.rc" => "dogwood-devstack-2016-03-09",
"named-release/dogwood.1" => "dogwood-devstack-2016-03-09", "named-release/dogwood.1" => "dogwood-devstack-2016-03-09",
"named-release/dogwood.2" => "dogwood-devstack-2016-03-09", "named-release/dogwood.2" => "dogwood-devstack-2016-03-09",
...@@ -56,17 +60,12 @@ openedx_releases = { ...@@ -56,17 +60,12 @@ openedx_releases = {
:name => "dogwood-devstack-rc2", :file => "20151221-dogwood-devstack-rc2.box", :name => "dogwood-devstack-rc2", :file => "20151221-dogwood-devstack-rc2.box",
}, },
# Cypress is deprecated and unsupported # Cypress is deprecated and unsupported
# "named-release/cypress" => {
# :name => "cypress-devstack",
# },
# Birch is deprecated and unsupported # Birch is deprecated and unsupported
# "named-release/birch.2" => {
# :name => "birch-devstack-2", :file => "birch-2-devstack.box",
# },
} }
openedx_releases.default = "eucalyptus-devstack-2016-09-01" openedx_releases.default = "eucalyptus-devstack-2016-09-01"
openedx_release = ENV['OPENEDX_RELEASE'] openedx_release = ENV['OPENEDX_RELEASE']
boxname = ENV['OPENEDX_BOXNAME']
# Build -e override lines for each overridable variable. # Build -e override lines for each overridable variable.
extra_vars_lines = "" extra_vars_lines = ""
...@@ -96,18 +95,24 @@ SCRIPT ...@@ -96,18 +95,24 @@ SCRIPT
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
reldata = openedx_releases[openedx_release] boxfile = ""
if Hash == reldata.class if not boxname
boxname = openedx_releases[openedx_release][:name] reldata = openedx_releases[openedx_release]
boxfile = openedx_releases[openedx_release].fetch(:file, "#{boxname}.box") if Hash == reldata.class
else boxname = openedx_releases[openedx_release][:name]
boxname = reldata boxfile = openedx_releases[openedx_release].fetch(:file, "")
else
boxname = reldata
end
end
if boxfile == ""
boxfile = "#{boxname}.box" boxfile = "#{boxname}.box"
end end
# Creates an edX devstack VM from an official release # Creates an edX devstack VM from an official release
config.vm.box = boxname config.vm.box = boxname
config.vm.box_url = "http://files.edx.org/vagrant-images/#{boxfile}" config.vm.box_url = "http://files.edx.org/vagrant-images/#{boxfile}"
config.vm.box_check_update = false
config.vm.network :private_network, ip: "192.168.33.10" config.vm.network :private_network, ip: "192.168.33.10"
......
Vagrant.require_version ">= 1.5.3" Vagrant.require_version ">= 1.8.7"
VAGRANTFILE_API_VERSION = "2" VAGRANTFILE_API_VERSION = "2"
...@@ -41,26 +41,33 @@ openedx_releases = { ...@@ -41,26 +41,33 @@ openedx_releases = {
openedx_releases.default = "eucalyptus-fullstack-2016-09-01" openedx_releases.default = "eucalyptus-fullstack-2016-09-01"
openedx_release = ENV['OPENEDX_RELEASE'] openedx_release = ENV['OPENEDX_RELEASE']
boxname = ENV['OPENEDX_BOXNAME']
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
reldata = openedx_releases[openedx_release] boxfile = ""
if Hash == reldata.class if not boxname
boxname = openedx_releases[openedx_release][:name] reldata = openedx_releases[openedx_release]
boxfile = openedx_releases[openedx_release].fetch(:file, "#{boxname}.box") if Hash == reldata.class
else boxname = openedx_releases[openedx_release][:name]
boxname = reldata boxfile = openedx_releases[openedx_release].fetch(:file, "")
else
boxname = reldata
end
end
if boxfile == ""
boxfile = "#{boxname}.box" boxfile = "#{boxname}.box"
end end
# Creates an edX fullstack VM from an official release # Creates an edX fullstack VM from an official release
config.vm.box = boxname config.vm.box = boxname
config.vm.box_url = "http://files.edx.org/vagrant-images/#{boxfile}" config.vm.box_url = "http://files.edx.org/vagrant-images/#{boxfile}"
config.vm.box_check_update = false
config.vm.network :private_network, ip: "192.168.33.10"
config.vm.synced_folder ".", "/vagrant", disabled: true config.vm.synced_folder ".", "/vagrant", disabled: true
config.ssh.insert_key = true config.ssh.insert_key = true
config.vm.network :private_network, ip: "192.168.33.10"
config.hostsupdater.aliases = ["preview.localhost"] config.hostsupdater.aliases = ["preview.localhost"]
config.vm.provider :virtualbox do |vb| config.vm.provider :virtualbox do |vb|
...@@ -70,5 +77,11 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| ...@@ -70,5 +77,11 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Allow DNS to work for Ubuntu 12.10 host # Allow DNS to work for Ubuntu 12.10 host
# http://askubuntu.com/questions/238040/how-do-i-fix-name-service-for-vagrant-client # http://askubuntu.com/questions/238040/how-do-i-fix-name-service-for-vagrant-client
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
# Virtio is faster, but the box needs to have support for it. We didn't
# have support in the boxes before Ficus.
if !(boxname.include?("dogwood") || boxname.include?("eucalyptus"))
vb.customize ['modifyvm', :id, '--nictype1', 'virtio']
end
end end
end end
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