Skip to content

Commit

Permalink
Merge branch 'main' into cypress-RHOAIENG-17169/RHOAIENG-17174
Browse files Browse the repository at this point in the history
  • Loading branch information
antowaddle authored Jan 21, 2025
2 parents 55812f5 + 3e5a523 commit abf0310
Show file tree
Hide file tree
Showing 70 changed files with 2,524 additions and 428 deletions.
23 changes: 23 additions & 0 deletions docs/external-redirects.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# External Redirects

The supported external redirect paths in the application.

## Supported Redirects

### Pipeline SDK Redirects

Redirecting from Pipeline SDK output URLs to internal dashboard routes.

#### Supported URL Patterns

1. **Experiment Details**
```
/external/pipelinesSdk/{namespace}/#/experiments/details/{experimentId}
```
Redirects to the internal experiment runs route for the specified experiment.

2. **Run Details**
```
/external/pipelinesSdk/{namespace}/#/runs/details/{runId}
```
Redirects to the internal pipeline run details route for the specified run.
224 changes: 224 additions & 0 deletions frontend/src/__mocks__/mockKserveMetricsConfigMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,217 @@ export const MOCK_KSERVE_METRICS_CONFIG_3 = `
]
}`;

// NVIDIA NIM
export const MOCK_NIM_METRICS_CONFIG_1 = `{
"config": [
{
"title": "GPU cache usage over time",
"type": "KV_CACHE",
"queries": [
{
"title": "GPU cache usage over time",
"query": "sum_over_time(gpu_cache_usage_perc{namespace='tomer-test-2', pod=~'nim-deploy-predictor-.*'}[24h])"
}
]
},
{
"title": "Current running, waiting, and max requests count",
"type": "CURRENT_REQUESTS",
"queries": [
{
"title": "Requests waiting",
"query": "num_requests_waiting{namespace='tomer-test-2', pod=~'nim-deploy-predictor-.*'}"
},
{
"title": "Requests running",
"query": "num_requests_running{namespace='tomer-test-2', pod=~'nim-deploy-predictor-.*'}"
},
{
"title": "Max requests",
"query": "num_request_max{namespace='tomer-test-2', pod=~'nim-deploy-predictor-.*'}"
}
]
},
{
"title": "Tokens count",
"type": "TOKENS_COUNT",
"queries": [
{
"title": "Total prompts token",
"query": "round(rate(prompt_tokens_total{namespace='tomer-test-2', pod=~'nim-deploy-predictor-.*'}[1m]))"
},
{
"title": "Total generation token",
"query": "round(rate(generation_tokens_total{namespace='tomer-test-2', pod=~'nim-deploy-predictor-.*'}[1m]))"
}
]
},
{
"title": "Time to first token",
"type": "TIME_TO_FIRST_TOKEN",
"queries": [
{
"title": "Time to first token",
"query": "rate(time_to_first_token_seconds_sum{namespace='tomer-test-2', pod=~'nim-deploy-predictor-.*'}[1m])"
}
]
},
{
"title": "Time per output token",
"type": "TIME_PER_OUTPUT_TOKEN",
"queries": [
{
"title": "Time per output token",
"query": "rate(time_per_output_token_seconds_sum{namespace='tomer-test-2', pod=~'nim-deploy-predictor-.*'}[1m])"
}
]
},
{
"title": "Requests outcomes",
"type": "REQUEST_OUTCOMES",
"queries": [
{
"title": "Number of successful incoming requests",
"query": "round(sum(increase(request_success_total{namespace='tomer-test-2', pod=~'nim-deploy-predictor-.*'}[5m])))"
},
{
"title": "Number of failed incoming requests",
"query": "round(sum(increase(request_failure_total{namespace='tomer-test-2', pod=~'nim-deploy-predictor-.*'}[5m])))"
}
]
}
]
}`;

