Tutor Open edX installation, tips & tricks

Open edX expert and open-source enthusiast.
Tutor Installation
Requirements
Docker: v18.06.0+
Docker Compose: v1.22.0+
Ports 80 and 443 should be open
Hardware:
Minimum configuration: 4 GB RAM, 2 CPU, 8 GB disk space
Recommended configuration: 8 GB RAM, 4 CPU, 25 GB disk space
Other requirements:
sudo apt install python3 python3-pip libyaml-dev
Installation
There are 2 ways to install Tutor:
Install with pip:
pip install "tutor[full]==v13.3.0"Or download the pre-compiled binary and place the
tutorexecutable in your path:sudo curl -L "https://github.com/overhangio/tutor/releases/download/v13.3.0/tutor-$(uname -s)_$(uname -m)" -o /usr/local/bin/tutor sudo chmod 0755 /usr/local/bin/tutorRun
tutor local quickstart- Answer a few questions
And Open edX is installed!
Useful Commands
List down all available commands under tutor
tutor local helpStop, Start, Restart
tutor local stop tutor local start -d tutor local restart tutor local restart lmsCheck logs
# Change lms with the service name for which you want to check logs tutor local logs lms -f --tail 100Tracking logs directory
(tutor config printroot)/data/lms/logs/tracking.log (tutor config printroot)/data/cms/logs/tracking.logCheck all container/service status
tutor local statusCreate a user with staff and admin access
tutor local createuser --staff --superuser -pedx edx edx@example.comImport the demo course
tutor local importdemocourseSet theme
# For first time only git clone https://github.com/jramnai/mytheme.git cp -r /home/ubuntu/mytheme "$(tutor config printroot)/env/build/openedx/themes/" tutor local settheme mytheme # If there is some change in `mytheme` cd mytheme git pull origin main rm -rf "$(tutor config printroot)/env/build/openedx/themes/mytheme" cp -r /home/ubuntu/mytheme "$(tutor config printroot)/env/build/openedx/themes/" tutor local settheme mythemeRunning management commands, find some useful management commands here
tutor local run cms ./manage.py cms reindex_course --all --setup --settings tutor.production tutor local run lms ./manage.py lms compile_sass --settings tutor.productionReloading Open edX settings
tutor local exec lms reload-uwsgiOpen service/container shell
# replace lms with your service/container name tutor local exec lms bash tutor local exec mysql bashInstalling extra requirement
# For first time only cd $(tutor config printroot)/env/build/openedx/requirements/ git clone https://github.com/jramnai/my_package.git echo "-e ./my_package" >> "$(tutor config printroot)/env/build/openedx/requirements/private.txt" tutor images build openedx --build-arg EDX_PLATFORM_REPOSITORY=https://github.com/jramnai/edx-platform.git --build-arg EDX_PLATFORM_VERSION=open-release/maple.master tutor local stop tutor local start -d # If there is some change in `my_package` cd $(tutor config printroot)/env/build/openedx/requirements/my_package git pull origin main tutor images build openedx --build-arg EDX_PLATFORM_REPOSITORY=https://github.com/jramnai/edx-platform.git --build-arg EDX_PLATFORM_VERSION=open-release/maple.master tutor local stop tutor local start -dor simple
echo "git+https://github.com/open-craft/xblock-pdf@b4e404b1f94ffab15c52de5c1382d61235cd8c81#egg=xblock-pdf==1.1.0" "$(tutor config printroot)/env/build/openedx/requirements/private.txt" tutor images build openedx --build-arg EDX_PLATFORM_REPOSITORY=https://github.com/jramnai/edx-platform.git --build-arg EDX_PLATFORM_VERSION=open-release/maple.master tutor local stop tutor local start -dView
config.ymlfile contentcat "$(tutor config printroot)/config.yml"Set parameter in
config.ymlfiletutor config save --set PARAM1=VALUE1 --set PARAM2=VALUE2Print config value
tutor config printvalue OPENEDX_COMMON_VERSIONCreate tutor image build
tutor images build openedx --build-arg EDX_PLATFORM_REPOSITORY=https://github.com/jramnai/edx-platform.git --build-arg EDX_PLATFORM_VERSION=open-release/maple.master or tutor images build openedx --no-cache --build-arg EDX_PLATFORM_REPOSITORY=https://github.com/jramnai/edx-platform.git --build-arg EDX_PLATFORM_VERSION=open-release/maple.masterInstall and enable plugin
pip install tutor-myapp tutor plugins enable myapp tutor local quickstartList installed plugins
tutor plugins listEnable/disable a plugin
tutor plugins enable myplugin tutor plugins disable myplugin tutor config savePrint location of plugin root
tutor plugins printrootUsing Gmail as an SMTP server
Check connectivity
telnet smtp.gmail.com 587Disable Tutor SMTP server
tutor config save --set RUN_SMTP=falseConfigure SMTP credentials
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=YOURUSERNAME@gmail.com \ --set SMTP_PASSWORD='YOURPASSWORD'Restart your platform
tutor local quickstartTest it
tutor local run --no-deps lms ./manage.py lms shell -c \ "from django.core.mail import send_mail; send_mail('test subject', 'test message', 'YOURUSERNAME@gmail.com', ['YOURRECIPIENT@domain.com'])"
Creating DB dumps
tutor local exec \ -e USERNAME="$(tutor config printvalue MYSQL_ROOT_USERNAME)" \ -e PASSWORD="$(tutor config printvalue MYSQL_ROOT_PASSWORD)" \ mysql sh -c 'mysqldump --all-databases --user=$USERNAME --password=$PASSWORD > /var/lib/mysql/dump.sql' tutor local exec mongodb mongodump --out=/data/db/dump.mongodbThe
dump.sqlanddump.mongodbfiles will be located in$(tutor config printroot)/data/mysqland$(tutor config printroot)/data/mongodb.Changing Open edX settings (or Creating a Tutor plugin)
Create plugins root folder
mkdir -p "$(tutor plugins printroot)"Create an empty “myplugin.py” file in this folder
touch "$(tutor plugins printroot)/myplugin.py"Verify plugin is correctly detected
tutor plugins listAdd content in myplugin.py file (the setting which you want to set/modify)
from tutor import hooks hooks.Filters.ENV_PATCHES.add_item( ( "openedx-common-settings", """ X_FRAME_OPTIONS = "ALLOWALL" """ ) )Enable the myplugin
tutor plugins enable mypluginRe-render your environment
tutor config saveRestart the platform
tutor local restart
References
https://github.com/overhangio/tutor/releases
https://docs.tutor.overhang.io/



