Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Setting up the solutions devstack

Zia Fazal edited this page Jul 14, 2016 · 70 revisions

Follow the instructions about prerequisites at the Configuration repo wiki. When you get to the section about the Vagrant file, stop, and do this instead:

mkdir solutions
cd solutions
curl -L https://raw.githubusercontent.com/edx/configuration/master/vagrant/release/devstack/Vagrantfile > Vagrantfile
vagrant plugin install vagrant-vbguest

Next, edit the Vagrantfile and change this line:

rel = ENV['OPENEDX_RELEASE']

...to:

rel = "named-release/cypress"

and save. Finally, run:

vagrant up

...to make sure you're building on top of the cypress release, which the solution's devstack is based on, and to make sure vagrant knows what settings to load each time it runs.

Next, checkout solutions in your edx-platform repo. If you want to support multiple remotes, we recommend making 'origin' point to edx-solutions and have 'upstream' point to edx/edx-platform. To do so, on your host, change the directories to where devstack checked out edx/edx-platform.

cd ~/solutions/edx-platform  # for example, in case your Devstack is built in ~/devstack, otherwise, change this path
git remote add solutions https://github.com/edx-solutions/edx-platform.git
git remote rename origin upstream
git remote rename solutions origin
git fetch origin
git checkout -b master origin/master

Next, vagrant ssh into the Vagrant box, then we have to update the Python dependencies. As the vagrant user, run:

sudo su edxapp	#make sure prompt reads ~/edx-platform
unset NO_PREREQ_INSTALL
# Clean out all files which aren't tracked by git, like old precompiled python files and some generated CSS.
git clean -fx
paver install_prereqs

We also have to turn on some features in the lms.env.json file before re-generating the database

        "API": true,
        "MARK_PROGRESS_ON_GRADING_EVENT": true,
        "SIGNAL_ON_SCORE_CHANGED": true,
        "STUDENT_GRADEBOOK": true,
        "STUDENT_PROGRESS": true,
        "ORGANIZATIONS_APP": true,
        "PROJECTS_APP": true,
        "ENABLE_XBLOCK_VIEW_ENDPOINT": true,

Next, replace the MODULESTORE entry in lms.auth.json and cms.auth.json with:

    "MODULESTORE": {
        "default": {
            "ENGINE": "xmodule.modulestore.mixed.MixedModuleStore", 
            "OPTIONS": {
                "mappings": {}, 
                "stores": [
                    {
                        "DOC_STORE_CONFIG": {
                            "collection": "modulestore", 
                            "db": "edxapp", 
                            "host": [
                                "localhost"
                            ], 
                            "password": "password", 
                            "port": 27017, 
                            "user": "edxapp"
                        }, 
                        "ENGINE": "xmodule.modulestore.mongo.DraftMongoModuleStore", 
                        "NAME": "draft", 
                        "OPTIONS": {
                            "default_class": "xmodule.hidden_module.HiddenDescriptor", 
                            "fs_root": "/edx/var/edxapp/data", 
                            "render_template": "edxmako.shortcuts.render_to_string"
                        }
                    }, 
                    {
                        "ENGINE": "xmodule.modulestore.xml.XMLModuleStore", 
                        "NAME": "xml", 
                        "OPTIONS": {
                            "data_dir": "/edx/var/edxapp/data", 
                            "default_class": "xmodule.hidden_module.HiddenDescriptor"
                        }
                    }, 
                    {
                        "DOC_STORE_CONFIG": {
                            "collection": "modulestore", 
                            "db": "edxapp", 
                            "host": [
                                "localhost"
                            ], 
                            "password": "password", 
                            "port": 27017, 
                            "user": "edxapp"
                        }, 
                        "ENGINE": "xmodule.modulestore.split_mongo.split_draft.DraftVersioningModuleStore", 
                        "NAME": "split", 
                        "OPTIONS": {
                            "default_class": "xmodule.hidden_module.HiddenDescriptor", 
                            "fs_root": "/edx/var/edxapp/data", 
                            "render_template": "edxmako.shortcuts.render_to_string"
                        }
                    }
                ]
            }
        }
    }, 

...as currently the solutions platform is not tested with Split and is known to have trouble with it.

We will now need to update the DB to include these applications and the custom fields we've added to other apps:

./manage.py lms migrate --settings=devstack --merge && ./manage.py cms migrate --settings=devstack --merge

We also use a forked version of the cs_comment_client repo. To use that, in your host:

cd ~/devstack/cs_comments_service # For example, in case your Devstack is built in ~/devstack, otherwise, change this path
git remote add solutions https://github.com/edx-solutions/cs_comments_service.git
git remote rename origin upstream
git remote rename solutions origin
git fetch origin
git checkout origin/master -b master

After all of these steps, you may want to return to the edxapp user and run all unit tests to verify the integrity of the runtime environment:

paver test_python
Clone this wiki locally