How do you configure tutor-mfe?

I’m trying to configure basic settings for the tutor-mfe plugin but many of these settings seem to be ignored:

pip install tutor-mfe
tutor plugins enable mfe
tutor config save --set MFE_DOCKER_IMAGE=${ECR_REGISTRY}/${ECR_REPOSITORY}:${REPOSITORY_TAG} \
                  --set MFE_HOST=${PROTOCOL}apps.${BASE_DOMAIN} \
                  --set MFE_BASE_URL=$MFE_HOST \
                  --set MFE_LMS_HOST=$BASE_DOMAIN \
                  --set MFE_LMS_BASE_URL=${PROTOCOL}${BASE_DOMAIN} \
                  --set MFE_CREDENTIALS_BASE_URL=${PROTOCOL}credentials.${BASE_DOMAIN} \
                  --set MFE_ECOMMERCE_BASE_URL=${PROTOCOL}ecommerce.${BASE_DOMAIN} \
                  --set MFE_ORDER_HISTORY_URL=${PROTOCOL}orders.${BASE_DOMAIN} \
                  --set MFE_DISCOVERY_HOST=discovery.${BASE_DOMAIN} \
                  --set MFE_DISCOVERY_API_BASE_URL=${PROTOCOL}discovery.${BASE_DOMAIN} \
                  --set MFE_STUDIO_BASE_URL=${PROTOCOL}studio.${BASE_DOMAIN} \
                  --set MFE_MARKETING_SITE_BASE_URL=$BASE_URL \
                  --set MFE_SITE_NAME="${MFE_SITE_NAME}" \
                  --set MFE_PLATFORM_NAME="${MFE_PLATFORM_NAME}" \
                  --set MFE_FAVICON_URL=$MFE_FAVICON_URL \
                  --set MFE_LOGO_WHITE_URL=$MFE_LOGO_WHITE_URL \
                  --set MFE_LOGO_TRADEMARK_URL=$MFE_LOGO_TRADEMARK_URL \
                  --set MFE_LOGO_URL=$MFE_LOGO_URL

what am I doing wrong?

2 Likes

This is probably a hacky solution, but, i got past this problem by creating my own production configuration file for mfe and then copying it, as follows:

          pip install tutor-mfe
          tutor plugins enable mfe
          tutor config save --set MFE_DOCKER_IMAGE=${ECR_REGISTRY}/${ECR_REPOSITORY}:${REPOSITORY_TAG}
          cp my_production_config "$(tutor config printroot)/env/plugins/mfe/build/mfe/env/production"

Here is a link to my exact Github Actions workflow if you’re interested: usf_build_mfe_image.yml

1 Like

Not all of the configuration you are trying to change above are tutorconfig params… some of them is env variables, for production or development.
If you see last line of each file has {{ patch("mfe-env-production") }} or {{ patch("mfe-env-development") }}. So this means to on way to override any would be to create a tutor plugin file, which is typically done as a yaml file (deprecated v0). e.g…

To change the MFEs logos from the default to your own logos, override the corresponding settings in the MFEs environment using patches mfe-env-production and mfe-env-development. For example, using the following plugin:

name: mfe_branding_plugin
version: 0.1.0
patches:
mfe-env-development: |
LOGO_URL=/logo.svg
LOGO_TRADEMARK_URL=/logo-trademark.svg
LOGO_WHITE_URL=/logo-white.svg
FAVICON_URL=/favicon.ico
mfe-env-production: |
LOGO_URL=/logo.svg
LOGO_TRADEMARK_URL=/logo-trademark.svg
LOGO_WHITE_URL=/logo-white.svg
FAVICON_URL=/favicon.ico
[1]


  1. GitHub - overhangio/tutor-mfe: This plugin makes it possible to easily add micro frontend (MFE) applications on top of an Open edX platform that runs with Tutor. ↩︎

2 Likes

what would i do with this file? how is it executed, or applied to the configuration? i saw this in the plugin README, but there is no explanation about how to actually create a patch, nor what you’re supposed to do with it once you’ve created it.

Yes I guess the documenation assumes you know about plugin file, it shuold ideally have a link to this Getting started with plugin development — Tutor documentation

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.