diff --git a/tests/resources/odh-dashboard/crd/kustomization.yaml b/tests/resources/odh-dashboard/crd/kustomization.yaml new file mode 100644 index 000000000..526cca4ad --- /dev/null +++ b/tests/resources/odh-dashboard/crd/kustomization.yaml @@ -0,0 +1,10 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +commonLabels: + app: odh-dashboard + app.kubernetes.io/part-of: odh-dashboard +resources: +- odh-dashboard-crd.yaml +- odh-quick-start-crd.yaml +- odh-document-crd.yaml +- odh-application-crd.yaml diff --git a/tests/resources/odh-dashboard/crd/odh-application-crd.yaml b/tests/resources/odh-dashboard/crd/odh-application-crd.yaml new file mode 100644 index 000000000..d8f8ca493 --- /dev/null +++ b/tests/resources/odh-dashboard/crd/odh-application-crd.yaml @@ -0,0 +1,166 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.4.1 + creationTimestamp: null + name: odhapplications.dashboard.opendatahub.io +spec: + group: dashboard.opendatahub.io + names: + kind: OdhApplication + listKind: OdhApplicationList + plural: odhapplications + singular: odhapplication + scope: Namespaced + versions: + - name: v1 + schema: + openAPIV3Schema: + description: OdhApplication is the Schema for the odhapplications + API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: OdhApplicationSpec defines the desired state of OdhApplication + properties: + beta: + type: boolean + betaText: + type: string + betaTitle: + type: string + category: + type: string + comingSoon: + type: boolean + consoleLink: + type: string + csvName: + type: string + description: + type: string + displayName: + type: string + docsLink: + type: string + enable: + properties: + actionLabel: + type: string + description: + type: string + link: + type: string + linkPreface: + type: string + title: + type: string + validationConfigMap: + type: string + validationJob: + type: string + validationSecret: + type: string + variableDisplayText: + additionalProperties: + type: string + type: object + variableHelpText: + additionalProperties: + type: string + type: object + variables: + additionalProperties: + type: string + type: object + type: object + enableCR: + properties: + field: + type: string + group: + type: string + name: + type: string + namespace: + type: string + plural: + type: string + value: + type: string + version: + type: string + type: object + endpoint: + type: string + featureFlag: + type: string + getStartedLink: + type: string + getStartedMarkDown: + type: string + img: + type: string + isEnabled: + type: boolean + kfdefApplications: + items: + type: string + type: array + link: + type: string + provider: + type: string + quickStart: + type: string + internalRoute: + type: string + route: + type: string + routeNamespace: + type: string + routeSuffix: + type: string + serviceName: + type: string + support: + type: string + required: + - description + - displayName + - docsLink + - getStartedLink + - getStartedMarkDown + - img + - provider + - support + type: object + status: + description: OdhApplicationStatus defines the observed state of OdhApplication + properties: + enabled: + type: boolean + type: object + type: object + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/tests/resources/odh-dashboard/crd/odh-dashboard-crd.yaml b/tests/resources/odh-dashboard/crd/odh-dashboard-crd.yaml new file mode 100644 index 000000000..31b00d78c --- /dev/null +++ b/tests/resources/odh-dashboard/crd/odh-dashboard-crd.yaml @@ -0,0 +1,98 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: odhdashboardconfigs.opendatahub.io +spec: + group: opendatahub.io + scope: Namespaced + names: + plural: odhdashboardconfigs + singular: odhdashboardconfig + kind: OdhDashboardConfig + versions: + - name: v1alpha + served: true + storage: true + schema: + openAPIV3Schema: + type: object + required: + - spec + properties: + spec: + type: object + properties: + dashboardConfig: + type: object + properties: + enablement: + type: boolean + disableInfo: + type: boolean + disableSupport: + type: boolean + disableClusterManager: + type: boolean + disableTracking: + type: boolean + disableBYONImageStream: + type: boolean + disableISVBadges: + type: boolean + disableUserManagement: + type: boolean + groupsConfig: + type: object + required: + - adminGroups + - allowedGroups + properties: + adminGroups: + type: string + allowedGroups: + type: string + notebookSizes: + type: array + items: + type: object + required: + - name + - resources + properties: + name: + type: string + resources: + type: object + properties: + requests: + type: object + properties: + cpu: + type: string + memory: + type: string + limits: + type: object + properties: + cpu: + type: string + memory: + type: string + notebookController: + type: object + required: + - enabled + properties: + enabled: + type: boolean + notebookNamespace: + type: string + pvcSize: + type: string + notebookTolerationSettings: + type: object + properties: + enabled: + type: boolean + key: + type: string diff --git a/tests/resources/odh-dashboard/crd/odh-document-crd.yaml b/tests/resources/odh-dashboard/crd/odh-document-crd.yaml new file mode 100644 index 000000000..ceb11f5ba --- /dev/null +++ b/tests/resources/odh-dashboard/crd/odh-document-crd.yaml @@ -0,0 +1,81 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.4.1 + creationTimestamp: null + name: odhdocuments.dashboard.opendatahub.io +spec: + group: dashboard.opendatahub.io + names: + kind: OdhDocument + listKind: OdhDocumentList + plural: odhdocuments + singular: odhdocument + scope: Namespaced + versions: + - name: v1 + schema: + openAPIV3Schema: + description: OdhDocument is the Schema for the odhdocuments + API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: OdhDocumentSpec defines the desired state of OdhDocument + properties: + appName: + type: string + description: + type: string + displayName: + type: string + durationMinutes: + type: integer + featureFlag: + type: string + icon: + type: string + img: + type: string + provider: + type: string + type: + type: string + url: + type: string + required: + - description + - displayName + - durationMinutes + - type + - url + type: object + status: + description: OdhDocumentStatus defines the observed state of OdhDocument + properties: + enabled: + type: boolean + type: object + type: object + served: true + storage: true + subresources: + status: {} +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] diff --git a/tests/resources/odh-dashboard/crd/odh-quick-start-crd.yaml b/tests/resources/odh-dashboard/crd/odh-quick-start-crd.yaml new file mode 100644 index 000000000..ae15d396d --- /dev/null +++ b/tests/resources/odh-dashboard/crd/odh-quick-start-crd.yaml @@ -0,0 +1,206 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: odhquickstarts.console.openshift.io + annotations: + description: Extension for guiding user through various workflows in the Red Hat + OpenShift Data Science dashboard. + displayName: OdhQuickStart + include.release.openshift.io/ibm-cloud-managed: "true" + include.release.openshift.io/self-managed-high-availability: "true" + include.release.openshift.io/single-node-developer: "true" +spec: + scope: Namespaced + group: console.openshift.io + names: + plural: odhquickstarts + singular: odhquickstart + kind: OdhQuickStart + listKind: OdhQuickStartList + versions: + - name: v1 + served: true + storage: true + schema: + openAPIV3Schema: + description: OdhQuickStart is an extension for guiding user through various + workflows in the Red Hat OpenShift Data Science dashboard. + type: object + required: + - spec + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: OdhQuickStartSpec is the desired quick start configuration. + type: object + required: + - description + - displayName + - durationMinutes + - introduction + - tasks + properties: + accessReviewResources: + description: accessReviewResources contains a list of resources that + the user's access will be reviewed against in order for the user + to complete the Quick Start. The Quick Start will be hidden if any + of the access reviews fail. + type: array + items: + description: ResourceAttributes includes the authorization attributes + available for resource requests to the Authorizer interface + type: object + properties: + group: + description: Group is the API Group of the Resource. "*" means + all. + type: string + name: + description: Name is the name of the resource being requested + for a "get" or deleted for a "delete". "" (empty) means all. + type: string + namespace: + description: Namespace is the namespace of the action being + requested. Currently, there is no distinction between no + namespace and all namespaces "" (empty) is defaulted for LocalSubjectAccessReviews + "" (empty) is empty for cluster-scoped resources "" (empty) + means "all" for namespace scoped resources from a SubjectAccessReview + or SelfSubjectAccessReview + type: string + resource: + description: Resource is one of the existing resource types. "*" + means all. + type: string + subresource: + description: Subresource is one of the existing resource types. "" + means none. + type: string + verb: + description: 'Verb is a kubernetes resource API verb, like: + get, list, watch, create, update, delete, proxy. "*" means + all.' + type: string + version: + description: Version is the API Version of the Resource. "*" + means all. + type: string + appName: + description: the name/id of the odh application the quick start pertains to + type: string + conclusion: + description: conclusion sums up the Quick Start and suggests the possible + next steps. (includes markdown) + type: string + description: + description: description is the description of the Quick Start. (includes + markdown) + type: string + maxLength: 256 + minLength: 1 + displayName: + description: displayName is the display name of the Quick Start. + type: string + minLength: 1 + durationMinutes: + description: durationMinutes describes approximately how many minutes + it will take to complete the Quick Start. + type: integer + minimum: 1 + icon: + description: icon is a base64 encoded image that will be displayed + beside the Quick Start display name. The icon should be an vector + image for easy scaling. The size of the icon should be 40x40. + type: string + introduction: + description: introduction describes the purpose of the Quick Start. + (includes markdown) + type: string + minLength: 1 + nextQuickStart: + description: nextQuickStart is a list of the following Quick Starts, + suggested for the user to try. + type: array + items: + type: string + prerequisites: + description: prerequisites contains all prerequisites that need to + be met before taking a Quick Start. (includes markdown) + type: array + items: + type: string + tags: + description: tags is a list of strings that describe the Quick Start. + type: array + items: + type: string + tasks: + description: tasks is the list of steps the user has to perform to + complete the Quick Start. + type: array + minItems: 1 + items: + description: OdhQuickStartTask is a single step in a Quick Start. + type: object + required: + - description + - title + properties: + description: + description: description describes the steps needed to complete + the task. (includes markdown) + type: string + minLength: 1 + review: + description: review contains instructions to validate the task + is complete. The user will select 'Yes' or 'No'. using a radio + button, which indicates whether the step was completed successfully. + type: object + required: + - failedTaskHelp + - instructions + properties: + failedTaskHelp: + description: failedTaskHelp contains suggestions for a failed + task review and is shown at the end of task. (includes + markdown) + type: string + minLength: 1 + instructions: + description: instructions contains steps that user needs + to take in order to validate his work after going through + a task. (includes markdown) + type: string + minLength: 1 + summary: + description: summary contains information about the passed step. + type: object + required: + - failed + - success + properties: + failed: + description: failed briefly describes the unsuccessfully + passed task. (includes markdown) + type: string + maxLength: 128 + minLength: 1 + success: + description: success describes the succesfully passed task. + type: string + minLength: 1 + title: + description: title describes the task and is displayed as a + step heading. + type: string + minLength: 1 diff --git a/tests/resources/ods-ci/test-odh-dashboard-jupyterlab-notebook.robot b/tests/resources/ods-ci/test-odh-dashboard-jupyterlab-notebook.robot index 1fb5a35a8..d10891d50 100644 --- a/tests/resources/ods-ci/test-odh-dashboard-jupyterlab-notebook.robot +++ b/tests/resources/ods-ci/test-odh-dashboard-jupyterlab-notebook.robot @@ -26,6 +26,13 @@ Can Spawn Notebook # We need to skip this testcase if the user has an existing pod Fix Spawner Status Capture Page Screenshot + + # Due to an issue with ods-ci checking for downstream versions we need to + # check the box to "Start server in current tab" to since the automation is skipping the + # logic that handles the selection for showing JupyterLab in current vs new tab + # See https://github.com/red-hat-data-services/ods-ci/blob/1.20.0/tests/Resources/Page/ODH/JupyterHub/JupyterHubSpawner.robot#L201 + Click Element id:checkbox-notebook-browser-tab-preference + Spawn Notebook With Arguments image=jupyter-datascience-notebook Can Launch Python3 Smoke Test Notebook @@ -47,7 +54,7 @@ Can Launch Python3 Smoke Test Notebook Stop JupyterLab Notebook Server # All of the keywords below are workarounds until official support for ODH automation is added to ods-ci -#TODO: Update ods-ci to support ODH builds of dashbaord and it's components +#TODO: Update ods-ci to support ODH builds of dashboard and associated components *** Keywords *** Wait for ODH Dashboard to Load [Arguments] ${dashboard_title}="Open Data Hub" ${odh_logo_xpath}=//img[@alt="Open Data Hub Logo"] diff --git a/tests/scripts/install.sh b/tests/scripts/install.sh index 11e32158a..416c2203d 100755 --- a/tests/scripts/install.sh +++ b/tests/scripts/install.sh @@ -75,6 +75,17 @@ if ! [ -z "${SKIP_KFDEF_INSTALL}" ]; then ## the KfDef creation echo "Relying on existing KfDef because SKIP_KFDEF_INSTALL was set" else + + + oc get crd odhdashboardconfigs.opendatahub.io + result=$? + # Apply ODH Dashboard CRDs if not applied + # In ODH 1.4.1, the CRDs will be bundled with the ODH operator install + if [ "$result" -ne 0 ]; then + echo "Deploying missing ODH Dashboard CRDs" + oc apply -k $HOME/peak/operator-tests/odh-manifests/resources/odh-dashboard/crd + fi + echo "Creating the following KfDef" cat ./${KFDEF_FILENAME} > ${ARTIFACT_DIR}/${KFDEF_FILENAME} oc apply -f ./${KFDEF_FILENAME}