Skip to content

Commit

Permalink
Build ODS-CI test image on release-2.16 branch
Browse files Browse the repository at this point in the history
  • Loading branch information
liswang89 committed Jan 2, 2025
1 parent aab4916 commit e467da4
Show file tree
Hide file tree
Showing 22 changed files with 149 additions and 30 deletions.
54 changes: 54 additions & 0 deletions ods_ci/build/Dockerfile_interop
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
FROM quay.io/centos/centos:stream9

# Use this build arg to set any default test script arguments
ENV RUN_SCRIPT_ARGS=${RUN_SCRIPT_ARGS}
ENV ROBOT_EXTRA_ARGS=''
ENV SET_ENVIRONMENT=0
ENV RETURN_PW=0
ENV OC_HOST=${OC_HOST}
ENV RUN_FROM_CONTAINER=1
ENV SE_BROWSER_PATH=/usr/bin/chromium-browser
ARG OC_VERSION=4.13
ARG OC_CHANNEL=stable
ARG PYTHON_VERSION=3.11

ENV ODS_VENV="/ods_venv" \
HOME="/ods_venv" \
PATH="ods_venv/bin:${PATH}" \
AM_I_IN_CONTAINER="Yes" \
PYTHONUNBUFFERED="True"

WORKDIR /ods_venv

COPY . ${ODS_VENV}
COPY ods_ci/test-variables.yml.example ${ODS_VENV}/ods_ci/test-variables.yml

RUN dnf install epel-release -y &&\
dnf -y update &&\
dnf install -y jq git unzip chromium chromedriver httpd-tools gcc wget \
python3 python3-devel python3-distro python-pip python${PYTHON_VERSION} python${PYTHON_VERSION}-devel &&\
dnf clean all && rm -rf /var/cache/yum &&\
curl --proto "=https" -L https://github.com/mikefarah/yq/releases/download/v4.34.1/yq_linux_amd64 -o /usr/bin/yq &&\
chmod +x /usr/bin/yq &&\
curl --proto "=https" -L https://mirror.openshift.com/pub/openshift-v$(echo ${OC_VERSION} | cut -d'.' -f 1)/x86_64/clients/ocp/${OC_CHANNEL}-${OC_VERSION}/openshift-client-linux.tar.gz -o ${HOME}/oc_client.tar.gz && \
tar xvf ${HOME}/oc_client.tar.gz -C /usr/local/bin/ && \
rm -rf ${HOME}/oc_client.tar.gz && rm /usr/local/bin/README.md && chmod 755 /usr/local/bin/oc && oc version --client && \
curl --proto "=https" -L https://github.com/openshift-online/ocm-cli/releases/download/v0.1.62/ocm-linux-amd64 -o ${HOME}/ocm && \
mv ${HOME}/ocm /usr/local/bin/ && chmod 755 /usr/local/bin/ocm && ocm version && \
wget https://github.com/fullstorydev/grpcurl/releases/download/v1.8.7/grpcurl_1.8.7_linux_x86_64.tar.gz -q && \
tar xzf grpcurl_1.8.7_linux_x86_64.tar.gz && \
rm -rf grpcurl_1.8.7_linux_x86_64.tar.gz && \
mv grpcurl /usr/bin/grpcurl && \
chmod +x /usr/bin/grpcurl

RUN alternatives --install /usr/local/bin/python3 python3 /usr/bin/python${PYTHON_VERSION} 1
RUN python3 --version
RUN curl -sSL https://install.python-poetry.org | python3 -
ENV PATH="${PATH}:${HOME}/.local/bin"
RUN poetry install

RUN chgrp -R 0 ${ODS_VENV} && \
chmod -R g+rwX ${ODS_VENV}

