How to use custom notes feature docker image in tutor

Hello everyone,
I have made one custom image for notes feature with some changes in notesapi/v1 folder.I configured it in config.yml with tutor config save --set NOTES_DOCKER_IMAGE=dockeruser/notes:maple.master and then i launched tutor again.
After that every container works fine except notes container as it gives below error:

Attaching to tutor_dev_notes_1
notes_1 | Traceback (most recent call last):
notes_1 | File “/edx/app/edx-notes-api/venvs/edx-notes-api/lib/python3.8/site-packages/django/core/management/base.py”, line 354, in run_from_argv
notes_1 | self.execute(*args, **cmd_options)
notes_1 | File “/edx/app/edx-notes-api/venvs/edx-notes-api/lib/python3.8/site-packages/django/core/management/commands/runserver.py”, line 61, in execute
notes_1 | super().execute(*args, **options)
notes_1 | File “/edx/app/edx-notes-api/venvs/edx-notes-api/lib/python3.8/site-packages/django/core/management/base.py”, line 398, in execute
notes_1 | output = self.handle(*args, **options)
notes_1 | File “/edx/app/edx-notes-api/venvs/edx-notes-api/lib/python3.8/site-packages/django/core/management/commands/runserver.py”, line 68, in handle
notes_1 | if not settings.DEBUG and not settings.ALLOWED_HOSTS:
notes_1 | File “/edx/app/edx-notes-api/venvs/edx-notes-api/lib/python3.8/site-packages/django/conf/init.py”, line 82, in getattr
notes_1 | self._setup(name)
notes_1 | File “/edx/app/edx-notes-api/venvs/edx-notes-api/lib/python3.8/site-packages/django/conf/init.py”, line 69, in _setup
notes_1 | self._wrapped = Settings(settings_module)
notes_1 | File “/edx/app/edx-notes-api/venvs/edx-notes-api/lib/python3.8/site-packages/django/conf/init.py”, line 170, in init
notes_1 | mod = importlib.import_module(self.SETTINGS_MODULE)
notes_1 | File “/usr/lib/python3.8/importlib/init.py”, line 127, in import_module
notes_1 | return _bootstrap._gcd_import(name[level:], package, level)
notes_1 | File “”, line 1014, in _gcd_import
notes_1 | File “”, line 991, in _find_and_load
notes_1 | File “”, line 973, in _find_and_load_unlocked
notes_1 | ModuleNotFoundError: No module named ‘notesserver.settings.tutor’

can someone tell me what’s wrong here?

or is there any solution i can do something that i can replace line no:13 of below file with my gitlab url:

The path /edx/app/edx-notes-api looks weird. I’m not quite sure how did you build the image but you are right, the plugin doesn’t allow you to use a fork of edx-notes.

I would suggest that you fork the tutor-notes plugin and attempt to do something similar to other plugins that do allow the usage of forks, like tutor-ecommerce for example. Then you can build the image using tutor images build forum.

Please don’t fork the plugin just to customise it! Instead, could you open a pull request to support custom notes repositories?

@Pratik_Ahir, what @regis is pointing out is important. Once you make sure you can successfully build your image, instead of maintaining a fork, feel free to open a pull request for the tutor-notes plugin, they are very welcome.

Hi @regis and @MoisesGonzalezS, thanks for the reply.

I would say i needed to make a custom image for tutor-notes to add some extra features according to our requiremets i.e. to search and edit notes based on “quote”, currently it is supporting for text and tags params only. please confirm the same so i can open a pull request.

cc @jhony_avella who is the current maintainer of the tutor-notes plugin.

Hi @Pratik_Ahir @regis @MoisesGonzalezS , joining a bit late the conversation. Let’s review the points:

  • As @MoisesGonzalezS pointed out, the path /edx/app/edx-notes-api displayed in your errors is strange since your WORKDIR in the image is /app/edx-notes-api. As we discussed via Slack, could you please add more details about how you’re building the image?
  • As you mentioned, the notes repository and code version of the notes API plugin are not configurable. Following @regis suggestion, you can create a Pull Request to add these variables in the official notes plugin. You should add such variables in the defaults section of the plugin, and then reference them in the Dockerfile template (from what I saw, these variables are not required in any other template). In this way, you could override the variables via the Tutor config.yml file and build notes images with a custom repo and a custom version. I’d be more than happy to review your PR. Please let me know if you have any doubts about how to proceed.

@regis Should this feature be supported in the other plugins (e.g. discovery, e-commerce)?

I think it’s important that we support forking for other plugins, yes. It’s already the case for the ecommerce app: https://github.com/overhangio/tutor-ecommerce/blob/master/tutorecommerce/templates/ecommerce/build/ecommerce/Dockerfile#L25
To be honest I did not expect that people might want to fork the notes app. It’s pretty barebone and lightweight. But @Pratik_Ahir’s feature seems legit. Actually, it should probably be pushed upstream. Did you consider opening a PR on the GitHub - openedx/edx-notes-api: edx-notes-api repo?

@regis I created the PR here, however, I was wondering if the standard should be to set the values as ARG in the Dockerfile (according to Ecommerce example) and override such ARGS when building the image or to add the values as plugin configurations (as I did in my PR). Using the plugin configuration approach would give more visibility and context about the versions used to build the images, what do you think?
cc @Pratik_Ahir

1 Like

Thanks for the PR Jhony! I think your implementation is fine. Let’s discuss directly on the PR.