Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] initial module federation support #3799

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

christianvogt
Copy link
Contributor

https://issues.redhat.com/browse/RHOAIENG-19055

Description

This PR adds support for module federation but has no default configuration. I will be preparing an on cluster demo alongside more instructions on running a local setup. But for now the intent is to ensure that regular dev and production envs continue to work as intended. I don't expect a reviewer to test module federation at this time.

  • Update dotenv to support multiline values
  • Use the MODULE_FEDERATION_CONFIG env var JSON value to add module federation support
  • Adds backend proxy which is only enabled when MODULE_FEDERATION_CONFIG is configured. This proxy is used to route frontend requests for both the federated modules and their API requests.
    • There are no default modules configured and therefore the proxy is not configured in production.
  • Some config tweaks to support module federation
  • Adds script start:dev:mf which will include download type definitions from modules. I'm still experimenting with what is the best approach for working with types.

How Has This Been Tested?

I tested this with a local instance of model registry running which was modified to expose some APIs. Then in ODH used the following configuration.

MODULE_FEDERATION_CONFIG='
[
  {
    "name": "modelRegistry",
    "remoteEntry": "/remoteEntry.js",
    "proxy": [
      {
        "path": "/model-registry/api",
        "pathRewrite": "/api"
      }
    ],
    "local": {
      "host": "localhost",
      "port": 9000
    },
    "service": {
      "name": "model-registry-ui-service",
      "namespace": "kubeflow",
      "port": 80
    }
  }
]
'

ODH was modified to consume the exposed API and render a portion of the model registry in the UI.

Test Impact

N/A

Request review criteria:

Self checklist (all need to be checked):

  • The developer has manually tested the changes and verified that the changes work
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has added tests or explained why testing cannot be added (unit or cypress tests for related changes)

If you have UI changes:

  • Included any necessary screenshots or gifs if it was a UI change.
  • Included tags to the UX team if it was a UI/UX change.

After the PR is posted & before it merges:

  • The developer has tested their solution on a cluster by using the image produced by the PR to main

Copy link
Contributor

openshift-ci bot commented Feb 24, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from christianvogt. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link

codecov bot commented Feb 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.59%. Comparing base (64bc828) to head (efc2244).
Report is 3 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3799      +/-   ##
==========================================
- Coverage   84.60%   84.59%   -0.01%     
==========================================
  Files        1529     1532       +3     
  Lines       35604    35614      +10     
  Branches     9978     9982       +4     
==========================================
+ Hits        30121    30128       +7     
- Misses       5483     5486       +3     
Files with missing lines Coverage Δ
frontend/src/bootstrap.tsx 100.00% <100.00%> (ø)
frontend/src/index.tsx 100.00% <100.00%> (ø)

... and 10 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 64bc828...efc2244. Read the comment docs.

@christianvogt christianvogt changed the title initial module federation support [WIP] initial module federation support Feb 28, 2025
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress This PR is in WIP state label Feb 28, 2025
@christianvogt
Copy link
Contributor Author

christianvogt commented Feb 28, 2025

I'm using multi line dotenv which doesn't work with the make file which is also consuming dotenv files....

Commented out MODULE_FEDERATION_CONFIG for now.

@christianvogt christianvogt force-pushed the init-mf branch 3 times, most recently from 00382c0 to e9a90af Compare February 28, 2025 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/work-in-progress This PR is in WIP state
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant