Skip to content

Setting up Open edX Devstack on Windows

Nate Aune edited this page Mar 14, 2015 · 2 revisions

Setting up edX devstack on Windows 8

1. Installing edX

1.1 Installing requirements

Before you start, you ned to install the following requirements:

Follow the installation instructions for all three packages. Try to install Vagrant in a folder whose path doesn't contain spaces to avoid issues with the PATH environment variable. Otherwise, follow instructions in 1.1.1 Sorting out PATH issues.

1.1.1 Sorting out PATH issues (optional)

If you installed Vagrant in a folder with spaces in the path, you'll encounter errors when trying to install the vb guest plugin for Vagrant. Follow the instructions from this StackExchange answer to get around that.

1.2 Installing Vagrant vbguest plugin

Vagrant vbguest plugin is needed to launch an edX VM, install it by launching the Babun shell you installed and running:

vagrant plugin install vagrant-vbguest

1.2 Starting edX

For this to work, you must run Babun shell with the admin privileges! To do that, right click on the Babun shortcut and select Run as administrator. Run the following commands to download the Vagrantfile and start the provisioning process. Note that the Vagrantfile has been modified slightly to avoid having to manually setup a user and a helper folder for working with PyCharm. You can see the differences from the vanilla Vagrantfile here.

mkdir devstack
cd devstack
curl -L https://raw.githubusercontent.com/edx/configuration/master/vagrant/release/devstack/Vagrantfile > Vagrantfile
OPENEDX_VERSION="aspen.1" vagrant up

This will run the Aspen edX release. If you want to try Birch, use:

OPENEDX_VERSION="named-release/birch" vagrant up

I haven't tried provisioning Birch so I don't guarantee this instructions will work without modifications. When you run the vagrant up command, brew some coffee because it might take a while - it might look like it hangs on the edxapp | checkout edx-platform repo into {{edxapp_code_dir}} step, but hang in there, it will complete eventually.

2. Setting up PyCharm for devstack

To set up edX devstack to work with PyCharm, follow the instructions written on edX wiki: Setting up PyCharm for edX development. You can skip the steps with setting up the password for the user account and creating the PyCharm helpers folder as that was taken care of in the Vagrantfile.

If you encounter connection problems when trying to set up a remote interpreter, set up a deployment first under "Project settings -> Build, Execution, Deployment -> Deployment". Add a new SFTP deployment using the same settings as for the remote interpreter. After you've added that, go to "Project interpreter -> Add remote -> Deployment configuration" and set the Python interpreter path to /edx/app/edxapp/venvs/edxapp/bin/python.

Before you launch the LMS for the first time, you'll need to compile and collect all the static assets (you'll have to do that every time you make edits to the frontend files as well - SASS/Coffeescript). To make it easier, we'll add that as a remote tool in PyCharm.

Go to "Project settings -> Tools -> Remote SSH External Tools" and add a new tool so it looks the same as on the image: image

Here are the settings for easier copying and pasting:

  • Name: LMS assets
  • Program: /bin/bash
  • Parameters: -c "paver update_assets --settings devstack lms"
  • Working directory: /edx/app/edxapp/edx-platform

You can run the command by going into the Tools -> Remote SSH tools -> LMS assets

3. Workflow

Generally, the typical workflow should be:

  1. Start Babun shell as an admin
  2. Run vagrant up
  3. Run PyCharm
  4. Run LMS from PyCharm
  5. Do your work and have fun
  6. Run the LMS assets command if you've been modifying frontend code

When you're done with the work:

  1. Stop the LMS server in PyCharm
  2. Close PyCharm
  3. Run vagrant halt in the Babun shell

That's about it, if you have any questions, contact me at filip (at) appsembler (dot) com

Clone this wiki locally