Skip to content

Instantly share code, notes, and snippets.

@yarko
Last active August 29, 2015 13:59
Show Gist options
  • Save yarko/10711787 to your computer and use it in GitHub Desktop.
Save yarko/10711787 to your computer and use it in GitHub Desktop.
edx-platform#3094 test methods
---
## build-version.yml
#
# Use with ansible bringup;
# - *_version specs can be branches, tags, or commits
# - you can comment out any items you do not want to override;
# they will retain their settings as in ansible playbooks
# for those items.
#
# github.com account names / repo owners:
#
OPEN_EDX: edx # Open edX repos
GIT_ACCT: yarko # your github acct (your development repos), or edx
# Theme repo;
# Stanford-Online is the Canonical theme;
# start there in developing a theme.
## Stanford-Online theme has error for now;
THEME_ACCT: yarko # Theme repos
# COMMON_GIT_MIRROR: 'github.com'
##
# For production stack, I'm hoping this works from here:
# worker_django_settings_module: aws
##
# source repositories and versions
#
# To begin Open edX product development, fork a starting tree,
# and override repo & version settings to use your fork & devel branch;
#
# Note: this is your snapshot, and the version
# of this build-version.yml file is your edx version!
##
# edx_ansible_source_repo: https://{{ COMMON_GIT_MIRROR }}/{{ OPEN_EDX }}/configuration.git
# edx_ansible_source_repo: https://{{ COMMON_GIT_MIRROR }}/{{ GIT_ACCT }}/configuration.git
# configuration_version: master
# configuration_version: 'yarko/build-version'
##
edx_platform_repo: https://{{ COMMON_GIT_MIRROR }}/{{ GIT_ACCT }}/edx-platform.git
# edx_platform_version: release # would be NICE if this were for latest Open edX release
edx_platform_version: yarko/fix-paver-env-assets
##
# xqueue_source_repo: https://{{ COMMON_GIT_MIRROR }}/{{ OPEN_EDX }}/xqueue.git
# xqueue_version: HEAD
#
##
# xserver_source_repo: https://{{ COMMON_GIT_MIRROR }}/{{ OPEN_EDX }}/xserver.git
# xserver_version: master
##
# forum_source_repo: https://{{ COMMON_GIT_MIRROR }}/{{ GIT_ACCT }}/cs_comments_service.git
# forum_version: master # no release tag/branch, as yet
##
# discern_ease_source_repo: https://{{ COMMON_GIT_MIRROR }}/{{ OPEN_EDX }}/ease.git
# discern_ease_version: HEAD
##
# discern_source_repo: https://{{ COMMON_GIT_MIRROR }}/{{ OPEN_EDX }}/discern.git
# discern_version: master
##
# ora_ease_source_repo: https://{{ COMMON_GIT_MIRROR }}/{{ OPEN_EDX }}/ease.git
# ora_ease_version: master
##
# ora_source_repo: https://{{ COMMON_GIT_MIRROR }}/{{ OPEN_EDX }}/edx-ora.git
# ora_version: master
##
# Theming selection
# typical process:
# - bring up the standard edx theme;
# - bring up a canonically Stanford themed edx;
# - fork and develop your theme;
edxapp_theme_name: stanford
edxapp_theme_source_repo: https://{{ COMMON_GIT_MIRROR }}/{{ THEME_ACCT }}/edx-theme.git
edxapp_theme_version: master
edxapp_use_custom_theme: true # false to disable & use std. theme
---
edx_platform_repo: git://github.com/yarko/edx-platform.git
edx_platform_version: yarko/fix-paver-env-assets
edxapp_theme_name: stanford
edxapp_theme_source_repo: git://github.com/yarko/edx-theme.git
edxapp_theme_version: master
edxapp_use_custom_theme: true # false to disable & use std. theme
VAGRANTFILE_API_VERSION = "2"
MEMORY = 2048
CPU_COUNT = 2
$script = <<SCRIPT
if [ ! -d /edx/app/edx_ansible ]; then
echo "Error: Base box is missing provisioning scripts." 1>&2
exit 1
fi
export PYTHONUNBUFFERED=1
source /edx/app/edx_ansible/venvs/edx_ansible/bin/activate
cd /edx/app/edx_ansible/edx_ansible/playbooks
# handle case where build-version file was removed
export EXTRA_VARS=""
BUILD_FILE=/vagrant/build-version.yml
[ -r ${BUILD_FILE} -a -f ${BUILD_FILE} ] && EXTRA_VARS="--extra-vars \"@${BUILD_FILE}\""
echo "EXTRA_VARS: [${EXTRA_VARS}]"
# Need to ensure that the configuration repo is updated
# The vagrant-devstack.yml playbook will also do this, but only
# after loading the playbooks into memory. If these are out of date,
# this can cause problems (e.g. looking for templates that no longer exist).
/edx/bin/update configuration release
ansible-playbook -i localhost, -c local vagrant-devstack.yml --tags=deploy ${EXTRA_VARS}
SCRIPT
edx_platform_mount_dir = "edx-platform"
forum_mount_dir = "cs_comments_service"
ora_mount_dir = "ora"
if ENV['VAGRANT_MOUNT_BASE']
edx_platform_mount_dir = ENV['VAGRANT_MOUNT_BASE'] + "/" + edx_platform_mount_dir
forum_mount_dir = ENV['VAGRANT_MOUNT_BASE'] + "/" + forum_mount_dir
ora_mount_dir = ENV['VAGRANT_MOUNT_BASE'] + "/" + ora_mount_dir
end
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Creates an edX devstack VM from an official release
config.vm.box = "himbasha-devstack"
config.vm.box_url = "http://files.edx.org/vagrant-images/20140325-himbasha-devstack.box"
config.vm.network :private_network, ip: "192.168.33.10"
config.vm.network :forwarded_port, guest: 8000, host: 8000
config.vm.network :forwarded_port, guest: 8001, host: 8001
config.vm.network :forwarded_port, guest: 4567, host: 4567
config.vm.network :forwarded_port, guest: 8765, host: 8765
config.ssh.insert_key = true
# Enable X11 forwarding so we can interact with GUI applications
if ENV['VAGRANT_X11']
config.ssh.forward_x11 = true
end
# efficiently include only files in the current directory, less Vagrantfile:
config.vm.synced_folder ".", "/vagrant", type: "rsync",
rsync__exclude: [".*/", "*/", "/Vagrantfile*"]
config.vm.synced_folder "#{edx_platform_mount_dir}", "/edx/app/edxapp/edx-platform", :create => true, nfs: true
config.vm.synced_folder "#{forum_mount_dir}", "/edx/app/forum/cs_comments_service", :create => true, nfs: true
config.vm.synced_folder "#{ora_mount_dir}", "/edx/app/ora/ora", :create => true, nfs: true
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--memory", MEMORY.to_s]
vb.customize ["modifyvm", :id, "--cpus", CPU_COUNT.to_s]
# Allow DNS to work for Ubuntu 12.10 host
# http://askubuntu.com/questions/238040/how-do-i-fix-name-service-for-vagrant-client
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
end
# Use vagrant-vbguest plugin to make sure Guest Additions are in sync
config.vbguest.auto_reboot = true
config.vbguest.auto_update = true
# Assume that the base box has the edx_ansible role installed
# We can then tell the Vagrant instance to update itself.
config.vm.provision "shell", inline: $script
end
@yarko
Copy link
Author

yarko commented Apr 15, 2014

To test edx-platform PR#3094 with devstack: [note: PR#3094 is now merged]

  • use the Vagrantfile here;
  • add build-version.yml to the same directory with Vagrantfile;
  • from your host, run vagrant provision on a running instance, or vagrant up --provision otherwise
  • sudo su edxapp
  • paver devstack lms

To test edx-platform PR#3094 with any fullstack:

  • copy the server-vars.yml, here, to your edx instance's /edx/var/edx_ansible/
  • sudo /edx/bin/update edx-platform yarko/fix-paver-env-assets

@yarko
Copy link
Author

yarko commented Apr 19, 2014

updated modified Vagrantfile to avoid VBox 4.3.10 issue (as devstack-injera release did) by rsyncing just files from "." (performance gain as well).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment