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

Catchup Incubation #2785

Merged
merged 101 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
ec54a18
Unit Test Case for useDraggableTable
uidoyen Feb 27, 2024
04f38d8
Merge pull request #2540 from uidoyen/RHOAIENG-2120
openshift-merge-bot[bot] Apr 19, 2024
4afdcf4
add support to run tests with different user permissions
christianvogt Apr 18, 2024
433ba96
start webpack dev server with external cluster target
christianvogt Apr 19, 2024
b108a23
MetricsCommonContext (DW and Model Serving): Persist refresh interval…
mturley Apr 19, 2024
0542180
Merge pull request #2727 from christianvogt/user-utils
openshift-merge-bot[bot] Apr 22, 2024
a6d19ae
[RHOAIENG-5491] Landing page: Info section about AI flows
jeff-phillips-18 Apr 18, 2024
1dc6586
chore(DW): 5294 refactor resourceUsageBar
gitdallas Apr 17, 2024
1e3b295
Merge pull request #2723 from jeff-phillips-18/home-page-ai-flows
openshift-merge-bot[bot] Apr 22, 2024
9014a05
Merge pull request #2721 from gitdallas/chore/refactor-workloadResour…
openshift-merge-bot[bot] Apr 22, 2024
55a735f
Use project display names in DW, move related utils from ~/pages/proj…
mturley Apr 19, 2024
1b3cdfe
chore(dw): move getWorkloadName to util
gitdallas Apr 19, 2024
126b18a
chore(dw): refactor the way otherUsage is handled
gitdallas Apr 19, 2024
a9d75ef
chore(dw): requested resources always show tooltip
gitdallas Apr 22, 2024
017d2bd
Add cypress test for Administration tab
ppadti Apr 18, 2024
d5464e3
Merge pull request #2724 from ppadti/administration-page
openshift-merge-bot[bot] Apr 23, 2024
addff72
[RHOAIENG-5488] New landing page: Projects section - Empty state
jeff-phillips-18 Apr 18, 2024
2ca9a6b
Merge pull request #2738 from jeff-phillips-18/home-page-init-projects
openshift-merge-bot[bot] Apr 23, 2024
d155ef5
Merge pull request #2731 from mturley/RHOAIENG-5291-dw-project-name
openshift-merge-bot[bot] Apr 23, 2024
dc9ba6e
[RHOAIENG-5489] Home page: projects w/ tiles
jeff-phillips-18 Apr 23, 2024
6391d08
Merge pull request #2741 from jeff-phillips-18/home-page-projects
openshift-merge-bot[bot] Apr 24, 2024
5e2a77d
added user management
pnaik1 Apr 19, 2024
5a3a6b2
Merge pull request #2728 from pnaik1/userManagement
openshift-merge-bot[bot] Apr 24, 2024
e95ddfd
Change the resource handling to InferenceServices
lucferbux Feb 7, 2024
c150dcb
Add pagination utility
ppadti Apr 25, 2024
a5f2e28
Merge pull request #2734 from christianvogt/dev-ext-cluster
openshift-merge-bot[bot] Apr 25, 2024
cf7c476
[RHOAIENG-5495] Landing page: resources section
jeff-phillips-18 Apr 23, 2024
9f4e577
Merge pull request #2735 from gitdallas/chore/dw-move-getWorkloadName…
openshift-merge-bot[bot] Apr 25, 2024
7dc2441
Merge pull request #2739 from gitdallas/chore/dw-show-card-tooltip-al…
openshift-merge-bot[bot] Apr 25, 2024
5499266
Merge pull request #2732 from mturley/RHOAIENG-5290-persist-refresh-i…
openshift-merge-bot[bot] Apr 25, 2024
e5415d2
additional cypress test case for pipeline detail
pnaik1 Apr 25, 2024
5c3dfe6
chore(dw): factor out row renderer
gitdallas Apr 18, 2024
bde54c0
chore(dw): workloadtable factor out row renderer
gitdallas Apr 18, 2024
4581e05
chore(dw): workloadtable factor out columns
gitdallas Apr 18, 2024
1a3516d
Merge pull request #2743 from jeff-phillips-18/home-page-resources
openshift-merge-bot[bot] Apr 26, 2024
bd85176
Merge pull request #2726 from gitdallas/chore/dw-refactor-resource-me…
openshift-merge-bot[bot] Apr 26, 2024
6a01813
DW: Consistently show resource usage for finished workloads that are …
mturley Apr 19, 2024
154efd0
Merge pull request #2736 from mturley/RHOAIENG-5289-spinning-down-res…
openshift-merge-bot[bot] Apr 26, 2024
eb05635
Jupyter tile, merge cert info from old notebook to avoid loss
andrewballantyne Apr 26, 2024
75efea8
Merge pull request #2750 from andrewballantyne/merge-better-jupyter-n…
openshift-merge-bot[bot] Apr 26, 2024
c588d19
[RHOAIENG-6519] DW: Support workloads owned by either a RayCluster or…
mturley Apr 26, 2024
9af23c9
Merge pull request #2754 from mturley/RHOAIENG-6519-replace-usage-pro…
openshift-merge-bot[bot] Apr 26, 2024
1a45d69
Model versions table and empty state
manaswinidas Apr 29, 2024
c6e667c
[RHOAIENG-5492] Landing page: admin section
jeff-phillips-18 Apr 23, 2024
b1905a0
Merge pull request #2749 from manaswinidas/model-versions
openshift-merge-bot[bot] Apr 29, 2024
357bb44
Fix administartion test
ppadti Apr 29, 2024
5c0037b
Merge pull request #2746 from pnaik1/pipeline-detail
openshift-merge-bot[bot] Apr 29, 2024
5485d10
Merge pull request #2757 from ppadti/fix-administration-test
openshift-merge-bot[bot] Apr 29, 2024
4ed7400
Add permissions to dashboard serviceaccount to fetch dsci and added e…
lucferbux Apr 29, 2024
380134f
Merge pull request #2758 from lucferbux/rhoaieng-6578
openshift-merge-bot[bot] Apr 29, 2024
4094cf4
update anaconda image
trujillm Apr 29, 2024
d9e7720
Merge pull request #2756 from trujillm/main
openshift-merge-bot[bot] Apr 29, 2024
457c82f
Merge pull request #2748 from jeff-phillips-18/home-page-admin
openshift-merge-bot[bot] Apr 29, 2024
c9eda61
[RHOAIENG-2977] Artifacts table
jpuzz0 Apr 29, 2024
9d58a69
Merge pull request #2744 from jpuzz0/RHOAIENG-2977-artifacts-table
openshift-merge-bot[bot] Apr 29, 2024
155d5b0
Exections empty state and table
DaoDaoNoCode Apr 26, 2024
84ac502
Merge pull request #2753 from DaoDaoNoCode/jira-rhoaieng-4776
openshift-merge-bot[bot] Apr 29, 2024
f838b34
[RHOAIENG-5496] Landing page: New home page hint
jeff-phillips-18 Apr 29, 2024
ab0d1b5
Merge pull request #2752 from jeff-phillips-18/home-page-hint
openshift-merge-bot[bot] Apr 30, 2024
93a3c0a
Refactor model registry routes and configuration in ModelRegistryCore…
lucferbux Apr 18, 2024
50ff78b
[RHOAIENG-6322] Use constants for colors on images in AI Flows
jeff-phillips-18 Apr 30, 2024
ed32e98
[RHOAIENG-6606] Correctly nav to application from Jupyter card
jeff-phillips-18 Apr 29, 2024
9fde61f
Merge pull request #2745 from ppadti/test-pagination
openshift-merge-bot[bot] Apr 30, 2024
6af67f5
Merge pull request #2759 from jeff-phillips-18/notebook-page-fix
openshift-merge-bot[bot] Apr 30, 2024
6809b4d
Merge pull request #2763 from jeff-phillips-18/landing-page-images
openshift-merge-bot[bot] Apr 30, 2024
3aa9f3b
Merge pull request #2747 from lucferbux/rhoaieng-5141
openshift-merge-bot[bot] Apr 30, 2024
5d57671
[RHOAIENG-6321] Home Page Microcopy Updates
jeff-phillips-18 Apr 30, 2024
95fb721
Merge pull request #2764 from jeff-phillips-18/home-page-content
openshift-merge-bot[bot] Apr 30, 2024
ea23ed0
Initial content of model details tab with stub editable fields and ta…
mturley Apr 24, 2024
1b56d25
Merge pull request #2760 from mturley/RHOAIENG-2235-model-details-sec…
openshift-merge-bot[bot] May 1, 2024
45707b4
Create cypress test for Notebook server tab
uidoyen Apr 24, 2024
ce57961
Update ProjectList Cypress test
ashley-o0o May 2, 2024
66de3d8
test for PipelineJob details action and drawer
uidoyen Apr 30, 2024
e7bb999
Merge pull request #2733 from ashley-o0o/cypress/ProjectList3836
openshift-merge-bot[bot] May 2, 2024
007a425
Merge pull request #2742 from uidoyen/RHOAIENG-3918
openshift-merge-bot[bot] May 2, 2024
c8e4f14
Update global pipelines cypress test
ppadti Apr 29, 2024
774ba1e
[RHOAIENG-6510] Landing page section flow Improvements
jeff-phillips-18 May 1, 2024
d659c03
feat(pipelines): support groups in topology view
jenny-s51 Apr 3, 2024
b100e97
Merge pull request #2725 from jenny-s51/supportPipelineGroups
openshift-merge-bot[bot] May 3, 2024
25f43a4
Merge pull request #2771 from ppadti/pipeline-page-3820
openshift-merge-bot[bot] May 3, 2024
1aab9db
Merge pull request #2761 from uidoyen/RHOAIENG-4730
openshift-merge-bot[bot] May 3, 2024
a22e785
Add execution details page
DaoDaoNoCode May 2, 2024
521f401
Merge pull request #2772 from DaoDaoNoCode/jira-rhoaieng-4778
openshift-merge-bot[bot] May 3, 2024
8de8532
Model version view
dpanshug May 3, 2024
77b2e89
Remove step status icon on pipeline run log containers
DaoDaoNoCode May 3, 2024
3db6a04
Merge pull request #2775 from DaoDaoNoCode/jira-rhoaieng-3828
openshift-merge-bot[bot] May 3, 2024
9884eb9
chore(dw): improve charts look and feel
gitdallas Apr 26, 2024
0caa9d3
Merge pull request #2762 from gitdallas/chore/dw-improve-charts
openshift-merge-bot[bot] May 3, 2024
339060a
Merge pull request #2774 from dpanshug/model-version-view
openshift-merge-bot[bot] May 3, 2024
76bea1b
[RHOAIENG-2987] Artifacts - Details Page
jpuzz0 May 3, 2024
ba52843
Merge pull request #2765 from jpuzz0/RHOAIENG-2987-artifacts-detail-page
openshift-merge-bot[bot] May 3, 2024
bbe19c1
Merge pull request #2737 from lucferbux/rhoaieng-340
openshift-merge-bot[bot] May 6, 2024
8d6da65
Merge pull request #2768 from jeff-phillips-18/home-page-sections
openshift-merge-bot[bot] May 6, 2024
a679a6b
Fix unit test date - Artifacts table
jpuzz0 May 6, 2024
424378e
Merge pull request #2777 from jpuzz0/fix/update-unit-test-date
openshift-merge-bot[bot] May 6, 2024
c33308a
Update PipelineRun details test
ashley-o0o May 3, 2024
cc57071
add env var to support rhods-dashboard for start:dev:ext
christianvogt May 7, 2024
6d96e0d
[RHOAIENG-6880] Disable homePage feature flag for RHOAI deployments
jeff-phillips-18 May 7, 2024
4e0d064
Merge pull request #2784 from jeff-phillips-18/home-page-fix
openshift-merge-bot[bot] May 7, 2024
62b5097
Merge pull request #2776 from ashley-o0o/cypress/PipelinesTopology4729
openshift-merge-bot[bot] May 8, 2024
070fe7e
Merge pull request #2783 from christianvogt/rhods-ext
openshift-merge-bot[bot] May 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions backend/src/routes/api/notebooks/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ export const enableNotebook = async (
const url = request.headers.origin;

try {
await getNotebook(fastify, notebookNamespace, name);
return await updateNotebook(fastify, username, url, notebookData);
const notebook = await getNotebook(fastify, notebookNamespace, name);
return await updateNotebook(fastify, username, url, notebookData, notebook);
} catch (e) {
if (e.response?.statusCode === 404) {
return await createNotebook(fastify, username, url, notebookData);
Expand Down
46 changes: 22 additions & 24 deletions backend/src/routes/api/service/modelregistry/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,29 @@ import { DEV_MODE } from '../../../../utils/constants';
import { getParam, setParam } from '../../../../utils/proxy';

export default async (fastify: KubeFastifyInstance): Promise<void> => {
if (DEV_MODE) {
fastify.register(httpProxy, {
upstream: '',
prefix: '/:name',
rewritePrefix: '',
replyOptions: {
// preHandler must set the `upstream` param
getUpstream: (request) => getParam(request, 'upstream'),
},
preHandler: (request, _, done) => {
const name = getParam(request, 'name');
fastify.register(httpProxy, {
upstream: '',
prefix: '/:name',
rewritePrefix: '',
replyOptions: {
// preHandler must set the `upstream` param
getUpstream: (request) => getParam(request, 'upstream'),
},
preHandler: (request, _, done) => {
const name = getParam(request, 'name');

const upstream = DEV_MODE
? // Use port forwarding for local development:
// kubectl port-forward -n <namespace> svc/<service-name> <local.port>:<service.port>
`http://${process.env.MODEL_REGISTRY_SERVICE_HOST}:${process.env.MODEL_REGISTRY_SERVICE_PORT}`
: // Construct service URL
`http://${name}.odh-model-registries.svc.cluster.local:8080`;
const upstream = DEV_MODE
? // Use port forwarding for local development:
// kubectl port-forward -n <namespace> svc/<service-name> <local.port>:<service.port>
`http://${process.env.MODEL_REGISTRY_SERVICE_HOST}:${process.env.MODEL_REGISTRY_SERVICE_PORT}`
: // Construct service URL
`http://${name}.odh-model-registries.svc.cluster.local:8080`;

// assign the `upstream` param so we can dynamically set the upstream URL for http-proxy
setParam(request, 'upstream', upstream);
// assign the `upstream` param so we can dynamically set the upstream URL for http-proxy
setParam(request, 'upstream', upstream);

fastify.log.info(`Proxy ${request.method} request ${request.url} to ${upstream}`);
done();
},
});
}
fastify.log.info(`Proxy ${request.method} request ${request.url} to ${upstream}`);
done();
},
});
};
26 changes: 25 additions & 1 deletion backend/src/utils/notebookUtils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { getDashboardConfig } from './resourceUtils';
import { merge } from 'lodash';
import {
ContainerResourceAttributes,
EnvironmentVariable,
Expand Down Expand Up @@ -510,6 +511,7 @@ export const updateNotebook = async (
username: string,
url: string,
notebookData: NotebookData,
oldNotebook: Notebook,
): Promise<Notebook> => {
if (!notebookData) {
const error = createCustomError(
Expand All @@ -521,7 +523,29 @@ export const updateNotebook = async (
throw error;
}
try {
const notebookAssembled = await generateNotebookResources(fastify, username, url, notebookData);
const serverNotebook = await generateNotebookResources(fastify, username, url, notebookData);

// Fix for Workbench Certs that get overridden
// We are intentionally applying on some details as to avoid implementing logic to properly
// manage the notebook the same way as workbench
const importantOldNotebookDetails: RecursivePartial<Notebook> = {
spec: {
template: {
spec: {
containers: [
{
env: oldNotebook.spec.template.spec.containers[0].env,
volumeMounts: oldNotebook.spec.template.spec.containers[0].volumeMounts,
},
],
volumes: oldNotebook.spec.template.spec.volumes,
},
},
},
};

const notebookAssembled = merge({}, importantOldNotebookDetails, serverNotebook);

const response = await fastify.kube.customObjectsApi.patchNamespacedCustomObject(
'kubeflow.org',
'v1',
Expand Down
70 changes: 63 additions & 7 deletions frontend/config/webpack.dev.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { execSync } = require('child_process');
const path = require('path');
const { merge } = require('webpack-merge');
const { setupWebpackDotenvFilesForEnv, setupDotenvFilesForEnv } = require('./dotenv');
Expand Down Expand Up @@ -35,13 +36,68 @@ module.exports = merge(
historyApiFallback: true,
hot: true,
open: false,
proxy: {
'/api': `http://0.0.0.0:${BACKEND_PORT}`,
'/wss': {
target: `ws://0.0.0.0:${BACKEND_PORT}`,
ws: true,
},
},
proxy: (() => {
if (process.env.EXT_CLUSTER) {
const odhProject = process.env.OC_PROJECT || 'opendatahub';
const app = process.env.ODH_APP || 'odh-dashboard';
console.info('Using project:', odhProject);

let dashboardHost;
let token;
try {
try {
dashboardHost = execSync(
`oc get routes -n ${odhProject} ${app} -o jsonpath='{.spec.host}'`,
)
.toString()
.trim();
} catch (e) {
console.info('Failed to GET dashboard route, constructing host manually.');
dashboardHost = new URL(execSync(`oc whoami --show-server`).toString()).host
.replace(/:\d+$/, '')
.replace(/^api./, `${app}-${odhProject}.apps.`);
}
console.info('Dashboard host:', dashboardHost);

token = execSync('oc whoami --show-token').toString().trim();

const username = execSync('oc whoami').toString().trim();
console.info('Logged in as user:', username);
} catch (e) {
console.error('Login with `oc login` prior to starting dev server.');
process.exit(1);
}

const headers = {
Authorization: `Bearer ${token}`,
'x-forwarded-access-token': token,
};

return {
'/api': {
target: `https://${dashboardHost}`,
secure: false,
changeOrigin: true,
headers,
},
'/wss': {
target: `wss://${dashboardHost}`,
ws: true,
secure: false,
changeOrigin: true,
headers,
},
};
} else {
return {
'/api': `http://0.0.0.0:${BACKEND_PORT}`,
'/wss': {
target: `ws://0.0.0.0:${BACKEND_PORT}`,
ws: true,
},
};
}
})(),
devMiddleware: {
stats: 'errors-only',
},
Expand Down
8 changes: 4 additions & 4 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"format": "prettier --write \"./**/*.ts\" \"./**/*.tsx\" \"./**/*.scss\"",
"lint:goal": "eslint --config ./.eslintrc.goal.js --ext .json,.js,.ts,.jsx,.tsx ./src ",
"start:dev": "webpack serve --hot --color --config ./config/webpack.dev.js",
"start:dev:ext": "EXT_CLUSTER=true npm run start:dev",
"test": "run-s test:lint test:type-check test:unit test:cypress-ci",
"test:fix": "eslint --ext .js,.ts,.jsx,.tsx ./src --fix",
"test:lint": "eslint --max-warnings 0 --ext .js,.ts,.jsx,.tsx ./src",
Expand Down Expand Up @@ -62,7 +63,7 @@
"@patternfly/react-styles": "^5.2.1",
"@patternfly/react-table": "^5.2.1",
"@patternfly/react-tokens": "^5.2.1",
"@patternfly/react-topology": "^5.3.0-prerelease.5",
"@patternfly/react-topology": "^5.3.0-prerelease.12",
"@patternfly/react-virtualized-extension": "^5.0.0",
"@types/classnames": "^2.3.1",
"axios": "^1.6.4",
Expand Down
14 changes: 14 additions & 0 deletions frontend/src/__mocks__/mockAllowedUsers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { AllowedUser, PrivilegeState } from '~/pages/notebookController/screens/admin/types';

type MockAllowedUsersType = {
username?: string;
privilege?: PrivilegeState;
};
export const mockAllowedUsers = ({
username = 'test-user',
privilege = PrivilegeState.USER,
}: MockAllowedUsersType): AllowedUser => ({
username,
privilege,
lastActivity: '2024-02-14T14:22:05Z',
});
16 changes: 16 additions & 0 deletions frontend/src/__mocks__/mockDWUsageByOwnerPrometheusResponse.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { WorkloadMetricIndexedByOwner, WorkloadMetricPromQueryResponse } from '~/api';
import { WorkloadOwnerType } from '~/k8sTypes';
import { mockPrometheusQueryVectorResponse } from './mockPrometheusQueryVectorResponse';

export const mockDWUsageByOwnerPrometheusResponse = (
usageByOwner: WorkloadMetricIndexedByOwner,
): WorkloadMetricPromQueryResponse =>
mockPrometheusQueryVectorResponse({
result: Object.values(WorkloadOwnerType).flatMap((ownerKind) =>
Object.keys(usageByOwner[ownerKind]).map((ownerName) => ({
// eslint-disable-next-line camelcase
metric: { owner_kind: ownerKind, owner_name: ownerName },
value: [0, String(usageByOwner[ownerKind][ownerName])],
})),
),
});
4 changes: 3 additions & 1 deletion frontend/src/__mocks__/mockDashboardConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ type MockDashboardConfigType = {
disablePipelineExperiments?: boolean;
disableDistributedWorkloads?: boolean;
disableModelRegistry?: boolean;
disableNotebookController?: boolean;
};

export const mockDashboardConfig = ({
Expand All @@ -48,6 +49,7 @@ export const mockDashboardConfig = ({
disablePipelineExperiments = true,
disableDistributedWorkloads = false,
disableModelRegistry = true,
disableNotebookController = false,
}: MockDashboardConfigType): DashboardConfigKind => ({
apiVersion: 'opendatahub.io/v1alpha',
kind: 'OdhDashboardConfig',
Expand Down Expand Up @@ -86,7 +88,7 @@ export const mockDashboardConfig = ({
disableModelRegistry,
},
notebookController: {
enabled: true,
enabled: !disableNotebookController,
notebookNamespace: 'openshift-ai-notebooks',
notebookTolerationSettings: {
enabled: true,
Expand Down
33 changes: 33 additions & 0 deletions frontend/src/__mocks__/mockGroupConfig.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { GroupsConfig } from '~/pages/groupSettings/groupTypes';

export const mockGroupSettings = (): GroupsConfig => ({
adminGroups: [
{
id: 0,
name: 'odh-admins',
enabled: true,
},
{
id: 1,
name: 'odh-admins-1',
enabled: false,
},
],
allowedGroups: [
{
id: 0,
name: 'odh-admins',
enabled: false,
},
{
id: 1,
name: 'odh-admins-1',
enabled: false,
},
{
id: 2,
name: 'system:authenticated',
enabled: true,
},
],
});
6 changes: 5 additions & 1 deletion frontend/src/__mocks__/mockInferenceServiceK8sResource.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { K8sStatus } from '@openshift/dynamic-plugin-sdk-utils';
import { InferenceServiceKind, KnownLabels } from '~/k8sTypes';
import { genUID } from '~/__mocks__/mockUtils';
import { ContainerResources } from '~/types';

type MockResourceConfigType = {
name?: string;
Expand All @@ -17,6 +18,7 @@ type MockResourceConfigType = {
minReplicas?: number;
maxReplicas?: number;
lastFailureInfoMessage?: string;
resources?: ContainerResources;
};

type InferenceServicek8sError = K8sStatus & {
Expand Down Expand Up @@ -66,11 +68,12 @@ export const mockInferenceServiceK8sResource = ({
isModelMesh = false,
activeModelState = 'Pending',
url = '',
path = 'path/to/model',
acceleratorIdentifier = '',
path = 'path/to/model',
minReplicas = 1,
maxReplicas = 1,
lastFailureInfoMessage = 'Waiting for runtime Pod to become available',
resources,
}: MockResourceConfigType): InferenceServiceKind => ({
apiVersion: 'serving.kserve.io/v1beta1',
kind: 'InferenceService',
Expand Down Expand Up @@ -118,6 +121,7 @@ export const mockInferenceServiceK8sResource = ({
},
}
: {}),
...(resources && { resources }),
runtime: modelName,
storage: {
key: secretName,
Expand Down
14 changes: 14 additions & 0 deletions frontend/src/__mocks__/mockInferenceServiceModalData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,19 @@ export const mockInferenceServiceModalData = ({
externalRoute = false,
tokenAuth = false,
tokens = [],
modelSize = {
name: 'Small',
resources: {
requests: {
cpu: '1',
memory: '1Gi',
},
limits: {
cpu: '2',
memory: '2Gi',
},
},
},
}: MockResourceConfigType): CreatingInferenceServiceObject => ({
name,
project,
Expand All @@ -35,4 +48,5 @@ export const mockInferenceServiceModalData = ({
externalRoute,
tokenAuth,
tokens,
modelSize,
});
Loading
Loading