Overhang.io

How can I deploy an XBlock to EdX unde tutor into lms/cms?

Hi guys! How can I deploy an XBlock to EdX under the Tutor into lms/cms ?
In the XBlocks manual there are steps installing to Devstack as follows but. Do I have to install Devstack or is there the other way provided by Tutor?
$ make lms-shell
root@7beb9df53150:/edx/app/edxapp/edx-platform# pip install path/to/xblock
$ make lms-restart
https://edx.readthedocs.io/projects/xblock-tutorial/en/latest/edx_platform/devstack.html

You need to follow the instructions here:

https://docs.tutor.overhang.io/configuration.html?highlight=xblock#installing-extra-xblocks-and-requirements

This is how I’ve been doing it.

1 Like

Hi @DmitryTomnikovsky! FYI, Tutor and the devstack and totally unrelated, so make instructions which might work for the devstack will not work with Tutor. Please let us know if the instructions provided by the documentation (as indicated by @ToddLichty) don’t work for you.

Hi Todd / Regis, thank you for your advice. That worked well for the Poll example. Strange I did not find it in the Tutor manual before ))) by the way the last step “tutor images build openedx” took nearly half an hour. Is it ok?

Yes, building the open edx image can take a long time if you don’t have good bandwidth.

Got it. Thank you guys!

the first example worked just great. At the same time I can’t use local XBlock project like it’s described in the second case “To install xblocks from a private repository…”. As an example I’ve cloned the same repo locally:

root@dimvb:~/.local/share/tutor/env/build# git clone https://github.com/open-craft/xblock-poll.git ./openedx/requirements/xblock-poll

then:
echo “-e ./xblock-poll” >> $(tutor config printroot)/env/build/openedx/requirements/private.txt

And on: tutor images build openedx
I am getting the following error despite setup.py is in the repo folder. Could you advise on this case please?

Step 23/38 : RUN pip install -r /openedx/requirements/private.txt
—> Running in 4f7bad5cd467
./xblock-poll should either be a path to a local project or a VCS url beginning with svn+, git+, hg+, or bzr+
You are using pip version 9.0.3, however version 19.1.1 is available.
You should consider upgrading via the ‘pip install --upgrade pip’ command.
The command ‘/bin/sh -c pip install -r /openedx/requirements/private.txt’ returned a non-zero code: 1
Error: Command failed with status 1: docker build -t regis/openedx:ironwood /home/dim/.local/share/tutor/env/build/openedx

Which version of tutor are you running? This issue should have been fixed: Installing "custom" xblock

Hi it was 3.3.10. Now in 3.4 it worked well. Thank you.
Do I get it properly? After rebuilding Tutor by: tutor images build openedx
I have to restart it the following way?
tutor local quickstart

Otherwise it does not pick up the changes in Studio.
Thanks!

Hi it was 3.3.10. Now in 3.4 it worked well. Thank you.

Awesome!

Do I get it properly? After rebuilding Tutor by: tutor images build openedx
I have to restart it the following way?

tutor local quickstart

Otherwise it does not pick up the changes in Studio.

Yes, this is correct. When in doubt, run quickstart :slight_smile: The slightly faster way to reboot is to run:

tutor local stop
tutor local start

This is documented here: https://docs.tutor.overhang.io/configuration.html#custom-open-edx-docker-image

Hi Regis, thank you for you help!