USER 1001
WORKDIR ${ODS_VENV}/ods_ci
2 changes: 1 addition & 1 deletion ods_ci/build/install_idp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ function create_groups_and_assign_users(){
groups=($groups)
for group in "${groups[@]}"; do
if [[ $group == *"dedicated-admins"* ]]; then
if [ "${USE_OCM_IDP}" -eq 1 ]
if [ "${USE_OCM_IDP}" -eq 0 ]
then
add_users_to_ocm_dedicated_admins $prefix
continue
Expand Down
64 changes: 64 additions & 0 deletions ods_ci/run_interop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#!/bin/bash

export SET_ENVIRONMENT=1
export USE_OCM_IDP=0
export RUN_SCRIPT_ARGS="skip-oclogin true --set-urls-variables true"
export ROBOT_EXTRA_ARGS="-i Smoke --dryrun"

TEST_CASE_FILE="tests/Tests"
TEST_VARIABLES_FILE="test-variables.yml"

echo "Install IDP users and map them to test config file"
./build/install_idp.sh

echo "Update test config file..."
AWS_SHARED_CREDENTIALS_FILE="${CLUSTER_PROFILE_DIR}/.awscred"
AWS_ACCESS_KEY_ID=$(cat $AWS_SHARED_CREDENTIALS_FILE | grep aws_access_key_id | tr -d ' ' | cut -d '=' -f 2)
AWS_SECRET_ACCESS_KEY=$(cat $AWS_SHARED_CREDENTIALS_FILE | grep aws_secret_access_key | tr -d ' ' | cut -d '=' -f 2)
export AWS_ACCESS_KEY_ID
export AWS_SECRET_ACCESS_KEY

yq -i '.OCP_API_URL=env(OC_HOST)' "${TEST_VARIABLES_FILE}"
yq -i '.OCP_CONSOLE_URL=env(OCP_CONSOLE)' "${TEST_VARIABLES_FILE}"
yq -i '.ODH_DASHBOARD_URL=env(RHODS_DASHBOARD)' "${TEST_VARIABLES_FILE}"
yq -i '.BROWSER.NAME="firefox"' "${TEST_VARIABLES_FILE}"
yq -i '.S3.AWS_ACCESS_KEY_ID=env(AWS_ACCESS_KEY_ID)' "${TEST_VARIABLES_FILE}"
yq -i '.S3.AWS_SECRET_ACCESS_KEY=env(AWS_SECRET_ACCESS_KEY)' "${TEST_VARIABLES_FILE}"
yq -i '.S3.BUCKET_1.NAME="ods-ci-s3"' "${TEST_VARIABLES_FILE}"
yq -i '.S3.BUCKET_1.REGION="us-east-1"' "${TEST_VARIABLES_FILE}"
yq -i '.S3.BUCKET_1.ENDPOINT="https://s3.amazonaws.com/"' "${TEST_VARIABLES_FILE}"
yq -i '.S3.BUCKET_2.NAME="ods-ci-ds-pipelines"' "${TEST_VARIABLES_FILE}"
yq -i '.S3.BUCKET_2.REGION="us-east-1"' "${TEST_VARIABLES_FILE}"
yq -i '.S3.BUCKET_2.ENDPOINT="https://s3.amazonaws.com/"' "${TEST_VARIABLES_FILE}"
yq -i '.S3.BUCKET_3.NAME="ods-ci-wisdom"' "${TEST_VARIABLES_FILE}"
yq -i '.S3.BUCKET_3.REGION="us-east-1"' "${TEST_VARIABLES_FILE}"
yq -i '.S3.BUCKET_3.ENDPOINT="https://s3.amazonaws.com/"' "${TEST_VARIABLES_FILE}"
yq -i '.S3.BUCKET_4.NAME="ods-ci-pachyderm"' "${TEST_VARIABLES_FILE}"
yq -i '.S3.BUCKET_4.REGION="us-east-1"' "${TEST_VARIABLES_FILE}"
yq -i '.S3.BUCKET_4.ENDPOINT="https://s3.amazonaws.com/"' "${TEST_VARIABLES_FILE}"
yq -i '.S3.BUCKET_5.NAME="rhoai-dw"' "${TEST_VARIABLES_FILE}"
yq -i '.S3.BUCKET_5.REGION="us-east-1"' "${TEST_VARIABLES_FILE}"
yq -i '.S3.BUCKET_5.ENDPOINT="https://s3.amazonaws.com/"' "${TEST_VARIABLES_FILE}"

echo "Performing oc login with cluster admin"
username=$(yq eval '.OCP_ADMIN_USER.USERNAME' "${TEST_VARIABLES_FILE}")
password=$(yq eval '.OCP_ADMIN_USER.PASSWORD' "${TEST_VARIABLES_FILE}")
oc login "$OC_HOST" --username "${username}" --password "${password}" --insecure-skip-tls-verify=true
retVal=$?
if [ $retVal -ne 0 ]; then
echo "The oc login command seems to have failed"
echo "Please review the content of $TEST_VARIABLES_FILE"
exit "$retVal"
fi

if [[ -z "${TEST_SUITE}" ]]; then
echo "Define TEST_SUITE"
exit 1
fi

if [[ -z "${ARTIFACT_DIR}" ]]; then
echo "Define ARTIFACT_DIR"
ARTIFACT_DIR="/tmp"
fi

poetry run robot --include ${TEST_SUITE} -d ${ARTIFACT_DIR} -x xunit_test_result.xml -r test_report.html --variablefile ${TEST_VARIABLES_FILE} ${TEST_CASE_FILE}
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ Install ODH Operator

Open OCP Console
Open Page ${OCP_CONSOLE_URL}
Wait Until Page Contains Element xpath:${OCP_LOADING_ANIMATION_XPATH} timeout=5s
Wait Until Page Does Not Contain Element xpath:${OCP_LOADING_ANIMATION_XPATH} timeout=10s
## Wait Until Page Contains Element xpath:${OCP_LOADING_ANIMATION_XPATH} timeout=5s
## Wait Until Page Does Not Contain Element xpath:${OCP_LOADING_ANIMATION_XPATH} timeout=10s
Wait Until Element is Visible xpath://div[@class="pf-c-login"] timeout=10s

Navigate to OperatorHub
Menu.Navigate To Page Operators OperatorHub timeout=30s
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ Verify RHODS Dashboard Explore And Enabled Page Has No Message With No Component
Verify RHODS Display Name and Version
[Documentation] Verify consistent rhods display name and version using
... ClusterServiceVersion CR
[Tags] Smoke
[Tags] Smoke Interop
... Tier1
... ODS-1862
IF "${PRODUCT}" == "${None}" or "${PRODUCT}" == "RHODS"
Expand Down Expand Up @@ -289,7 +289,7 @@ Verify RHODS Notebooks Network Policies

Verify All The Pods Are Using Image Digest Instead Of Tags
[Documentation] Verifies that the all the rhods pods are using image digest
[Tags] Smoke
[Tags] Smoke Interop
... Tier1
... ODS-2406
... Operator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ Verify That DSC And DSCI Release.Name Attribute matches ${expected_release_name}
... ODH: Open Data Hub
... RHOAI managed: OpenShift AI Cloud Service
... RHOAI selfmanaged: OpenShift AI Self-Managed
[Tags] Smoke
[Tags] Smoke Interop
... Operator
... RHOAIENG-9760
Should Be Equal As Strings ${DSC_RELEASE_NAME} ${expected_release_name}
Should Be Equal As Strings ${DSCI_RELEASE_NAME} ${expected_release_name}

Verify That DSC And DSCI Release.Version Attribute matches the value in the subscription
[Documentation] Tests the release.version attribute from the DSC and DSCI matches the value in the subscription.
[Tags] Smoke
[Tags] Smoke Interop
... Operator
... RHOAIENG-8082
${rc} ${csv_name}= Run And Return Rc And Output
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Resource ../../../Resources/CLI/MustGather/MustGather.resource
*** Test Cases ***
Verify that the must-gather image provides RHODS logs and info
[Documentation] Tests the must-gather image for ODH/RHOAI
[Tags] Smoke
[Tags] Smoke Interop
... ODS-505
... Operator
... MustGather
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ Verify Documentation Links HTTP Status Code
[Documentation] It verifies the documentation links present in question mark and
... also checks the RHODS dcoumentation link present in resource page.
... ProductBug: RHOAIENG-11451 (on ODH only)
[Tags] Smoke
[Tags] Smoke Interop
... ODS-327 ODS-492
${links}= Get RHODS Documentation Links From Dashboard
# Compare Doc Links only by number, since ODH and RHOAI have diffrent URLs (but same count)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ ${CUSTOM_APP_DICT_PATH}= tests/Resources/Files/CustomAppInfoDictionary.js
Verify Custom "QuickStart" Resource Creation
[Documentation] Create a Custom Resource "QuickStart" by using Dashboard CRDs: OdhQuickStart,
... and verify steps execution in Sidebar.
[Tags] Smoke
[Tags] Smoke Interop
... ODS-697
${exp_titles}= Create List ${EXPECTED_ITEMS_TITLES["quickstart"]}
Check Items Have Been Displayed In Resources Page resource_filter=QuickStart
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ ${NEW_PRJ_TITLE}= ODS-CI DS Project Updated
Verify Data Science Projects Page Is Accessible
[Documentation] Verifies "Data Science Projects" page is accessible from
... the navigation menu on the left
[Tags] Smoke
[Tags] Smoke Interop
... ODS-1876
Open Data Science Projects Home Page
Page Should Contain Element ${PROJECT_CREATE_BTN_XP}

Verify User Can Access Jupyter Launcher From DS Project Page
[Documentation] Verifies Data Science Projects home page contains
... a link to Jupyter Spawner and it is working
[Tags] Smoke
[Tags] Smoke Interop
... ODS-1877
Open Data Science Projects Home Page
Page Should Contain Element ${SPAWNER_LINK}
Expand Down Expand Up @@ -104,7 +104,7 @@ Verify User Cannot Create Project Using Special Chars In Resource Name
Close Generic Modal If Present

Verify User Can Create A Data Science Project
[Tags] Smoke
[Tags] Smoke Interop
... ODS-1775
[Documentation] Verifies users can create a DS project
Open Data Science Projects Home Page
Expand All @@ -114,7 +114,7 @@ Verify User Can Create A Data Science Project
${ns_name}= Check Corresponding Namespace Exists project_title=${PRJ_TITLE}

Verify User Can Create And Start A Workbench With Existent PV Storage
[Tags] Smoke
[Tags] Smoke Interop
... ODS-1814
[Documentation] Verifies users can create a workbench and connect an existent PersistenVolume
${pv_name}= Set Variable ${PV_BASENAME}-existent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Suite Teardown End Web Test
Verify Base User Can Stop A Running Server
[Documentation] Verifies that a base user has enough permission to start
... and stop a notebook server
[Tags] Smoke
[Tags] Smoke Interop
... OpenDataHub
... ODS-1978
Launch KFNBC Spawner As Base User
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Test Tags JupyterHub
Verify All OOTB Images Have Version Dropdowns
[Documentation] Verifies all images in ${IMAGE_LIST} have a version dropdown
... with an N and N-1 pick.
[Tags] Smoke
[Tags] Smoke Interop
... ODS-2125
[Setup] Multiple Image Tags Suite Setup
FOR ${image} IN @{IMAGE_LIST}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Suite Teardown End Web Test

*** Test Cases ***
Test Special Usernames
[Tags] Smoke
[Tags] Smoke Interop
... OpenDataHub
... ODS-257 ODS-532
Open Browser ${ODH_DASHBOARD_URL} browser=${BROWSER.NAME} options=${BROWSER.OPTIONS}
Expand Down
6 changes: 3 additions & 3 deletions ods_ci/tests/Tests/0500__ide/0501__ide_jupyterhub/test.robot
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ Test Tags JupyterHub

*** Test Cases ***
Logged Into OpenShift
[Tags] Smoke
[Tags] Smoke Interop
... ODS-127
Open OCP Console
Login To Openshift ${TEST_USER.USERNAME} ${TEST_USER.PASSWORD} ${TEST_USER.AUTH_TYPE}
Wait Until OpenShift Console Is Loaded

Can Launch Jupyterhub
[Tags] Smoke
[Tags] Smoke Interop
... ODS-935
#This keyword will work with accounts that are not cluster admins.
Launch RHOAI Via OCP Application Launcher
Expand All @@ -32,7 +32,7 @@ Can Launch Jupyterhub
Launch Jupyter From RHODS Dashboard Link

Can Login To Jupyterhub
[Tags] Smoke
[Tags] Smoke Interop
... ODS-936
Login To Jupyterhub ${TEST_USER.USERNAME} ${TEST_USER.PASSWORD} ${TEST_USER.AUTH_TYPE}
${authorization_required} = Is Service Account Authorization Required
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Verify Anaconda Professional Is Available In RHODS Dashboard Explore/Enabled Pag
[Documentation] Tests if ACE and its Activation button are present in Explore page.
... If the button is not there, it checks if ACE is already enabled
[Tags] Smoke
... ODS-262
... ODS-262 Interop
Open Browser ${ODH_DASHBOARD_URL} browser=${BROWSER.NAME} options=${BROWSER.OPTIONS}
Login To RHODS Dashboard ${TEST_USER.USERNAME} ${TEST_USER.PASSWORD} ${TEST_USER.AUTH_TYPE}
Wait For RHODS Dashboard To Load
Expand Down
2 changes: 1 addition & 1 deletion ods_ci/tests/Tests/0500__ide/0504__ide_intel_aikit.robot
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ ${image_path} image-registry.openshift-image-registry.svc:5000
*** Test Cases ***
Verify Intel AIKIT Is Available In RHODS Dashboard Explore Page
[Tags] Smoke
... ODS-1017
... ODS-1017 Interop
Open Browser ${ODH_DASHBOARD_URL} browser=${BROWSER.NAME} options=${BROWSER.OPTIONS}
Login To RHODS Dashboard ${TEST_USER.USERNAME} ${TEST_USER.PASSWORD} ${TEST_USER.AUTH_TYPE}
Wait For RHODS Dashboard To Load
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ Test Tags ExcludeOnODH
Verify IBM Watsonx AI Is Available In RHODS Dashboard Explore Page
[Documentation] Very simple test to check that the Watsonx.ai tile/card is present
... in the list of applications on the Applications -> Explore page.
[Tags] Smoke
... ODS-267
[Tags] Smoke Interop
... ODS-267
Open Browser ${ODH_DASHBOARD_URL} browser=${BROWSER.NAME} options=${BROWSER.OPTIONS}
Login To RHODS Dashboard ${TEST_USER.USERNAME} ${TEST_USER.PASSWORD} ${TEST_USER.AUTH_TYPE}
Wait For RHODS Dashboard To Load
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Kueue smoke test
[Tags] Smoke
... DistributedWorkloads
... WorkloadsOrchestration
... ODS-2676
... ODS-2676 Interop
Log To Console Waiting for kueue-controller-manager to be available
${result} = Run Process oc wait --for\=condition\=Available --timeout\=300s -n ${APPLICATIONS_NAMESPACE} deployment/kueue-controller-manager
... shell=true stderr=STDOUT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Suite Teardown Teardown Codeflare E2E Test Suite
*** Test Cases ***
Ray smoke test
[Documentation] Check that Kuberay deployment and service are up and running
[Tags] Smoke
[Tags] Smoke Interop
... DistributedWorkloads
... Training
... ODS-2648
Expand All @@ -36,7 +36,7 @@ Ray smoke test

Codeflare smoke test
[Documentation] Check that Codeflare deployment and its monitoring service are up and running
[Tags] Smoke
[Tags] Smoke Interop
... DistributedWorkloads
... Training
... ODS-2675
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ ${EXPECTED_INFERENCE_OUTPUT_OPENVINO}= {"model_name":"${MODEL_NAME}__isvc-865
Verify Model Serving Installation
[Documentation] Verifies that the core components of model serving have been
... deployed in the ${APPLICATIONS_NAMESPACE} namespace
[Tags] Smoke
[Tags] Smoke Interop
... OpenDataHub
... ODS-1919
Run Keyword And Continue On Failure Wait Until Keyword Succeeds 5 min 10 sec
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Verify RHODS Admins Can Import A Custom Serving Runtime Template By Uploading A

Verify RHODS Admins Can Delete A Custom Serving Runtime Template
[Documentation] Verifies an admin user can delete a custom serving runtime
[Tags] Smoke ODS-2279
[Tags] Smoke Interop ODS-2279
[Setup] Create Test Serving Runtime Template If Not Exists
Open Dashboard Settings settings_page=Serving runtimes
Delete Serving Runtime Template displayed_name=${UPLOADED_OVMS_DISPLAYED_NAME}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Test Tags ExcludeOnODH

*** Test Cases ***
Verify RHOAM Is Available In RHODS Dashboard Explore Page
[Tags] Smoke Tier1
[Tags] Smoke Tier1 Interop
... ODS-271
Open Browser ${ODH_DASHBOARD_URL} browser=${BROWSER.NAME} options=${BROWSER.OPTIONS}
Login To RHODS Dashboard ${TEST_USER.USERNAME} ${TEST_USER.PASSWORD} ${TEST_USER.AUTH_TYPE}
Expand Down

0 comments on commit e467da4

Please sign in to comment.