export const MOCK_NIM_METRICS_CONFIG_3 = `{
"config": [
{
"title": "GPU cache usage over time",
"type": "KV_CACHE",
"queries": [
{
"title": "GPU cache usage over time",
"query": "sum_over_time(gpu_cache_usage_perc{namespace='tomer-test-2', pod=~'nim-deploy-predictor-.*'}[24h])"
}
]
},
{
"title": "Current running, waiting, and max requests count",
"type": "CURRENT_REQUESTS",
"queries": [
{
"title": "Requests waiting",
"query": "num_requests_waiting{namespace='tomer-test-2', pod=~'nim-deploy-predictor-.*'}"
},
{
"title": "Requests running",
"query": "num_requests_running{namespace='tomer-test-2', pod=~'nim-deploy-predictor-.*'}"
},
{
"title": "Max requests",
"query": "num_request_max{namespace='tomer-test-2', pod=~'nim-deploy-predictor-.*'}"
}
]
}
]
}`;

export const MOCK_NIM_METRICS_CONFIG_MISSING_QUERY = `{
"config": [
{
"title": "GPU cache usage over time",
"type": "KV_CACHE",
"queries": [
{
"title": "GPU cache usage over time",
"query": "sum_over_time(gpu_cache_usage_perc{namespace='tomer-test-2', pod=~'nim-deploy-predictor-.*'}[24h])"
}
]
},
{
"title": "Tokens count",
"type": "TOKENS_COUNT",
"queries": [
{
"title": "Total prompts token",
"query": "round(rate(prompt_tokens_total{namespace='tomer-test-2', pod=~'nim-deploy-predictor-.*'}[1m]))"
}
]
}
]
}`;

export const MOCK_NIM_METRICS_CONFIG_MISSING_QUERY_2 = `{
"config": [
{
"title": "GPU cache usage over time",
"type": "KV_CACHE",
"queries": [
{
"title": "GPU cache usage over time",
"query": "sum_over_time(gpu_cache_usage_perc{namespace='tomer-test-2', pod=~'nim-deploy-predictor-.*'}[24h])"
}
]
},
{
"title": "Tokens count",
"type": "TOKENS_COUNT",
"queries": [
{
"title": "Total generation token",
"query": "round(rate(generation_tokens_total{namespace='tomer-test-2', pod=~'nim-deploy-predictor-.*'}[1m]))"
}
]
},
{
"title": "Current running, waiting, and max requests count",
"type": "CURRENT_REQUESTS",
"queries": [
{
},
{
},
{
}
]
}
]
}`;

