How to run Xblocks in dev mode?

Hi everyone! I am using the latest version of tutor and I am trying to run some XBlocks I have locally on my file system by using tutor dev (not tutor local). I had opened up this topic last week and I got great help in the form of some steps on how to do so. However, the steps when replicated do not work for me. Here are some concerns I have:

  1. In my <project-root>/env/build/openedx I cannot see the requirements directory by default. I just created one myself and I am not sure if that is the correct way to proceed or not.
  2. When I run pip3 install -e <my-xblock>, there are no issues. When I do pip3 list, I can see the xblocks in the list. But when I rebuild the image, the XBlocks don’t seem to.get installed. How do I check and verify if my XBlocks are being read and installed or not.
  3. The tutor dev documentation asks me to rebuild the image by running the command tutor images build openedx-dev but the topic I have linked above is asking me to run tutor images build openedx. Is there a difference in the two?
  4. I was wondering there is any difference for setting up and installing XBlocks in tutor dev and tutor local/k8s.

Any kind of advice/help would be highly appreciated! Thank you.

Hi @tanmaypardeshi

For xblocks not being there on rebuild

If you want that your XBlocks are there when you re-build you can check out this post Install xblock Open edX tutor Quince - #2 by chintan

Difference between openedx and openedx-dev

Yes those are different images, in dev mode it’s easier to do development and it restarts when mounted directories are changed. It also allows you to put in pdb. If you want to do development of your XBlock openedx-dev is the image to go for.

k8s/dev/local difference in setting up the XBlocks

You can just put the blocks the way it’s mentioned in the link and tutor will pick it up for all of them. However for k8s, I am not sure if local Xblocks (within your machine) will work or not, it might need to be on git so it can pull.

When I am doing the XBlock development, I prefer to go with tutor mounts add... command, and start it in dev mode, it’s easier in that manner.

1 Like