Skip to content
This repository was archived by the owner on Nov 15, 2024. It is now read-only.
javeriaejaz-arbisoft edited this page Feb 2, 2021 · 32 revisions

Philu Devstack Setup


Pre-requisites

  1. make use this direct link version
  2. Docker 17.06 CE or later. You can use this link to download a package according to your machine or for ubuntu 16.04, or you can use this direct link.
  3. docker-compose

Clone devstack

  1. Make a directory philu at your desired place and navigate to this directory in terminal.
  2. Set environment variable OPENEDX_RELEASE=ironwood.master
  3. Set environment variable DEVSTACK_WORKSPACE=/path/to/philu
  4. You can temporarily set environment variables using:
    • export OPENEDX_RELEASE=ironwood.master
    • export DEVSTACK_WORKSPACE=/path/to/philu

In-order to set variable permanently refer to this answer on stackoverflow. Using this method might require logging in again (or reboot) for the variables to set up or

  • For Mac:

    • Open Terminal
    • Run touch ~/.bash_profile; open ~/.bash_profile
    • In TextEdit, add
      • export OPENEDX_RELEASE=ironwood.master
      • export DEVSTACK_WORKSPACE=/path/to/philu
    • Save the .bash_profile file and Quit (Command + Q) Text Edit.
    • Run source ~/.bash_profile
  1. Execute git clone git@github.com:philanthropy-u/devstack.git
  2. Execute cd devstack
  3. Execute make dev.clone. This command will clone the following repositories in philu. Navigate back to philu and make sure you have these repositories available there:

NOTE: Please pay attention, while cloning these repositories you might be asked for your github credentials a few times. If any of the repositories is missing, clone it manually inside the philu directory.

  1. Starting at philu, navigate to NodeBB and create a directory plugins (philu/NodeBB/plugins) inside it.

  2. Copy plugin_clone.sh and link_cloned_plugins.sh from devstack to philu/NodeBB/plugins/ and execute plugin_clone.sh. This will clone the following repositories in philu/NodeBB/plugins/:

Setting up the directories

  1. Back at philu, make a new directory named src, and move philu-edx-theme to philu/src

This is what your directory structure should look like now:

| philu
|---- course-discovery
|---- credentials
|---- devstack
|---- edx-platform
|---- NodeBB
|-------- plugins
|------------nodebb-plugin-custom-join
|------------nodebb-plugin-philu-badging
|------------nodebb-plugin-s3-uploads
|------------nodebb-plugin-session-sharing
|------------nodebb-plugin-write-api
|------------nodebb-theme-philu-community
|---- src
|-------- philu-edx-theme

Obtaining Docker Images

NOTE: This step will download a few docker images from philanthropyudev/philu docker hub repository and will take a long time depending on your internet speed.

  1. Obtain credentials for the philanthropyudev/philu repo on Docker hub from a colleague
  2. Execute docker login and provide the obtained username and password from step 1

NOTE: If you get this error: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.40/auth: dial unix /var/run/docker.sock: connect: permission denied, try executing sudo chmod 666 /var/run/docker.sock

  1. Revert this PR in philu/edx-platform. Also, Comment following lines in edx-platform/lms/djangoapps/commerce/migrations/0001_data__add_ecommerce_service_user.py

dependencies = [ ('onboarding', '0003_historicaluser'), ]

3A. Replace ('student', '0019_auto_20181221_0540') to ('student', '0017_auto_20171219_0925') in edx-platform/common/djangoapps/student/migrations/0020_auto_20200618_0157.py

  1. Navigate to philu/devstack.

  2. Run provision command: make -f Makefile dev.provision.run

  3. Move to the next step if the provision runs successfully, otherwise seek immediate help from a colleague.

  4. Ask for the config.json file from a colleague and place it in philu/NodeBB.

  5. Execute the following commands, maybe in parallel:

    • make dev.up.lms
    • make dev.up.nodebb
  6. After the images have been pulled from the repo, docker will make a container out of these images and try to run it.

  7. Execute make mongo-shell

  8. Inside the mongo-shell, execute ./restoredb.sh, and exit out of the shell

  9. Execute make nodebb-shell. Inside the shell navigate to plugins directory then run command ./link_cloned_plugins.sh. Exit out of the shell.

  10. Shut down the nodebb container (already running as a result of step 3) using CTRL+C

  11. Execute make dev.up.nodebb

  12. Execute make dev.up.studio

  13. Insert the following in your host machines /etc/hosts file: 127.0.0.1 local.philanthropyu.org

  14. Make sure that the IP in lms, cms, and nodebb extra_hosts inside the philu/devstack/docker-compose.yml matches the result of this command

docker network inspect -f '{{with index .IPAM.Config 0}} {{json .Gateway}} {{end}}' devstack_default | tr -d '"'

If it does not match, update the IP values against each of the extra_hosts

  1. Congratulations! You now have the development environment all setup! If you encountered any error, please ask one of your colleague for help.

PyCharm Integration

Follow this link for PyCharm Integration

Clone this wiki locally