Following steps are inspired by edx-devstack.
mkdir edx
cd edx
# For ironwood
virtualenv -p python2 venv
# For juniper or later
virtualenv -p python3 venv
source venv/bin/activate
You have to export OPENEDX_RELEASE version every time you open a new terminal for open edX's docker management.
Note: In-case you want to use master
branch, do not set/export this variable.
export OPENEDX_RELEASE=<RELEASE-BRANCH i.e: "ironwood.master">
or you can simple export it in your .bashrc (for linux) or .bash_profile (for mac)
echo 'export OPENEDX_RELEASE=ironwood.master' >> ( `~/.bashrc` or `~/.bash_profile` )
source ( `~/.bashrc` or `~/.bash_profile` )
# Clone edx devstack
git clone https://github.com/edx/devstack
cd devstack
# Checkout specific release branch (in-case you don't want master branch)
git checkout <RELEASE-BRANCH i.e: "open-release/ironwood.master">
# Install requirements
make requirements
# Clone all open edX releated repos
make dev.clone
cd ..
We can use mitodl's edx-platform by setting remote in pre-cloned edx-platform's repo or by recloning the repo.
# By recloning
rm -r edx-platform
git clone https://github.com/mitodl/edx-platform
# OR
# Via setting mitodl's remote
cd edx-platform
git remote set-url origin https://github.com/mitodl/edx-platform
git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
git fetch origin
git reset --hard <BRANCH-NAME i.e: "open-release/ironwood.master" or "master">
cd ..
$ cd devstack
$ make pull
$ make dev.provision
$ cd ..
Note: make dev.provision
command will automatically checkout/change all repo branches depending upon OPENEDX_RELEASE
exported variable (if OPENEDX_RELEASE is not set, it will use master branches). So if you have any requiements related changes in your branch then you have to install requirements in the shell of that specific container, manually (manuall intallation process is described below).
$ cd edx-platform
$ git checkout master
$ make dev.up
$ make stop
$ cd devstack
# For lms
$ make lms-shell
$ make requiements
# For cms
$ make cms-shell
$ make requiements
- Add a new hostname (if not already exists) in your
/etc/hosts
file (e.g:127.0.0.1 edx.odl.local
) - If you are also configuring mitX Online auth, add a secondary hostname (e.g:
127.0.0.1 edx.odl.local edx2.odl.local
) - If Micromasters isn't able to access the Open edX hostname directly (primarily due to the way networking is handled in compose projects) you will need to set
OPENEDX_HOST_ENTRY
in.env
file such that Mircomasters is able to resolve the Open edX hostname from within the container. Typically this would mean setting the value similar toedx.odl.local:172.22.0.1
where the IP is the gateway IP on the Micromasters docker network. If you're enabled mitX Online auth, use a value likeedx.odl.local edx2.odl.local:172.22.0.1
- In Open edX:
- Create and configure site through admin panel
/admin
(OPTIONAL)- Go to
/admin/sites/site/
and create a site withdomain-name = edx.odl.local:18000
. - Add theme through
/admin/theming/sitetheme/
.
- Go to
- Go to
/admin/oauth2_provider/application/
and verify that an application namedmicromasters
(name does not really matter here) exists with these settings:Redirect uris
:http://mm.odl.local:8079/complete/edxorg/
Client type
: "Confidential"Authorization grant type
: "Authorization code"Skip authorization
: checked- Other values are arbitrary but be sure to fill them all out. Save the client id and secret for later
- Create and configure site through admin panel
- In Micromasters:
- Set
EDXORG_BASE_URL
to the correct URL that is accessible from Micromasters container and host, e.g.http://edx.odl.local:18000/
- Set
EDXORG_CALLBACK_URL
to the URL from which Micromasters will receive OAuth callbacks from edX, e.g.http://host.docker.internal:18000/
- Set
OPENEDX_API_CLIENT_ID
to the client id - Set
OPENEDX_API_CLIENT_SECRET
to the client secret
- Set
- In Open edX:
- Go to
/admin/oauth2_provider/application/
and verify that an application namedmicromasters-mitxonline
(name does not really matter here, but must be different from the one in the section above) exists with these settings:Redirect uris
:http://mm.odl.local:8079/complete/mitxonline/
Client type
: "Confidential"Authorization grant type
: "Authorization code"Skip authorization
: checked- Other values are arbitrary but be sure to fill them all out. Save the client id and secret for later
- Go to
- In Micromasters:
- Set
MITXONLINE_BASE_URL
to the correct URL that is accessible from Micromasters container and host, e.g.http://edx2.odl.local:18000/
- Set
MITXONLINE_CLIENT_ID
to the client id - Set
MITXONLINE_CLIENT_SECRET
to the client secret
- Set