|
| 1 | +import { |
| 2 | + inferenceServiceModal, |
| 3 | + modelServingGlobal, |
| 4 | + modelServingSection, |
| 5 | +} from '#~/__tests__/cypress/cypress/pages/modelServing'; |
| 6 | +import { projectDetails, projectListPage } from '#~/__tests__/cypress/cypress/pages/projects'; |
| 7 | +import type { DataScienceProjectData } from '#~/__tests__/cypress/cypress/types'; |
| 8 | +import { loadDSPFixture } from '#~/__tests__/cypress/cypress/utils/dataLoader'; |
| 9 | +import { HTPASSWD_CLUSTER_ADMIN_USER } from '#~/__tests__/cypress/cypress/utils/e2eUsers'; |
| 10 | +import { |
| 11 | + checkInferenceServiceState, |
| 12 | + provisionProjectForModelServing, |
| 13 | +} from '#~/__tests__/cypress/cypress/utils/oc_commands/modelServing'; |
| 14 | +import { deleteOpenShiftProject } from '#~/__tests__/cypress/cypress/utils/oc_commands/project'; |
| 15 | +import { retryableBefore } from '#~/__tests__/cypress/cypress/utils/retryableHooks'; |
| 16 | +import { generateTestUUID } from '#~/__tests__/cypress/cypress/utils/uuidGenerator'; |
| 17 | + |
| 18 | +let testData: DataScienceProjectData; |
| 19 | +let projectName: string; |
| 20 | +let modelName: string; |
| 21 | +let modelFilePath: string; |
| 22 | +const awsBucket = 'BUCKET_1' as const; |
| 23 | +const uuid = generateTestUUID(); |
| 24 | + |
| 25 | +describe('[Product Bug: RHOAIENG-31261] Verify a user can deploy KServe Raw Deployment Model', () => { |
| 26 | + retryableBefore(() => { |
| 27 | + cy.log('Loading test data'); |
| 28 | + return loadDSPFixture('e2e/dataScienceProjects/testDeployKserveRaw.yaml').then( |
| 29 | + (fixtureData: DataScienceProjectData) => { |
| 30 | + testData = fixtureData; |
| 31 | + projectName = `${testData.projectResourceName}-${uuid}`; |
| 32 | + modelName = testData.singleModelName; |
| 33 | + modelFilePath = testData.modelOpenVinoPath; |
| 34 | + |
| 35 | + if (!projectName) { |
| 36 | + throw new Error('Project name is undefined or empty in the loaded fixture'); |
| 37 | + } |
| 38 | + cy.log(`Loaded project name: ${projectName}`); |
| 39 | + |
| 40 | + // Provision project with data connection for model serving |
| 41 | + provisionProjectForModelServing( |
| 42 | + projectName, |
| 43 | + awsBucket, |
| 44 | + 'resources/yaml/data_connection_model_serving.yaml', |
| 45 | + ); |
| 46 | + }, |
| 47 | + ); |
| 48 | + }); |
| 49 | + |
| 50 | + after(() => { |
| 51 | + cy.log(`Cleaning up project: ${projectName}`); |
| 52 | + // Delete provisioned Project - wait for completion due to RHOAIENG-19969 to support test retries, 5 minute timeout |
| 53 | + // TODO: Review this timeout once RHOAIENG-19969 is resolved |
| 54 | + deleteOpenShiftProject(projectName, { wait: true, ignoreNotFound: true, timeout: 300000 }); |
| 55 | + }); |
| 56 | + |
| 57 | + it( |
| 58 | + 'Verify model deployment with Standard deployment mode (KServe Raw)', |
| 59 | + { |
| 60 | + tags: ['@Smoke', '@SmokeSet3', '@Dashboard', '@Modelserving', '@NonConcurrent', '@Bug'], |
| 61 | + }, |
| 62 | + () => { |
| 63 | + cy.step(`Log into the application with ${HTPASSWD_CLUSTER_ADMIN_USER.USERNAME}`); |
| 64 | + cy.visitWithLogin('/', HTPASSWD_CLUSTER_ADMIN_USER); |
| 65 | + // Project navigation |
| 66 | + cy.step(`Navigate to the Project list tab and search for ${projectName}`); |
| 67 | + projectListPage.navigate(); |
| 68 | + projectListPage.filterProjectByName(projectName); |
| 69 | + projectListPage.findProjectLink(projectName).click(); |
| 70 | + // Navigate to Model Serving section and Deploy a Model |
| 71 | + cy.step('Navigate to Model Serving and click to Deploy a Single Model'); |
| 72 | + projectDetails.findSectionTab('model-server').click(); |
| 73 | + modelServingGlobal.findSingleServingModelButton().click(); |
| 74 | + modelServingGlobal.findDeployModelButton().click(); |
| 75 | + inferenceServiceModal.shouldBeOpen(); |
| 76 | + cy.step('Launch a Single Serving Model and configure deployment mode'); |
| 77 | + inferenceServiceModal.findModelNameInput().type(modelName); |
| 78 | + inferenceServiceModal.findServingRuntimeTemplateSearchSelector().click(); |
| 79 | + inferenceServiceModal.findGlobalScopedTemplateOption('OpenVINO Model Server').click(); |
| 80 | + inferenceServiceModal.findModelFrameworkSelect().click(); |
| 81 | + inferenceServiceModal.findOpenVinoIROpSet13().click(); |
| 82 | + // Select Standard Deployment mode (KServe Raw) |
| 83 | + cy.step( |
| 84 | + 'Verify deployment mode dropdown exists and Select Standard Deployment mode (KServe Raw)', |
| 85 | + ); |
| 86 | + inferenceServiceModal.findDeploymentModeSelect().should('exist'); |
| 87 | + inferenceServiceModal.findDeploymentModeSelect().findSelectOption('Standard').click(); |
| 88 | + inferenceServiceModal |
| 89 | + .findDeploymentModeSelect() |
| 90 | + .findSelectOption('Standard') |
| 91 | + .should('have.attr', 'aria-selected', 'true'); |
| 92 | + |
| 93 | + inferenceServiceModal |
| 94 | + .findDeploymentModeSelect() |
| 95 | + .findSelectOption('Advanced') |
| 96 | + .should('have.attr', 'aria-selected', 'false'); |
| 97 | + inferenceServiceModal.findLocationPathInput().type(modelFilePath); |
| 98 | + cy.step('Deploy the model'); |
| 99 | + inferenceServiceModal.findSubmitButton().click(); |
| 100 | + inferenceServiceModal.shouldBeOpen(false); |
| 101 | + modelServingSection.findModelServerDeployedName(modelName); |
| 102 | + |
| 103 | + cy.step('Verify that the Model is created Successfully on the backend and frontend'); |
| 104 | + // For KServe Raw deployments, we only need to check Ready condition |
| 105 | + // LatestDeploymentReady is specific to Serverless deployments |
| 106 | + // Validate DeploymentMode parameter in inferenceService is RawDeployment |
| 107 | + checkInferenceServiceState( |
| 108 | + modelName, |
| 109 | + projectName, |
| 110 | + { |
| 111 | + checkReady: true, |
| 112 | + }, |
| 113 | + 'RawDeployment', |
| 114 | + ); |
| 115 | + }, |
| 116 | + ); |
| 117 | +}); |
0 commit comments