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

Add custom container size to workbenches table #2944

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
137 changes: 70 additions & 67 deletions frontend/src/__mocks__/mockDashboardConfig.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { DashboardConfigKind, KnownLabels } from '~/k8sTypes';
import { NotebookSize } from '~/types';

type MockDashboardConfigType = {
disableInfo?: boolean;
Expand Down Expand Up @@ -26,6 +27,7 @@ type MockDashboardConfigType = {
disableDistributedWorkloads?: boolean;
disableModelRegistry?: boolean;
disableNotebookController?: boolean;
notebookSizes?: NotebookSize[];
};

export const mockDashboardConfig = ({
Expand Down Expand Up @@ -54,6 +56,73 @@ export const mockDashboardConfig = ({
disableDistributedWorkloads = false,
disableModelRegistry = true,
disableNotebookController = false,
notebookSizes = [
{
name: 'XSmall',
resources: {
limits: {
cpu: '0.5',
memory: '500Mi',
},
requests: {
cpu: '0.1',
memory: '100Mi',
},
},
},
{
name: 'Small',
resources: {
limits: {
cpu: '2',
memory: '8Gi',
},
requests: {
cpu: '1',
memory: '8Gi',
},
},
},
{
name: 'Medium',
resources: {
limits: {
cpu: '6',
memory: '24Gi',
},
requests: {
cpu: '3',
memory: '24Gi',
},
},
},
{
name: 'Large',
resources: {
limits: {
cpu: '14',
memory: '56Gi',
},
requests: {
cpu: '7',
memory: '56Gi',
},
},
},
{
name: 'X Large',
resources: {
limits: {
cpu: '30',
memory: '120Gi',
},
requests: {
cpu: '15',
memory: '120Gi',
},
},
},
],
}: MockDashboardConfigType): DashboardConfigKind => ({
apiVersion: 'opendatahub.io/v1alpha',
kind: 'OdhDashboardConfig',
Expand Down Expand Up @@ -147,73 +216,7 @@ export const mockDashboardConfig = ({
},
},
],
notebookSizes: [
{
name: 'XSmall',
resources: {
limits: {
cpu: '0.5',
memory: '500Mi',
},
requests: {
cpu: '0.1',
memory: '100Mi',
},
},
},
{
name: 'Small',
resources: {
limits: {
cpu: '2',
memory: '8Gi',
},
requests: {
cpu: '1',
memory: '8Gi',
},
},
},
{
name: 'Medium',
resources: {
limits: {
cpu: '6',
memory: '24Gi',
},
requests: {
cpu: '3',
memory: '24Gi',
},
},
},
{
name: 'Large',
resources: {
limits: {
cpu: '14',
memory: '56Gi',
},
requests: {
cpu: '7',
memory: '56Gi',
},
},
},
{
name: 'X Large',
resources: {
limits: {
cpu: '30',
memory: '120Gi',
},
requests: {
cpu: '15',
memory: '120Gi',
},
},
},
],
notebookSizes,
templateOrder: ['test-model'],
templateDisablement: ['test-model'],
},
Expand Down
8 changes: 8 additions & 0 deletions frontend/src/__tests__/cypress/cypress/pages/workbench.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,10 @@ class CreateSpawnerPage {
findBucketInput() {
return cy.findByTestId('field AWS_S3_BUCKET');
}

findContainerSizeInput(name: string) {
return cy.findByTestId('container-size-group').contains(name);
}
}

class EditSpawnerPage extends CreateSpawnerPage {
Expand Down Expand Up @@ -326,6 +330,10 @@ class EditSpawnerPage extends CreateSpawnerPage {
cy.findByTestId('container-size-group').contains(name).should('exist');
return this;
}

findCancelButton() {
return cy.findByTestId('workbench-cancel-button');
}
}

class NotFoundSpawnerPage {
Expand Down
Loading
Loading