Skip to content

Commit

Permalink
Merge branch 'main' into RHOAIENG-13596_doc_links
Browse files Browse the repository at this point in the history
  • Loading branch information
aduquett authored Oct 7, 2024
2 parents 1d5f194 + c4e2940 commit 9cbcf12
Show file tree
Hide file tree
Showing 128 changed files with 1,174 additions and 1,183 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/[email protected].3
uses: actions/[email protected].4
with:
node-version: ${{ matrix.node-version }}
- name: Node.js modules cache, repository
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/vuln_scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
trivy-config: .github/trivy.yaml

- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: 'scan_result.sarif'

Expand Down
1 change: 0 additions & 1 deletion backend/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ export type DashboardConfig = K8sResourceCommon & {
disableKServeMetrics: boolean;
disableModelMesh: boolean;
disableAcceleratorProfiles: boolean;
disablePipelineExperiments: boolean;
disableDistributedWorkloads: boolean;
disableModelRegistry: boolean;
disableConnectionTypes: boolean;
Expand Down
1 change: 0 additions & 1 deletion backend/src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ export const blankDashboardCR: DashboardConfig = {
disableKServeMetrics: false,
disableModelMesh: false,
disableAcceleratorProfiles: false,
disablePipelineExperiments: false,
disableDistributedWorkloads: false,
disableModelRegistry: false,
disableConnectionTypes: true,
Expand Down
2 changes: 0 additions & 2 deletions docs/dashboard-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ spec:
disableKServeMetrics: false
disableBiasMetrics: false
disablePerformanceMetrics: false
disablePipelineExperiments: true
disableDistributedWorkloads: false
disableConnectionTypes: false
disableStorageClasses: false
Expand Down Expand Up @@ -162,7 +161,6 @@ spec:
disableKServeMetrics: true
disableBiasMetrics: false
disablePerformanceMetrics: false
disablePipelineExperiments: false
disableNIMModelServing: true
notebookController:
enabled: true
Expand Down
3 changes: 0 additions & 3 deletions frontend/src/__mocks__/mockDashboardConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ type MockDashboardConfigType = {
disableAcceleratorProfiles?: boolean;
disablePerformanceMetrics?: boolean;
disableBiasMetrics?: boolean;
disablePipelineExperiments?: boolean;
disableDistributedWorkloads?: boolean;
disableModelRegistry?: boolean;
disableConnectionTypes?: boolean;
Expand Down Expand Up @@ -53,7 +52,6 @@ export const mockDashboardConfig = ({
disableAcceleratorProfiles = false,
disablePerformanceMetrics = false,
disableBiasMetrics = false,
disablePipelineExperiments = false,
disableDistributedWorkloads = false,
disableModelRegistry = false,
disableConnectionTypes = true,
Expand Down Expand Up @@ -161,7 +159,6 @@ export const mockDashboardConfig = ({
disableKServeMetrics,
disableModelMesh,
disableAcceleratorProfiles,
disablePipelineExperiments,
disableDistributedWorkloads,
disableModelRegistry,
disableConnectionTypes,
Expand Down
28 changes: 28 additions & 0 deletions frontend/src/__tests__/cypress/cypress/pages/projects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,34 @@ class ProjectDetails {
);
}

showProjectResourceDetails() {
return cy.findByTestId('resource-name-icon-button').click();
}

findProjectResourceNameText() {
return cy.findByTestId('resource-name-text');
}

findProjectResourceKindText() {
return cy.findByTestId('resource-kind-text');
}

findProjectActions() {
return cy.findByTestId('project-actions');
}

showProjectActions() {
cy.findByTestId('project-actions').click();
}

findEditProjectAction() {
return cy.findByTestId('edit-project-action');
}

findDeleteProjectAction() {
return cy.findByTestId('delete-project-action');
}

findImportPipelineButton(timeout?: number) {
return cy.findByTestId('import-pipeline-button', { timeout });
}
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/__tests__/cypress/cypress/pages/workbench.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,10 @@ class EditSpawnerPage extends CreateSpawnerPage {
findCancelButton() {
return cy.findByTestId('workbench-cancel-button');
}

findAcceleratorProfileSelect() {
return cy.findByTestId('accelerator-profile-select');
}
}

class NotFoundSpawnerPage {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -419,12 +419,7 @@ type InterceptsType = {
};

const initIntercepts = ({ noMetrics }: InterceptsType) => {
cy.interceptOdh(
'GET /api/config',
mockDashboardConfig({
disablePipelineExperiments: false,
}),
);
cy.interceptOdh('GET /api/config', mockDashboardConfig({}));
cy.interceptK8sList(
DataSciencePipelineApplicationModel,
mockK8sResourceList([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ const shouldFilterItems = (filter: FilterArgs, query?: string) => {
};

const initIntercepts = (interceptMlmd: boolean, isExecutionsEmpty?: boolean) => {
cy.interceptOdh('GET /api/config', mockDashboardConfig({ disablePipelineExperiments: false }));
cy.interceptOdh('GET /api/config', mockDashboardConfig({}));
cy.interceptK8sList(
DataSciencePipelineApplicationModel,
mockK8sResourceList([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ describe('Runs page for archived experiment', () => {
});

const initIntercepts = () => {
cy.interceptOdh('GET /api/config', mockDashboardConfig({ disablePipelineExperiments: false }));
cy.interceptOdh('GET /api/config', mockDashboardConfig({}));
cy.interceptK8sList(
DataSciencePipelineApplicationModel,
mockK8sResourceList([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
} from '~/__tests__/cypress/cypress/utils/models';

export const configIntercept = (): void => {
cy.interceptOdh('GET /api/config', mockDashboardConfig({ disablePipelineExperiments: false }));
cy.interceptOdh('GET /api/config', mockDashboardConfig({}));
};

export const projectsIntercept = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ import { mockProjectK8sResource } from '~/__mocks__/mockProjectK8sResource';
import { mockRouteK8sResource } from '~/__mocks__/mockRouteK8sResource';
import { mockSecretK8sResource } from '~/__mocks__/mockSecretK8sResource';
import { mockServingRuntimeTemplateK8sResource } from '~/__mocks__/mockServingRuntimeTemplateK8sResource';
import { projectDetails } from '~/__tests__/cypress/cypress/pages/projects';
import {
deleteProjectModal,
editProjectModal,
projectDetails,
} from '~/__tests__/cypress/cypress/pages/projects';
import { ServingRuntimePlatform } from '~/types';
import {
DataSciencePipelineApplicationModel,
Expand All @@ -31,6 +35,7 @@ import {
} from '~/__tests__/cypress/cypress/utils/models';
import { mockServingRuntimeK8sResource } from '~/__mocks__/mockServingRuntimeK8sResource';
import { mockInferenceServiceK8sResource } from '~/__mocks__/mockInferenceServiceK8sResource';
import { asProjectAdminUser } from '~/__tests__/cypress/cypress/utils/mockUsers';

type HandlersProps = {
isEmpty?: boolean;
Expand Down Expand Up @@ -259,6 +264,41 @@ describe('Project Details', () => {
projectDetails.shouldBeEmptyState('Pipelines', 'pipelines-projects', true);
});

it('Shows project information', () => {
initIntercepts({ disableKServeConfig: true, disableModelConfig: true });
projectDetails.visit('test-project');
projectDetails.showProjectResourceDetails();
projectDetails.findProjectResourceNameText().should('have.text', 'test-project');
projectDetails.findProjectResourceKindText().should('have.text', 'Project');
});

it('Should not allow actions for non-provisioning users', () => {
asProjectAdminUser({ isSelfProvisioner: false });
initIntercepts({ disableKServeConfig: true, disableModelConfig: true });
projectDetails.visit('test-project');

projectDetails.findProjectActions().should('not.exist');
});

it('Should allow actions for provisioning users', () => {
asProjectAdminUser({ isSelfProvisioner: true });
initIntercepts({ disableKServeConfig: true, disableModelConfig: true });
projectDetails.visit('test-project');

projectDetails.showProjectActions();
projectDetails.findEditProjectAction().click();

editProjectModal.shouldBeOpen();
editProjectModal.findCancelButton().click();
editProjectModal.shouldBeOpen(false);

projectDetails.showProjectActions();
projectDetails.findDeleteProjectAction().click();
deleteProjectModal.shouldBeOpen();
deleteProjectModal.findCancelButton().click();
deleteProjectModal.shouldBeOpen(false);
});

it('Both model serving platforms are disabled', () => {
initIntercepts({ disableKServeConfig: true, disableModelConfig: true });
projectDetails.visit('test-project');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@ import {
RouteModel,
SecretModel,
StorageClassModel,
AcceleratorProfileModel,
} from '~/__tests__/cypress/cypress/utils/models';
import { mock200Status } from '~/__mocks__/mockK8sStatus';
import type { NotebookSize } from '~/types';
import { mockAcceleratorProfile } from '~/__mocks__/mockAcceleratorProfile';

const configYamlPath = '../../__mocks__/mock-upload-configmap.yaml';

Expand Down Expand Up @@ -168,7 +170,22 @@ const initIntercepts = ({
cy.interceptK8s('POST', ConfigMapModel, mockConfigMap({})).as('createConfigMap');

cy.interceptK8s('POST', NotebookModel, mockNotebookK8sResource({})).as('createWorkbench');

cy.interceptK8sList(
AcceleratorProfileModel,
mockK8sResourceList([
mockAcceleratorProfile({
name: 'test-accelerator',
namespace: 'opendatahub',
displayName: 'Test Accelerator',
description: 'A test accelerator profile',
enabled: true,
identifier: 'test.com/accelerator',
}),
]),
);
};

describe('Workbench page', () => {
it('Empty state', () => {
initIntercepts({ isEmpty: true });
Expand Down Expand Up @@ -557,6 +574,11 @@ describe('Workbench page', () => {
editSpawnerPage.findSubmitButton().should('be.enabled');
editSpawnerPage.k8sNameDescription.findDisplayNameInput().fill('Updated Notebook');

// Add a test for editing accelerator profile
editSpawnerPage.findAcceleratorProfileSelect().click();
editSpawnerPage.findAcceleratorProfileSelect().findSelectOption('None').click();
editSpawnerPage.findAcceleratorProfileSelect().should('contain', 'None');

cy.interceptK8s('PUT', NotebookModel, mockNotebookK8sResource({})).as('editWorkbenchDryRun');
cy.interceptK8s('PATCH', NotebookModel, mockNotebookK8sResource({})).as('editWorkbench');
editSpawnerPage.findSubmitButton().click();
Expand Down
29 changes: 21 additions & 8 deletions frontend/src/components/ResourceNameTooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import {
DescriptionListDescription,
DescriptionListGroup,
DescriptionListTerm,
Flex,
FlexItem,
Popover,
Stack,
StackItem,
Expand All @@ -26,9 +28,9 @@ const ResourceNameTooltip: React.FC<ResourceNameTooltipProps> = ({
wrap = true,
}) => (
<div style={{ display: wrap ? 'block' : 'inline-flex' }}>
<span>{children}</span>
{resource.metadata?.name && (
<div style={{ display: 'inline-block', marginLeft: 'var(--pf-v5-global--spacer--xs)' }}>
<Flex gap={{ default: 'gapXs' }} alignItems={{ default: 'alignItemsCenter' }}>
<FlexItem>{children}</FlexItem>
{resource.metadata?.name && (
<Popover
position="right"
bodyContent={
Expand All @@ -41,24 +43,35 @@ const ResourceNameTooltip: React.FC<ResourceNameTooltipProps> = ({
<DescriptionListGroup>
<DescriptionListTerm>Resource name</DescriptionListTerm>
<DescriptionListDescription>
<ClipboardCopy hoverTip="Copy" clickTip="Copied" variant="inline-compact">
<ClipboardCopy
hoverTip="Copy"
clickTip="Copied"
variant="inline-compact"
data-testid="resource-name-text"
>
{resource.metadata.name}
</ClipboardCopy>
</DescriptionListDescription>
</DescriptionListGroup>
<DescriptionListGroup>
<DescriptionListTerm>Resource type</DescriptionListTerm>
<DescriptionListDescription>{resource.kind}</DescriptionListDescription>
<DescriptionListDescription data-testid="resource-kind-text">
{resource.kind}
</DescriptionListDescription>
</DescriptionListGroup>
</DescriptionList>
</StackItem>
</Stack>
}
>
<DashboardPopupIconButton icon={<OutlinedQuestionCircleIcon />} aria-label="More info" />
<DashboardPopupIconButton
data-testid="resource-name-icon-button"
icon={<OutlinedQuestionCircleIcon />}
aria-label="More info"
/>
</Popover>
</div>
)}
)}
</Flex>
</div>
);

Expand Down
5 changes: 0 additions & 5 deletions frontend/src/concepts/areas/const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export const allFeatureFlags: string[] = Object.keys({
disableKServeMetrics: false,
disableModelMesh: false,
disableAcceleratorProfiles: false,
disablePipelineExperiments: false,
disableDistributedWorkloads: false,
disableModelRegistry: false,
disableConnectionTypes: false,
Expand Down Expand Up @@ -107,10 +106,6 @@ export const SupportedAreasStateMap: SupportedAreasState = {
requiredComponents: [StackComponent.TRUSTY_AI],
reliantAreas: [SupportedArea.BIAS_METRICS],
},
[SupportedArea.PIPELINE_EXPERIMENTS]: {
featureFlags: ['disablePipelineExperiments'],
reliantAreas: [SupportedArea.DS_PIPELINES],
},
[SupportedArea.DISTRIBUTED_WORKLOADS]: {
featureFlags: ['disableDistributedWorkloads'],
requiredComponents: [StackComponent.KUEUE],
Expand Down
1 change: 0 additions & 1 deletion frontend/src/concepts/areas/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export enum SupportedArea {

/* Pipelines areas */
DS_PIPELINES = 'ds-pipelines',
PIPELINE_EXPERIMENTS = 'pipeline-experiments',

/* Admin areas */
BYON = 'bring-your-own-notebook',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const EnsureCompatiblePipelineServer: React.FC<EnsureCompatiblePipelineServerPro
</EmptyStateFooter>
</EmptyState>
</Bullseye>
<DeleteServerModal isOpen={isDeleting} onClose={() => setIsDeleting(false)} />
{isDeleting ? <DeleteServerModal onClose={() => setIsDeleting(false)} /> : null}
</>
);
}
Expand Down
4 changes: 1 addition & 3 deletions frontend/src/concepts/pipelines/content/ArchiveModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ interface ArchiveModalProps {
onCancel: () => void;
onSubmit: () => Promise<void[]>;
children: React.ReactNode;
isOpen: boolean;
testId: string;
}

Expand All @@ -21,7 +20,6 @@ export const ArchiveModal: React.FC<ArchiveModalProps> = ({
title,
alertTitle,
children,
isOpen,
testId,
}) => {
const { refreshAllAPI } = usePipelinesAPI();
Expand Down Expand Up @@ -53,7 +51,7 @@ export const ArchiveModal: React.FC<ArchiveModalProps> = ({

return (
<Modal
isOpen={isOpen}
isOpen
title={title}
titleIconVariant="warning"
variant="small"
Expand Down
Loading

0 comments on commit 9cbcf12

Please sign in to comment.