Skip to content

Commit b92a462

Browse files
committed
feat: Integrate model registry via dynamic module federation
1 parent 10b414d commit b92a462

11 files changed

+50
-9
lines changed

frontend/config/webpack.common.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ const path = require('path');
33
const HtmlWebpackPlugin = require('html-webpack-plugin');
44
const CopyPlugin = require('copy-webpack-plugin');
55
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
6+
const webpack = require('webpack');
67
const { setupWebpackDotenvFilesForEnv } = require('./dotenv');
78
const GenerateExtensionsPlugin = require('./generateExtensionsPlugin');
9+
const { moduleFederationConfig, moduleFederationPlugins } = require('./moduleFederation');
810

911
const RELATIVE_DIRNAME = process.env._ODH_RELATIVE_DIRNAME;
1012
const IS_PROJECT_ROOT_DIR = process.env._ODH_IS_PROJECT_ROOT_DIR;
@@ -232,6 +234,10 @@ module.exports = (env) => ({
232234
new MonacoWebpackPlugin({
233235
languages: ['yaml'],
234236
}),
237+
new webpack.EnvironmentPlugin({
238+
MF_CONFIG: JSON.stringify(moduleFederationConfig),
239+
}),
240+
...moduleFederationPlugins,
235241
],
236242
resolve: {
237243
extensions: ['.js', '.ts', '.tsx', '.jsx'],

frontend/config/webpack.dev.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/* eslint-disable @typescript-eslint/restrict-template-expressions */
22
const { execSync } = require('child_process');
33
const path = require('path');
4-
const webpack = require('webpack');
54
const { merge } = require('webpack-merge');
65
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
76
const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin');
@@ -12,7 +11,7 @@ const smp = new SpeedMeasurePlugin({ disable: !process.env.MEASURE });
1211

1312
setupDotenvFilesForEnv({ env: 'development' });
1413
const webpackCommon = require('./webpack.common.js');
15-
const { moduleFederationConfig, moduleFederationPlugins } = require('./moduleFederation');
14+
const { moduleFederationConfig } = require('./moduleFederation');
1615

1716
const RELATIVE_DIRNAME = process.env._ODH_RELATIVE_DIRNAME;
1817
const IS_PROJECT_ROOT_DIR = process.env._ODH_IS_PROJECT_ROOT_DIR;
@@ -166,10 +165,6 @@ module.exports = smp.wrap(
166165
plugins: [
167166
new ForkTsCheckerWebpackPlugin(),
168167
new ReactRefreshWebpackPlugin({ overlay: false }),
169-
new webpack.EnvironmentPlugin({
170-
MF_CONFIG: JSON.stringify(moduleFederationConfig),
171-
}),
172-
...moduleFederationPlugins,
173168
],
174169
},
175170
),

manifests/packages/model-registry/base/model-registry-ui-deployment.yaml renamed to frontend/packages/model-registry/manifests/base/model-registry-ui-deployment.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ spec:
1313
metadata:
1414
labels:
1515
app: model-registry-ui
16-
spec:
16+
spec:
1717
serviceAccountName: model-registry-ui
1818
securityContext:
1919
seccompProfile:
@@ -53,8 +53,10 @@ spec:
5353
ports:
5454
- containerPort: 8080
5555
args:
56-
- "--standalone-mode=false"
57-
- "--default-platform=true"
56+
- "--deployment-mode=federated"
57+
- "--auth-method=user_token"
58+
- "--auth-token-header=x-forwarded-access-token"
59+
- "--auth-token-prefix="
5860
- "--port=8080"
5961
securityContext:
6062
allowPrivilegeEscalation: false

manifests/core-bases/base/deployment.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ spec:
3131
imagePullPolicy: Always
3232
ports:
3333
- containerPort: 8080
34+
env:
35+
- name: MODULE_FEDERATION_CONFIG
36+
valueFrom:
37+
configMapKeyRef:
38+
name: federation-config
39+
key: module-federation-config.json
3440
resources:
3541
requests:
3642
cpu: 500m
@@ -135,6 +141,9 @@ spec:
135141
name: odh-ca-cert
136142
subPath: odh-ca-bundle.crt
137143
volumes:
144+
- name: federation-config
145+
configMap:
146+
name: federation-config
138147
- name: proxy-tls
139148
secret:
140149
secretName: dashboard-proxy-tls

0 commit comments

Comments
 (0)