export const MOCK_NIM_METRICS_CONFIG_MISSING_QUERY_3 = `{
"config": [
{
"title": "GPU cache usage over time",
"type": "KV_CACHE",
"queries": [
{
"title": "GPU cache usage over time",
"query": "sum_over_time(gpu_cache_usage_perc{namespace='tomer-test-2', pod=~'nim-deploy-predictor-.*'}[24h])"
}
]
},
{
"title": "Tokens count",
"type": "TOKENS_COUNT",
"queries": [
{
"title": "Total prompts token",
"query": "round(rate(prompt_tokens_total{namespace='tomer-test-2', pod=~'nim-deploy-predictor-.*'}[1m]))"
}
]
},
{
"title": "Requests outcomes",
"type": "REQUEST_OUTCOMES",
"queries": [
{
},
{
}
]
}
]
}`;
export const mockKserveMetricsConfigMap = ({
namespace = 'test-project',
modelName = 'test-inference-service',
Expand All @@ -156,3 +367,16 @@ export const mockKserveMetricsConfigMap = ({
};
return mockConfigMap({ data, namespace, name: `${modelName}-metrics-dashboard` });
};

export const mockNimMetricsConfigMap = ({
namespace = 'test-project',
modelName = 'test-inference-service',
supported = true,
config = MOCK_NIM_METRICS_CONFIG_1,
}: MockKserveMetricsConfigMapType): ConfigMapKind => {
const data = {
metrics: config,
supported: String(supported),
};
return mockConfigMap({ data, namespace, name: `${modelName}-metrics-dashboard` });
};
4 changes: 1 addition & 3 deletions frontend/src/__mocks__/mockProjectK8sResource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,14 @@ export const mockProjectK8sResource = ({
...(enableModelMesh !== undefined && {
[KnownLabels.MODEL_SERVING_PROJECT]: enableModelMesh ? 'true' : 'false',
}),
...(enableNIM && {
'opendatahub.io/nim-support': 'true',
}),
...(isDSProject && { [KnownLabels.DASHBOARD_RESOURCE]: 'true' }),
},
...(hasAnnotations && {
annotations: {
...(description && { 'openshift.io/description': description }),
...(displayName && { 'openshift.io/display-name': displayName }),
...(username && { 'openshift.io/requester': username }),
...(enableNIM && { 'opendatahub.io/nim-support': 'true' }),
},
}),
resourceVersion: '1',
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/__tests__/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
approvers:
- antowaddle
32 changes: 32 additions & 0 deletions frontend/src/__tests__/cypress/cypress/pages/externalRedirect.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
class ExternalRedirect {
visit(path: string) {
cy.visitWithLogin(path);
this.wait();
}

private wait() {
cy.findByTestId('redirect-error').should('not.exist');
cy.testA11y();
}

findErrorState() {
return cy.findByTestId('redirect-error');
}

findHomeButton() {
return cy.findByRole('button', { name: 'Go to Home' });
}
}

class PipelinesSdkRedirect {
findPipelinesButton() {
return cy.findByRole('button', { name: 'Go to Pipelines' });
}

findExperimentsButton() {
return cy.findByRole('button', { name: 'Go to Experiments' });
}
}

export const externalRedirect = new ExternalRedirect();
export const pipelinesSdkRedirect = new PipelinesSdkRedirect();
31 changes: 31 additions & 0 deletions frontend/src/__tests__/cypress/cypress/pages/modelMetrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,21 @@ class ModelMetricsPerformance extends ModelMetricsGlobal {
}
}

class ModelMetricsNim extends ModelMetricsGlobal {
visit(project: string, model: string) {
cy.visitWithLogin(`/modelServing/${project}/metrics/${model}/performance`);
this.wait();
}

protected wait() {
cy.testA11y();
}

findTab() {
return cy.findByTestId('nim-tab');
}
}

class ModelMetricsKserve extends ModelMetricsPerformance {
findKserveAreaDisabledCard() {
return cy.findByTestId('kserve-metrics-disabled');
Expand All @@ -60,6 +75,20 @@ class ModelMetricsKserve extends ModelMetricsPerformance {
}
}

class ModelMetricsKserveNim extends ModelMetricsNim {
findKserveAreaDisabledCard() {
return cy.findByTestId('kserve-metrics-disabled');
}

findUnsupportedRuntimeCard() {
return cy.findByTestId('kserve-metrics-runtime-unsupported');
}

findUnknownErrorCard() {
return cy.findByTestId('kserve-unknown-error');
}
}

class ModelMetricsBias extends ModelMetricsGlobal {
visit(project: string, model: string, disableA11y = false) {
cy.visitWithLogin(`/modelServing/${project}/metrics/${model}/bias`);
Expand Down Expand Up @@ -199,8 +228,10 @@ class ConfigureBiasMetricModal extends Modal {
}

export const modelMetricsPerformance = new ModelMetricsPerformance();
export const modelMetricsNim = new ModelMetricsNim();
export const modelMetricsBias = new ModelMetricsBias();
export const serverMetrics = new ServerMetrics();
export const modelMetricsConfigureSection = new ModelMetricsConfigureSection();
export const configureBiasMetricModal = new ConfigureBiasMetricModal();
export const modelMetricsKserve = new ModelMetricsKserve();
export const modelMetricsKserveNim = new ModelMetricsKserveNim();
Loading

0 comments on commit abf0310

Please sign in to comment.