Hi Adolfo, thanks for your reply. Perhaps we need to break this out into a separate topic, something like “Tutor [Palm]: How to bind-mount a local MFE folder”
I have tried a few different approaches to get this working successfully, and have had no luck… yet.
tutor config save --append MOUNTS=/path/to/my/local/mfe/profile
tutor dev launch
and also
tutor mounts add /path/to/my/local/mfe/profile
tutor dev launch
In both instances, I see my config.yml has the following:
Hi @arbrandes thanks for your quick response. I’m running Tutor 16.0.2.
I figured out why it wasn’t working for me - when I created the MFE forks for my org, I changed the name of the fork to something other than frontend-app-profile, etc. If the name doesn’t exactly match the upstream repo letter-for-letter, word-for-word, the bind-mount simply won’t work.
Also, because the documentation for frontend-app-profile says devstack needs to be started first, I assumed the same should be true for tutor. Instead, one has to start the local MFE first with npm run start and once it’s running, follow up with tutor dev launch.
I think it would be good to update the documentation for the tutor MFE plugin, as well as each individual MFE, to include more specific details about what missteps to avoid, and how to get everything running. To that end, I’ll work on a series of pull requests to help that along. I’ll follow up here once they’re ready for review.
That’s correct, and as you mention below, likely warrants an update to the docs if it’s not clear enough.
As far as I know, tutor-mfe won’t actually use the npm run started node that’s running outside the container, but I imagine this works because as part of npm run start the MFE gets re-built. In any case, what I’m trying to say is that npm run start shouldn’t be necessary.
@rediris after mounting edx-platfrom successfully in Quince I will try the same way to mount the learner dashboard but I am facing this issue. I also checked Docker and I don’t think there is a problem there.
tutor mounts add /home/yagnesh/tvm-quin/frontend-app-learner-dashboard
tutor dev launch
[v17.0.0@tvm-quin] yagnesh@DSK-DEL-00001:~/tvm-quin$ tutor mounts list
- name: /home/yagnesh/tvm-quin/edx-platform
build_mounts:
- image: openedx
context: edx-platform
- image: openedx-dev
context: edx-platform
compose_mounts:
- service: openedx
container_path: /openedx/edx-platform
[v17.0.0@tvm-quin] yagnesh@DSK-DEL-00001:~/tvm-quin$ tutor mounts add /home/yagnesh/tvm-quin/frontend-app-learner-dashboard
Adding bind-mount: /home/yagnesh/tvm-quin/frontend-app-learner-dashboard
Configuration saved to /home/yagnesh/tvm-quin/config.yml
Environment generated in /home/yagnesh/tvm-quin/env
[v17.0.0@tvm-quin] yagnesh@DSK-DEL-00001:~/tvm-quin$ tutor dev start -d
docker compose -f /home/yagnesh/tvm-quin/env/local/docker-compose.yml -f /home/yagnesh/tvm-quin/env/local/docker-compose.prod.yml --project-name tutor_local stop
docker compose -f /home/yagnesh/tvm-quin/env/local/docker-compose.yml -f /home/yagnesh/tvm-quin/env/dev/docker-compose.yml --project-name tutor_dev up --remove-orphans -d
[+] Running 0/1
⠿ learner-dashboard Error 2.6s
Error response from daemon: pull access denied for overhangio/openedx-learner-dashboard-dev, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
Error: Command failed with status 18: docker compose -f /home/yagnesh/tvm-quin/env/local/docker-compose.yml -f /home/yagnesh/tvm-quin/env/dev/docker-compose.yml --project-name tutor_dev up --remove-orphans -d
[v17.0.0@tvm-quin] yagnesh@DSK-DEL-00001:~/tvm-quin$ tutor dev launch
it means that i cant make my own mfe? because i used tutor mounts add path/to/my/new_mfe tutor images build mfe tutor dev launch
and my new mfe simple does not appear in the list
If I’m reading this properly, you are attempting to use port 2001 twice? Try giving your custom MFE a unique port number that doesn’t conflict with an existing MFE port.
Hi,
Are you creating a completely new, unique MFE? Or are you attempting to bind mount a customized fork of an existing MFE? If the latter, your fork absolutely must follow the naming convention of the parent repository.
Presumably you created a plugin to add your MFE, according to the Tutor MFE instructions ? If so, please paste in the code of your plugin for the community to better help you.
Im creating a completely new MFE, the code are in this repo
using this snnipet it works
from tutormfe.hooks import MFE_APPS
@MFE_APPS.add()
def _add_my_mfe(mfes):
mfes["mymfe"] = {
"repository": "https://github.com/myorg/mymfe.git",
"port": 2001,
"version": "me/my-custom-branch-or-tag", # optional, will default to the Open edX current tag.
}
return mfes
Be sure your plugin is activated and do a tutor config save
It isn’t clear in the instructions, but running tutor images build mfe only builds the MFE image for tutor local mode, and the image contains all of the MFEs combined. For tutor dev mode, each of the MFEs have their own image built. And if you’re bind-mounting an MFE, there is no need to build the image manually.
For future reference, if you’re running tutor in dev mode (and not bind-mounting), you’d build your MFE by appending -dev to the image name, like this: tutor images build attendence-dev or tutor images build authn-dev, etc.
Check your config.yml file. The MOUNTS should looks like:
MOUNTS:
- path/to/frontend-app-attendence
Note: the actual directory matches the full name of the repo.
Before you run the tutor dev launch, be sure to run npm install in the root of your new MFE.
What happens when you do a tutor images build frontend-app-attendence-dev --no-cache --no-registry-cache?
As an aside, it might be worth doing a search for attendence inside your local tutor/env directory. Your MFE should be referenced in the following env files:
/env/apps/openedx/settings/lms/development.py
/env/dev/docker-compose.yml
/env/plugins/mfe/apps/mfe/Caddyfile
/env/plugins/mfe/build/mfe/Dockerfile
In my case, I have a custom course-about MFE working as expected as a bind-mount, and the MFE is referenced in each of the files I listed above.