I’m new to OpenEdx and I’m working on XBlocks development and integration. I need some good suggestions and proposals for optimizing my development environment as now I’m using a Linux virtual machine working directly on the edx platform (LMS and CMS). When I modify the code of my XBlock I need to reinstall, update assets and restart services every time, which is about 10-15 minutes.
First I managed to build my XBlock using the SDK, but when I installed it in the edx platform it didn’t work at all. I need to be able to make changes in the XBlock code and see the results in less amount of time.
You should be able to place the XBlock repo in the src directory of your devstack, and then within the VM/docker containers, it will show up at /edx/src/.... If you install it into the edxapp virtual environment using pip install -e /edx/src/name-of-my-block/, then it will install in “editable mode”, using that exact folder rather than copying it into the virtualenv’s lib directory. Now, whenever you make a change to the XBlock’s python code, django should detect it and restart automatically; if not, just run make lms-restart to force it to restart.
Updating assets shouldn’t be necessary; I don’t think the XBlock assets are cached, though it may depend on how you have things set up, or I could be wrong.
Most people who want to develop XBlocks or otherwise develop with edX use devstack to run it in a docker container; that’s where the make lms-restart command comes from. I’d recommend that approach for development.