Skip to content

feat: add volume patches to mfe service and k8s#264

Merged
ahmed-arb merged 5 commits intooverhangio:releasefrom
eduNEXT:afg/tutor-paragon-mfe-integration
Aug 28, 2025
Merged

feat: add volume patches to mfe service and k8s#264
ahmed-arb merged 5 commits intooverhangio:releasefrom
eduNEXT:afg/tutor-paragon-mfe-integration

Conversation

@Ang-m4
Copy link
Copy Markdown
Contributor

@Ang-m4 Ang-m4 commented Jul 29, 2025

Description

This pull request enhances the tutor-mfe plugin by adding the necessary hooks to allow other plugins, such as tutor-paragon, to serve static files using the mfe Caddy service. This is achieved by introducing new volume patches for both local and Kubernetes deployments and updating the service logic for development environments.

Note

For further context, please refer to the following discussion: openedx/openedx-tutor-plugins#38

Key Changes

  • Volume Support for MFE Service:

    • A new mfe-volumes patch has been added to the local Docker Compose service to allow mounting additional volumes.
    • A corresponding mfe-k8s-volumes patch has been added to the Kubernetes deployment configuration.
  • Development Environment Enhancements:
    To support hosting external files even when no MFEs are running in production mode, the dev service logic has been updated:

    1. A default port mapping (8002:8002) is now included to ensure the mfe Caddy container is always accessible from the host.
    2. The conditional check for starting the mfe service now evaluates or MFE_HOST_EXTRA_FILES. This handles the edge case where a user mounts all available MFEs for development (mfe_data.unmounted is empty), but still needs the mfe service to host custom files like those from Paragon.
  • Documentation:
    The README.rst has been updated to include documentation for the new mfe-volumes and mfe-k8s-volumes patch points.

@Ang-m4
Copy link
Copy Markdown
Contributor Author

Ang-m4 commented Jul 29, 2025

@arbrandes, as we discussed last week, it would be great if you could take a look at this.

Comment thread tutormfe/patches/local-docker-compose-dev-services Outdated
@Ang-m4 Ang-m4 requested a review from brian-smith-tcril July 31, 2025 19:07
Copy link
Copy Markdown
Contributor

@DawoudSheraz DawoudSheraz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Please add changelog entry
  • Add a sub-section in README explaining the usage of HOST_EXTRA_FILES configuration. It is not clear from the changes where it will create an impact.

@DawoudSheraz DawoudSheraz moved this from Pending Triage to In review in Tutor project management Aug 4, 2025
@Ang-m4
Copy link
Copy Markdown
Contributor Author

Ang-m4 commented Aug 4, 2025

Hi @DawoudSheraz,
Thanks again for your review! I’ve updated the PR with the requested changes and added a README sub‑section that explains how to use the HOST_EXTRA_FILES configuration and where it will take effect. These changes are especially helpful for the Paragon plugin we are working on.

Let me know if this meets your expectations or if any further tweaks are needed.

Comment thread changelog.d/20250804_101420_andres.giraldo_tutor_paragon_mfe_integration.md Outdated
@Ang-m4 Ang-m4 force-pushed the afg/tutor-paragon-mfe-integration branch from 0265e5d to f78d87f Compare August 4, 2025 19:48
Copy link
Copy Markdown
Contributor

@DawoudSheraz DawoudSheraz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's create this PR against release branch. main branch is supposed to contain changes for next release, breaking changes, etc. This is a new feature that does not impact any existing functionality. We can add it in release so anyone using the current tutor version (V20) can also benefit from it.

@DawoudSheraz DawoudSheraz requested review from arbrandes and removed request for brian-smith-tcril August 5, 2025 10:50
@Ang-m4 Ang-m4 changed the base branch from main to release August 5, 2025 11:29
Comment thread tutormfe/patches/local-docker-compose-dev-services
Copy link
Copy Markdown
Collaborator

@arbrandes arbrandes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm approving this, but will hold off merging until @DawoudSheraz has no more concerns.

Copy link
Copy Markdown
Contributor

