Skip to content

Commit

Permalink
Enable pipeline experiments in dashboard config
Browse files Browse the repository at this point in the history
chore: Update URLs for cloning pipeline runs and viewing pipeline runs and schedules

create run and job auto add now

Refactor PipelineTaskDetails component to remove unused code and improve readability

chore: Update route for pipeline run details namespace on execution details page

chore: Update route for pipeline run details namespace on execution details page

chore: Update route for pipeline run details namespace on execution details page
  • Loading branch information
Gkrumbach07 committed Jun 12, 2024
1 parent ba94286 commit 7d528ef
Show file tree
Hide file tree
Showing 39 changed files with 590 additions and 285 deletions.
2 changes: 1 addition & 1 deletion backend/src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const blankDashboardCR: DashboardConfig = {
disableKServeMetrics: true,
disableModelMesh: false,
disableAcceleratorProfiles: false,
disablePipelineExperiments: true,
disablePipelineExperiments: false,
disableS3Endpoint: true,
disableDistributedWorkloads: false,
disableModelRegistry: true,
Expand Down
2 changes: 1 addition & 1 deletion docs/dashboard-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ spec:
disableKServeMetrics: true
disableBiasMetrics: false
disablePerformanceMetrics: false
disablePipelineExperiments: true
disablePipelineExperiments: false
disableS3Endpoint: true
notebookController:
enabled: true
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/__mocks__/mockDashboardConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const mockDashboardConfig = ({
disableAcceleratorProfiles = false,
disablePerformanceMetrics = false,
disableBiasMetrics = false,
disablePipelineExperiments = true,
disablePipelineExperiments = false,
disableS3Endpoint = true,
disableDistributedWorkloads = false,
disableModelRegistry = true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@ import { PipelineRunSearchParam } from '~/concepts/pipelines/content/types';
import { DeleteModal } from '~/__tests__/cypress/cypress/pages/components/DeleteModal';

class PipelineRunsGlobal {
visit(projectName: string, runType?: 'active' | 'archived' | 'scheduled') {
visit(
projectName: string,
pipelineId: string,
versionId: string,
runType?: 'active' | 'archived' | 'scheduled',
) {
cy.visitWithLogin(
`/pipelineRuns/${projectName}${
`/pipelines/${projectName}/pipeline/runs/${pipelineId}/${versionId}${
runType ? `?${PipelineRunSearchParam.RunType}=${runType}` : ''
}`,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ class PipelineDetails extends PipelinesTopology {

class PipelineRunJobDetails extends RunDetails {
visit(namespace: string, pipelineId: string) {
cy.visitWithLogin(`/pipelineRuns/${namespace}/pipelineRunJob/view/${pipelineId}`);
cy.visitWithLogin(`/pipelines/${namespace}/pipelineRunJob/view/${pipelineId}`);
this.wait();
}

Expand All @@ -186,7 +186,7 @@ class PipelineRunJobDetails extends RunDetails {

class PipelineRunDetails extends RunDetails {
visit(namespace: string, pipelineId: string) {
cy.visitWithLogin(`/pipelineRuns/${namespace}/pipelineRun/view/${pipelineId}`);
cy.visitWithLogin(`/pipelines/${namespace}/pipelineRun/view/${pipelineId}`);
this.wait();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ const initialMockRecurringRuns = [
describe('Pipeline create runs', () => {
beforeEach(() => {
initIntercepts();
pipelineRunsGlobal.visit(projectName);
pipelineRunsGlobal.visit(
projectName,
mockPipelineVersion.pipeline_id,
mockPipelineVersion.pipeline_version_id,
);
});

it('renders the page with scheduled and active runs table data', () => {
Expand All @@ -81,7 +85,7 @@ describe('Pipeline create runs', () => {

// Navigate to the 'Create run' page
pipelineRunsGlobal.findCreateRunButton().click();
verifyRelativeURL(`/pipelineRuns/${projectName}/pipelineRun/create`);
verifyRelativeURL(`/pipelines/${projectName}/pipelineRun/create`);
createRunPage.find();
createRunPage.findRunTypeSwitchLink().click();
cy.url().should('include', '?runType=scheduled');
Expand Down Expand Up @@ -112,7 +116,7 @@ describe('Pipeline create runs', () => {

// Navigate to the 'Create run' page
pipelineRunsGlobal.findCreateRunButton().click();
verifyRelativeURL(`/pipelineRuns/${projectName}/pipelineRun/create`);
verifyRelativeURL(`/pipelines/${projectName}/pipelineRun/create`);
createRunPage.find();

// Fill out the form without a schedule and submit
Expand Down Expand Up @@ -151,7 +155,7 @@ describe('Pipeline create runs', () => {
});

// Should be redirected to the run details page
verifyRelativeURL(`/pipelineRuns/${projectName}/pipelineRun/view/${createRunParams.run_id}`);
verifyRelativeURL(`/pipelines/${projectName}/pipelineRun/view/${createRunParams.run_id}`);
});

it('duplicates an active run', () => {
Expand Down Expand Up @@ -182,7 +186,7 @@ describe('Pipeline create runs', () => {
// Navigate to clone run page for a given active run
pipelineRunsGlobal.findActiveRunsTab().click();
activeRunsTable.getRowByName(mockRun.display_name).findKebabAction('Duplicate').click();
verifyRelativeURL(`/pipelineRuns/${projectName}/pipelineRun/clone/${mockRun.run_id}`);
verifyRelativeURL(`/pipelines/${projectName}/pipelineRun/clone/${mockRun.run_id}`);

// Verify pre-populated values & submit
cloneRunPage.findExperimentSelect().should('have.text', mockExperiment.display_name);
Expand Down Expand Up @@ -217,7 +221,7 @@ describe('Pipeline create runs', () => {
});

// Should redirect to the details of the newly cloned active run
verifyRelativeURL(`/pipelineRuns/${projectName}/pipelineRun/view/${mockDuplicateRun.run_id}`);
verifyRelativeURL(`/pipelines/${projectName}/pipelineRun/view/${mockDuplicateRun.run_id}`);
});

it('create run with default and optional parameters', () => {
Expand Down Expand Up @@ -487,7 +491,7 @@ describe('Pipeline create runs', () => {

// Navigate to the 'Create run' page
pipelineRunsGlobal.findScheduleRunButton().click();
verifyRelativeURL(`/pipelineRuns/${projectName}/pipelineRun/create?runType=scheduled`);
verifyRelativeURL(`/pipelines/${projectName}/pipelineRun/create?runType=scheduled`);
createSchedulePage.find();
createSchedulePage.findRunTypeSwitchLink().click();
cy.url().should('include', '?runType=active');
Expand Down Expand Up @@ -518,7 +522,7 @@ describe('Pipeline create runs', () => {

// Navigate to the 'Create run' page
pipelineRunsGlobal.findScheduleRunButton().click();
verifyRelativeURL(`/pipelineRuns/${projectName}/pipelineRun/create?runType=scheduled`);
verifyRelativeURL(`/pipelines/${projectName}/pipelineRun/create?runType=scheduled`);
createSchedulePage.find();

// Fill out the form with a schedule and submit
Expand Down Expand Up @@ -562,7 +566,7 @@ describe('Pipeline create runs', () => {

// Should be redirected to the schedule details page
verifyRelativeURL(
`/pipelineRuns/${projectName}/pipelineRunJob/view/${createRecurringRunParams.recurring_run_id}`,
`/pipelines/${projectName}/pipelineRunJob/view/${createRecurringRunParams.recurring_run_id}`,
);
});

Expand Down Expand Up @@ -594,7 +598,7 @@ describe('Pipeline create runs', () => {
.findKebabAction('Duplicate')
.click();
verifyRelativeURL(
`/pipelineRuns/${projectName}/pipelineRun/cloneJob/${mockRecurringRun.recurring_run_id}?runType=scheduled`,
`/pipelines/${projectName}/pipelineRun/cloneJob/${mockRecurringRun.recurring_run_id}?runType=scheduled`,
);

// Verify pre-populated values & submit
Expand Down Expand Up @@ -640,7 +644,7 @@ describe('Pipeline create runs', () => {

// Should be redirected to the schedule details page
verifyRelativeURL(
`/pipelineRuns/${projectName}/pipelineRunJob/view/${mockDuplicateRecurringRun.recurring_run_id}`,
`/pipelines/${projectName}/pipelineRunJob/view/${mockDuplicateRecurringRun.recurring_run_id}`,
);
});

Expand Down Expand Up @@ -731,4 +735,19 @@ const initIntercepts = () => {
},
{ runs: initialMockRuns, total_size: initialMockRuns.length },
);
cy.interceptOdh(
'GET /api/service/pipelines/:namespace/:serviceName/apis/v2beta1/pipelines/:pipelineId/versions/:pipelineVersionId',
{
path: {
namespace: projectName,
serviceName: 'dspa',
pipelineId: mockPipelineVersion.pipeline_id,
pipelineVersionId: mockPipelineVersion.pipeline_version_id,
},
},
buildMockPipelineVersionV2({
pipeline_id: mockPipelineVersion.pipeline_id,
pipeline_version_id: mockPipelineVersion.pipeline_version_id,
}),
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
SecretModel,
} from '~/__tests__/cypress/cypress/utils/models';
import { mockSuccessGoogleRpcStatus } from '~/__mocks__/mockGoogleRpcStatusKF';
import { buildMockPipelineVersionV2 } from '~/__mocks__';

const initIntercepts = () => {
cy.interceptOdh(
Expand Down Expand Up @@ -71,14 +72,29 @@ const initIntercepts = () => {
);
cy.interceptK8sList(NotebookModel, mockK8sResourceList([mockNotebookK8sResource({})]));
cy.interceptK8sList(ProjectModel, mockK8sResourceList([mockProjectK8sResource({})]));
cy.interceptOdh(
'GET /api/service/pipelines/:namespace/:serviceName/apis/v2beta1/pipelines/:pipelineId/versions/:pipelineVersionId',
{
path: {
namespace: 'test-project',
serviceName: 'dspa',
pipelineId: 'pipeline_id',
pipelineVersionId: 'version_id',
},
},
buildMockPipelineVersionV2({
pipeline_id: 'pipeline_id',
pipeline_version_id: 'version_id',
}),
);
};

describe('Pipeline runs', () => {
describe('Test deleting runs', () => {
it('Test delete a single schedule', () => {
initIntercepts();

pipelineRunsGlobal.visit('test-project');
pipelineRunsGlobal.visit('test-project', 'pipeline_id', 'version_id');
pipelineRunsGlobal.isApiAvailable();

pipelineRunsGlobal.findSchedulesTab().click();
Expand Down Expand Up @@ -113,7 +129,12 @@ describe('Pipeline runs', () => {
cy.wait('@deleteJobPipeline');

cy.wait('@getRuns').then((interception) => {
expect(interception.request.query).to.eql({ sort_by: 'created_at desc', page_size: '10' });
expect(interception.request.query).to.eql({
sort_by: 'created_at desc',
page_size: '10',
filter:
'{"predicates":[{"key":"pipeline_version_id","operation":"EQUALS","string_value":"version_id"}]}',
});

pipelineRunJobTable.findEmptyState().should('not.exist');
});
Expand All @@ -122,7 +143,7 @@ describe('Pipeline runs', () => {
it('Test delete multiple schedules', () => {
initIntercepts();

pipelineRunsGlobal.visit('test-project');
pipelineRunsGlobal.visit('test-project', 'pipeline_id', 'version_id');
pipelineRunsGlobal.isApiAvailable();

pipelineRunsGlobal.findSchedulesTab().click();
Expand Down Expand Up @@ -169,15 +190,20 @@ describe('Pipeline runs', () => {
cy.wait('@deleteJobPipeline-2');

cy.wait('@getRuns').then((interception) => {
expect(interception.request.query).to.eql({ sort_by: 'created_at desc', page_size: '10' });
expect(interception.request.query).to.eql({
sort_by: 'created_at desc',
page_size: '10',
filter:
'{"predicates":[{"key":"pipeline_version_id","operation":"EQUALS","string_value":"version_id"}]}',
});
});
pipelineRunJobTable.findEmptyState().should('exist');
});

it('Test delete a single archived run', () => {
initIntercepts();

pipelineRunsGlobal.visit('test-project');
pipelineRunsGlobal.visit('test-project', 'pipeline_id', 'version_id');
pipelineRunsGlobal.isApiAvailable();

pipelineRunsGlobal.findArchivedRunsTab().click();
Expand Down Expand Up @@ -213,7 +239,7 @@ describe('Pipeline runs', () => {
sort_by: 'created_at desc',
page_size: '10',
filter:
'{"predicates":[{"key":"storage_state","operation":"EQUALS","string_value":"AVAILABLE"}]}',
'{"predicates":[{"key":"storage_state","operation":"EQUALS","string_value":"AVAILABLE"},{"key":"pipeline_version_id","operation":"EQUALS","string_value":"version_id"}]}',
});
});
archivedRunsTable.findEmptyState().should('not.exist');
Expand All @@ -222,7 +248,7 @@ describe('Pipeline runs', () => {
it('Test delete multiple archived runs', () => {
initIntercepts();

pipelineRunsGlobal.visit('test-project');
pipelineRunsGlobal.visit('test-project', 'pipeline_id', 'version_id');
pipelineRunsGlobal.isApiAvailable();

pipelineRunsGlobal.findArchivedRunsTab().click();
Expand Down Expand Up @@ -269,7 +295,7 @@ describe('Pipeline runs', () => {
sort_by: 'created_at desc',
page_size: '10',
filter:
'{"predicates":[{"key":"storage_state","operation":"EQUALS","string_value":"AVAILABLE"}]}',
'{"predicates":[{"key":"storage_state","operation":"EQUALS","string_value":"AVAILABLE"},{"key":"pipeline_version_id","operation":"EQUALS","string_value":"version_id"}]}',
});
});
archivedRunsTable.findEmptyState().should('exist');
Expand Down
Loading

0 comments on commit 7d528ef

Please sign in to comment.