Ishan Sheth (imsheth)
The Hows - Open edX Nutmeg with Tutor 14 on Ubuntu 20
The Hows - Open edX Nutmeg with Tutor 14 on Ubuntu 20
Jun 29, 2022
The motivation for writing this post is in the hope that it helps others save lots of time, energy instead of going through various links but hitting dead ends due to lack of community support, broken features, features lacking updates and improper documentation prevailing around the topic.
This post is focused on how to setup Open edX Nutmeg with Tutor 14 on Ubuntu 20
Ubuntu 20.x.x
- Check the machine operating system, it should be Ubuntu 20.x.x
- Our test machine operating system details (Ubuntu 20.04.2 LTS (Focal Fossa))
cat /etc/os-release
It is recommended to use the LTS version but not necessary
This completes Ubuntu check
python 3.8.10
- Picking the versions listed in the Open edX platform Dockerfile fox maximum compatibility and support
- python ppa installation
- Install python 3.8.10 and required packages
sudo add-apt-repository ppa:deadsnakes/ppa && sudo apt-get update && sudo apt-get -y upgrade && sudo apt-get install software-properties-common && sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget libyaml-dev && sudo apt install python3.8 && sudo apt-get install python3-dev && python3.8 --version
- Verify python 3.8.10 installation path
whereis python
- Set environment/path/alias variables for python 3.8.10 & pip 22.1.2
- Setting path variable for python 3.8.10
- Set alias for python to point to python 3.8.10
- Set alias for python to point to python 3.8.10 in .bashrc
echo 'export PATH=$PATH:"/usr/bin/python3.8"' >> ~/.bashrc && echo 'alias python="python3.8"' >> ~/.bashrc && echo 'export PATH=$PATH:"/home/ubuntu/.local/bin"' >> ~/.bashrc && echo 'alias pip="pip3"' >> ~/.bashrc && source ~/.bashrc && echo $PATH && python --version
- pip 22.1.2
cd /tmp && curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && python get-pip.py && pip install --upgrade pip --user && pip --version
- This completes python and pip installation
Docker 20.10.17
- Install docker (v18.06.0+) and docker compose (v1.22.0+)
- Docker installation
- Docker compose installation
- Docker compose releases
- Run docker without sudo
- Install docker 20.10.17
cd /tmp && curl -fsSL https://get.docker.com -o get-docker.sh && sh get-docker.sh && docker --version
sudo vim /lib/systemd/system/docker.service
# Comment the original line for backup to revert if needed#ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sockExecStart=/usr/bin/dockerd -H fd:// -H 0.0.0.0:2375 --containerd=/run/containerd/containerd.sock
- Reload - restart daemon and verify docker remote API response
sudo systemctl daemon-reloadsudo service docker restartcurl http://localhost:2375/images/json
- Install docker compose 1.29.2
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose && sudo chmod +x /usr/local/bin/docker-compose && docker-compose --version
- Run docker without sudo
sudo groupadd docker && sudo usermod -aG docker ${USER}
- This completes docker 20.10.17 and docker compose 1.29.2 installation and setup
Tutor 14.0.2
- Install Tutor 14.0.2
- Reference for local deployment
- Reference for kubernetes deployment on AWS EKS
- Tutor Troubleshooting and logs
- Tutor local deployment reference
- Tutor local deployment command reference
- Install Tutor 14.0.2
pip install "tutor[full]" && tutor --version
- Set environment/path variables for Tutor 14.0.2
echo 'export PATH=$PATH:"/home/ubuntu/.local/bin/tutor"' >> ~/.bashrc && source ~/.bashrc
- Setup Tutor 14.0.2 with interactive shell
tutor local quickstart
Assign static/elastic IP to the instance
Add domain mappings to the static/elastic IP
A openedx x.x.x.x 600sCNAME *.openedx openedx.imsheth.com 60m
We have our openedx running
We have our openedx studio running
We have our openedx admin running
View logs from all containers (as per need)
tutor local logs --tail=100 -f
- Local deployment reloading settings (as per need)
tutor local restart
- Creating a new user with staff and admin rights (works with studio and admin portals, can also be used on the learner portal) [pass1234 is the password entered on the prompt here]
tutor local createuser --staff --superuser imsheth contact@imsheth.com
- Importing the demo course
tutor local importdemocourse
- This completes Tutor 14.0.2 and Open edX Nutmeg installation and setup
Open edX APIs
Enable API access config at admin
API access config is enabled at admin
Fill the API access request form at api-admin
Submit the API access request form at api-admin
Your API access request is available at admin
Approve and save your API access request at admin
Your API access request is approved at admin
Fill the form to generate API access credentials at api-admin
Your API access credentials are generated and available at api-admin
Get CSRF token from account registration endpoint response headers
Use it in headers in access token endpoint
Get JWT token from access token endpoint in response using client_id and client_secret generated in step 9 above
Most of the GET endpoints are open and do not need authentication like account registration form endpoint
Use JWT token in "Authorization" key and CSRF token in "X-CSRFToken" key in header and hit account registration endpoint
Hit account registration endpoint with proper body attributes by referring to API documentation at https://courses.edx.org/api-docs/
Above approach worked fine to fix CORS issues, but the below links didn't work in the same case
- https://discuss.openedx.org/t/correct-config-for-cross-domain-access-to-open-edx-api/2584
- https://discuss.overhang.io/t/how-to-enable-cors-option-for-lms/663
- https://discuss.openedx.org/t/correct-config-for-cross-domain-access-to-open-edx-api/2584/3
- https://discuss.overhang.io/t/how-to-enable-cors-option-for-lms/663
- https://discuss.overhang.io/t/cors-errors-after-patch-10-2-2/989/9
Customizing Settings
- Modifying edx-platform settings
- Creating a Tutor plugin
- Plugin commands cheatsheet
- Plugin creation examples
- Template patches
- Rate limiting on login page
- CLI tutor config
- Tutor configuration and customisation
- Turning off rate limiting
tutor config save --set RATELIMIT_ENABLE=False
- Turning on debugging
tutor config save --set DEBUG=True
- Using Google SMTP
tutor config save --set RUN_SMTP=false
tutor config save \ --set SMTP_HOST=smtp.gmail.com \ --set SMTP_PORT=587 \ --set SMTP_USE_SSL=false \ --set SMTP_USE_TLS=true \ --set SMTP_USERNAME=gmailid@gmail.com \ --set SMTP_PASSWORD=gmailidpassword
- Applying settings
tutor local restart
#openedx
#openedxnutmeg
#tutor
#tutor14.0.2
#docker
#docker20.10.17
#python
#python3.8.10
#pip
#pip21.1.2
#ubuntu
#ubuntu20.04.4lts
#tech
#edtech
#lms
#learningmanagementsystem
Edit this page on GitHub