@DawoudSheraz DawoudSheraz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A small doc update before the merge is needed.

@brian-smith-tcril
Copy link
Copy Markdown
Contributor

@DawoudSheraz could you elaborate on what you feel is missing from the README?

The intro to the new "Hosting extra static files" section doesn't say anything that implies to me that an MFE must be mounted (as opposed to be hosted as a static bundle)

The MFE plugin allows other plugins to serve extra static files through the MFE service. This enables hosting custom assets (CSS, images, JavaScript, themes, etc.) directly alongside MFE applications, without rebuilding the core MFE image. Assets are exposed via a dedicated volume, so updates can be deployed dynamically via simple pushes to that volume, speeding up tests and updates without full-image builds.

@DawoudSheraz
Copy link
Copy Markdown
Contributor

@DawoudSheraz could you elaborate on what you feel is missing from the README?

The intro to the new "Hosting extra static files" section doesn't say anything that implies to me that an MFE must be mounted (as opposed to be hosted as a static bundle)

The MFE plugin allows other plugins to serve extra static files through the MFE service. This enables hosting custom assets (CSS, images, JavaScript, themes, etc.) directly alongside MFE applications, without rebuilding the core MFE image. Assets are exposed via a dedicated volume, so updates can be deployed dynamically via simple pushes to that volume, speeding up tests and updates without full-image builds.

Right. It might be due to a lack of context/understanding of all this. The newly added volume patches are clear as they are the ones serving the actual assets. For the config variable,

In readme, we can have two sub-sections, one for dev and one for local/deployment. Re-iterating my understanding, the config is needed for dev (alongside patches) and the config is not needed for local/prod since nothing is mounted in that context (usually). The current readme has everything in one section and gives the impression that one needs both config and patches to make it work.

@brian-smith-tcril
Copy link
Copy Markdown
Contributor

@Ang-m4 - based on @DawoudSheraz's latest comment it sounds like the logic in this PR isn't quite right. It was my understanding that we only wanted to host the extra files when MFE_HOST_EXTRA_FILES was set, and it seems that is not what the code is doing.

@Ang-m4
Copy link
Copy Markdown
Contributor Author

Ang-m4 commented Aug 22, 2025

@brian-smith-tcril, @DawoudSheraz, You’re right, the current logic does need a few adjustments. I’ll also take the chance to make the README clearer, especially around when the config is actually required.

Thanks for pointing this out, I’ll update the PR shortly.

@Ang-m4 Ang-m4 requested a review from DawoudSheraz August 25, 2025 14:43
@Ang-m4
Copy link
Copy Markdown
Contributor Author

Ang-m4 commented Aug 25, 2025

I’ve just adjusted the logic so that hosting extra files in all environments is always controlled by the MFE_HOST_EXTRA_FILES setting. This way, the files will only be served when the setting is explicitly enabled, and in development it will also expose port 8002 for direct access.

I also updated the README to reflect this behavior more clearly, so it now matches what the setting actually does.

@DawoudSheraz DawoudSheraz requested a review from ahmed-arb August 26, 2025 05:54
@sarina
Copy link
Copy Markdown
Contributor

sarina commented Aug 27, 2025

Hi @DawoudSheraz @ahmed-arb could you let us know what the next steps are in the review process? We're eager to finish out the project of supporting design tokens in Tutor.

@DawoudSheraz
Copy link
Copy Markdown
Contributor

Hi @DawoudSheraz @ahmed-arb could you let us know what the next steps are in the review process? We're eager to finish out the project of supporting design tokens in Tutor.

Hi. This will be merged as soon as @ahmed-arb completes the review.

Copy link
Copy Markdown
Contributor

@ahmed-arb ahmed-arb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thank you, Andres, for your contribution.

@ahmed-arb ahmed-arb merged commit b4a783a into overhangio:release Aug 28, 2025
2 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in Tutor project management Aug 28, 2025
brian-smith-tcril pushed a commit to brian-smith-tcril/tutor-mfe that referenced this pull request Sep 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

7 participants