-
Notifications
You must be signed in to change notification settings - Fork 2
Setting up the Devstack
This is a custom fork of Open edX's docker based development environment, frankly known as devstack. For those who want to read the original README can follow this link. Following instructions and guides are specific to the edly.io team.
- Your local machine should be configured to clone from github using SSH. Also, you need access to edly's private repos.
- A python virtualenv in which all the python dependencies will be installed (I recommend virtualenvwrapper)
- Docker 17.06+ CE
The OPENEDX_RELEASE
variable should be set in your *nix environment. Use the following command to set it. Currently the devstack supports ironwood
and hawthorn
releases of Open edX.
export OPENEDX_RELEASE=ironwood.master
OR
export OPENEDX_RELEASE=hawthorn.master
To avoid doing this everytime, add the above line to your bash or zsh profile.
To get up and running as quickly as possible simply run the following commands from your $HOME directory. These commands can take a few hours to run completely. So please keep track of the time.
mkdir -p edly/edX/
cd edly/edX
git clone [email protected]:edly-io/devstack.git
cd devstack
make requirements
make dev.clone
make dev.checkout
make pull
make dev.provision
Now to run all of the edX services simply run
make dev.up
And to stop the services
make stop
Some WordPress related configuration has to be done manually after the devstack is setup for the first time.
- Visit localhost:8888. It should prompt the WordPress installation screen.
- Fill it in with the following values
- Site name: Edly
- Username: edx
- Password: edx
- Email: [email protected]
- Click
Install
and the login with the same credentials. - You should now be in the WordPress admin dashboard.
- Go to
Plugins -> Installed Plugins
and activate all the plugins. - Go to
Appearance -> Themes
and activateEdly WordPress Theme
- Enjoy.
To setup the Edly edx themes repo.
- Go do the
edly/edX
directory. - Run
sudo chmod -R 777 src/
- Clone edly-edx-themes in the
src
folder. - Run
sudo chmod -R 777 src/
- Run
cd devstack
- Run
make lms-shell
. This will take you to the docker container for LMS. - Edit the
/edx/app/edxapp/lms.env.json
file in the docker container to the following values.
"ENABLE_COMPREHENSIVE_THEMING": true,
"COMPREHENSIVE_THEME_DIRS": [
"/edx/src/edly-edx-themes"
]
- Run
docker-compose restart lms
in the/edly/edX/devstack
folder. - Enter the LMS docker shell through
make lms-shell
. Runpaver update_assets
in the docker shell from the/edx/app/edxapp/edx-platform
folder. - Exit the docker shell using
Ctrl+D
- Run
make lms-restart
- Go to
http://localhost:18000/admin
and login usingedx
andedx
. - Go to
http://localhost:18000/admin/sites/site/
and add a new site with valuesdomain
aslocalhost:18000
anddisplay name
asst-lutherx
. - Go to
http://localhost:18000/admin/theming/sitetheme/
and add a new theme with valuessite
aslocalhost:18000
andTheme dir name
asst-lutherx
. - This should work.
Service | URL |
---|---|
WordPress | http:localhost:18888 |
LMS | http:localhost:18000 |
CMS / Studio | http:localhost:18010 |
Catalog / Discovery | http:localhost:18381/api-docs |
Ecommerce / Otto | http:localhost:18130/dashboard |
Notes / edx-notes-api | http:localhost:18120/api/v1 |
Credentials | http://localhost:18150/api/v2/ |
The Open edX devstack runs on a number of docker containers. Each container run a specific edX service. For our own purposes, A custom WordPress container has also been added to these containers.
Let's go through the commands one-by-one.
As stated previously, please make sure that you fulfill all the prerequisites listed above.
- First, I recommend creating a dedicated project folder for edly. A simple folder named
edly
in the home directory is fine. The reason I have also created anedX
folder inside here is that the devstack clones the Open edX repos in its parent folder. i.e. ifedly/edX/devstack
is the path of the devstack repo then all of the code will be cloned inedly/edX
. This is how just devstack works. So, to create the directories
mkdir -p /edly/edX
cd edly/edX
- Next step is to clone the actual devstack repo.
git clone [email protected]:edly-io/devstack.git
cd devstack
- Now, the first thing to do is install the python requirements for devstack. You should have a python virtualenv activated in your shell.
Most docker commands have been aliased through the
make
interface so you shouldn't have to rundocker
anddocker-compose
commands directly.
make requirements
- Now, we will actually clone all the repos needed to run the devstack. We have a
make
command to handle this. You should have SSH configured on your github with edly's private repo access for this to work correctly. This command can take a while since it's downloading around a dozen repositories. Grab a coffee or tea.
make dev.clone
- Next we have to pull all the docker images to our local machine. This will take some time as well. Grab another tea.
make pull
- The next step is to provision our local machine. This will create all the necessary database configurations and settings.
make dev.provision
- After this, you can either start all the Open edX services including WordPress through the following command
make dev.up
- To stop all of the services, simply run the following command
make stop