-
Notifications
You must be signed in to change notification settings - Fork 67
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
update frontend to support module federation #798
Open
christianvogt
wants to merge
2
commits into
kubeflow:main
Choose a base branch
from
christianvogt:mf-config-ui
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,56 @@ | ||||||||||||
# Set up local development with kubeflow | ||||||||||||
|
||||||||||||
**Note: this should only be needed in edge cases in which we need to test a local integration with the kubeflow dashboard.** | ||||||||||||
|
||||||||||||
## Prerequisites | ||||||||||||
|
||||||||||||
- [Kubeflow repo](https://github.com/kubeflow/kubeflow/tree/master/components/centraldashboard#development) | ||||||||||||
- [Model Registry repo](../README.md) | ||||||||||||
|
||||||||||||
## Setup | ||||||||||||
|
||||||||||||
### Kubeflow repo (under centraldashboard) | ||||||||||||
|
||||||||||||
1. Change the [webpack config](https://github.com/kubeflow/kubeflow/blob/master/components/centraldashboard/webpack.config.js#L186) proxies to allow Model Registry: | ||||||||||||
|
||||||||||||
```javascript | ||||||||||||
proxy: { | ||||||||||||
... | ||||||||||||
'/model-registry': { | ||||||||||||
target: 'http://localhost:9000', | ||||||||||||
changeOrigin: true, | ||||||||||||
ws: true, | ||||||||||||
secure: false, | ||||||||||||
}, | ||||||||||||
}, | ||||||||||||
``` | ||||||||||||
|
||||||||||||
2. Run the centraldashboard: | ||||||||||||
|
||||||||||||
```shell | ||||||||||||
npm run dev | ||||||||||||
``` | ||||||||||||
|
||||||||||||
### Model Registry repo | ||||||||||||
|
||||||||||||
1. Just run the repo in kubeflow dev mode | ||||||||||||
|
||||||||||||
```shell | ||||||||||||
make dev-start-kubeflow | ||||||||||||
``` | ||||||||||||
|
||||||||||||
### Access the cluster | ||||||||||||
|
||||||||||||
You need to have a kubeflow cluster up and running, to get the Model Registry working you'll need to port-forward these two services: | ||||||||||||
|
||||||||||||
```shell | ||||||||||||
kubectl port-forward service/model-registry-service 8085:8080 -n <targeted-namespace-of-the-mr-service> | ||||||||||||
``` | ||||||||||||
|
||||||||||||
```shell | ||||||||||||
kubectl port-forward svc/profiles-kfam 8081:8081 -n kubeflow | ||||||||||||
``` | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||
|
||||||||||||
After setting up port forwarding, you can access the UI by navigating to: | ||||||||||||
|
||||||||||||
http://localhost:8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
const path = require('path'); | ||
const { ModuleFederationPlugin } = require('@module-federation/enhanced/webpack'); | ||
|
||
const deps = require('../package.json').dependencies; | ||
|
||
const moduleFederationConfig = { | ||
name: 'modelRegistry', | ||
filename: 'remoteEntry.js', | ||
shared: { | ||
react: { singleton: true, eager: true, requiredVersion: deps.react }, | ||
'react-dom': { singleton: true, eager: true, requiredVersion: deps['react-dom'] }, | ||
'react-router': { singleton: true, eager: true, requiredVersion: deps['react-router'] }, | ||
'react-router-dom': { singleton: true, eager: true, requiredVersion: deps['react-router-dom'] }, | ||
}, | ||
exposes: { | ||
// TODO expose modules. eg: | ||
// './index': './src/plugin/index.tsx', | ||
// './plugin': './src/plugin/index.tsx', | ||
}, | ||
// For module federation to work when optimization.runtimeChunk="single": | ||
// See https://github.com/webpack/webpack/issues/18810 | ||
runtime: false, | ||
}; | ||
|
||
module.exports = { | ||
moduleFederationPlugins: [new ModuleFederationPlugin(moduleFederationConfig)], | ||
}; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the commands in all the
clients/ui/docs
are relative to theclients/ui
dir