diff --git a/test/scripts/openshift-ci/common.sh b/test/scripts/openshift-ci/common.sh old mode 100644 new mode 100755 diff --git a/test/scripts/openshift-ci/run-e2e-tests.sh b/test/scripts/openshift-ci/run-e2e-tests.sh index 5742f4974ae..4981a9e6d0f 100755 --- a/test/scripts/openshift-ci/run-e2e-tests.sh +++ b/test/scripts/openshift-ci/run-e2e-tests.sh @@ -51,9 +51,9 @@ fi : "${SETUP_E2E:=true}" if [ "$SETUP_E2E" = "true" ]; then - echo "Installing on cluster" + echo "⏳ Installing on the cluster" pushd $PROJECT_ROOT >/dev/null - ./test/scripts/openshift-ci/setup-e2e-tests.sh "${MARKERS}" "${PARALLELISM}" "${DEPLOYMENT_PROFILE}" | tee 2>&1 ./test/scripts/openshift-ci/setup-e2e-tests-"${MARKERS// /_}".log + ./test/scripts/openshift-ci/setup-e2e-tests.sh "${MARKERS}" "${DEPLOYMENT_PROFILE}" | tee 2>&1 ./test/scripts/openshift-ci/setup-e2e-tests-"${MARKERS// /_}".log popd fi @@ -61,7 +61,7 @@ fi export REQUESTS_CA_BUNDLE="/tmp/ca.crt" echo "REQUESTS_CA_BUNDLE=$(cat ${REQUESTS_CA_BUNDLE})" -echo "Run E2E tests: ${MARKERS}" +echo "⏳ Running E2E tests: ${MARKERS}" pushd $PROJECT_ROOT >/dev/null ./test/scripts/gh-actions/run-e2e-tests.sh "${MARKERS}" "${PARALLELISM}" "${DEPLOYMENT_PROFILE}" | tee 2>&1 ./test/scripts/openshift-ci/run-e2e-tests-"${MARKERS// /_}".log popd diff --git a/test/scripts/openshift-ci/setup-e2e-tests.sh b/test/scripts/openshift-ci/setup-e2e-tests.sh index 12fb9d003e7..c94507b9690 100755 --- a/test/scripts/openshift-ci/setup-e2e-tests.sh +++ b/test/scripts/openshift-ci/setup-e2e-tests.sh @@ -27,9 +27,7 @@ source "$SCRIPT_DIR/common.sh" PROJECT_ROOT="$(find_project_root "$SCRIPT_DIR")" readonly MARKERS="${1:-raw}" -readonly PARALLELISM="${2:-1}" - -readonly DEPLOYMENT_PROFILE="${3:-serverless}" +readonly DEPLOYMENT_PROFILE="${2:-serverless}" validate_deployment_profile "${DEPLOYMENT_PROFILE}" : "${NS:=opendatahub}" @@ -90,7 +88,7 @@ fi if [[ "${DEPLOYMENT_PROFILE}" == "llm-d" ]]; then echo "⏳ Installing llm-d prerequisites" - $SCRIPT_DIR/setup-llm.sh --skip-kserve + $SCRIPT_DIR/setup-llm-d.sh --with-kserve=false fi echo "⏳ Waiting for KServe CRDs" diff --git a/test/scripts/openshift-ci/setup-llm-d.sh b/test/scripts/openshift-ci/setup-llm-d.sh new file mode 100755 index 00000000000..4732fb10477 --- /dev/null +++ b/test/scripts/openshift-ci/setup-llm-d.sh @@ -0,0 +1,91 @@ +#!/usr/bin/env bash +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +source "$SCRIPT_DIR/common.sh" +source "$SCRIPT_DIR/version.sh" +PROJECT_ROOT="$(find_project_root "$SCRIPT_DIR")" + +WITH_KSERVE="true" +WITH_KUADRANT="false" + +show_usage() { + cat <&2; exit 1 ;; + esac +} + +for arg in "$@"; do + case "$arg" in + --with-kserve) WITH_KSERVE=true ;; + --with-kserve=*) WITH_KSERVE="$(parse_bool "${arg#*=}")" ;; + --with-kuadrant) WITH_KUADRANT=true ;; + --with-kuadrant=*) WITH_KUADRANT="$(parse_bool "${arg#*=}")" ;; + -h|--help) show_usage; exit 0 ;; + *) echo "Error: Unknown option '$arg'"; show_usage; exit 1 ;; + esac +done + +echo "🔧 Configuration:" +echo " KServe deployment: $([ "$WITH_KSERVE" == "true" ] && echo "✅ enabled" || echo "❌ disabled")" +echo " Kuadrant deployment: $([ "$WITH_KUADRANT" == "true" ] && echo "✅ enabled" || echo "❌ disabled")" +echo "" + +server_version=$(get_openshift_server_version) +min_version="4.19.9" +if is_version_newer "${server_version}" "${min_version}"; then + echo "✅ OpenShift version (${server_version}) is newer than ${min_version} - installing components..." +else + echo "❌ OpenShift version (${server_version}) older than ${min_version}. This is not supported environment." + exit 1 +fi + +"$SCRIPT_DIR/infra/deploy.cert-manager.sh" +"$SCRIPT_DIR/infra/deploy.lws.sh" + +if [ "${WITH_KSERVE}" == "true" ]; then + kubectl create ns opendatahub || true + kubectl kustomize "$PROJECT_ROOT/config/crd/" | kubectl apply --server-side=true -f - + wait_for_crd llminferenceserviceconfigs.serving.kserve.io 90s + + kustomize build "$PROJECT_ROOT/config/overlays/odh" | kubectl apply --server-side=true --force-conflicts -f - + wait_for_pod_ready "opendatahub" "control-plane=kserve-controller-manager" 300s +fi + +"$SCRIPT_DIR/infra/deploy.gateway.ingress.sh" + +if [ "${WITH_KUADRANT}" == "true" ]; then + "$SCRIPT_DIR/infra/deploy.kuadrant.sh" +fi diff --git a/test/scripts/openshift-ci/setup-llm.sh b/test/scripts/openshift-ci/setup-llm.sh deleted file mode 100755 index db9d00ef087..00000000000 --- a/test/scripts/openshift-ci/setup-llm.sh +++ /dev/null @@ -1,99 +0,0 @@ -#!/usr/bin/env bash -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -euo pipefail - -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -source "$SCRIPT_DIR/common.sh" -source "$SCRIPT_DIR/version.sh" -PROJECT_ROOT="$(find_project_root "$SCRIPT_DIR")" - -KSERVE_DEPLOY="true" -RHCL_DEPLOY="false" - -show_usage() { - echo "Usage: $0 [OPTIONS]" - echo "Setup LLM environment on OpenShift" - echo "" - echo "Default behavior:" - echo " • KServe deployment: enabled" - echo " • Kuadrant deployment: disabled" - echo "" - echo "Options:" - echo " --skip-kserve Skip KServe deployment" - echo " --deploy-kuadrant Deploy Kuadrant" - echo " -h, --help Show this help message" - echo "" - echo "Examples:" - echo " $0 # Deploy KServe only (default)" - echo " $0 --skip-kserve # Deploy neither" - echo " $0 --deploy-kuadrant # Deploy both KServe and Kuadrant" - echo " $0 --skip-kserve --deploy-kuadrant # Deploy Kuadrant only" -} - -while [[ $# -gt 0 ]]; do - case $1 in - --skip-kserve) - KSERVE_DEPLOY="false" - shift - ;; - --deploy-kuadrant) - RHCL_DEPLOY="true" - shift - ;; - -h|--help) - show_usage - exit 0 - ;; - *) - echo "Error: Unknown option '$1'" >&2 - show_usage >&2 - exit 1 - ;; - esac -done - -echo "🔧 Configuration:" -echo " KServe deployment: $([ "$KSERVE_DEPLOY" == "true" ] && echo "✅ enabled" || echo "❌ disabled")" -echo " Kuadrant deployment: $([ "$RHCL_DEPLOY" == "true" ] && echo "✅ enabled" || echo "❌ disabled")" -echo "" - -server_version=$(get_openshift_server_version) -echo "Checking OpenShift server version...($server_version)" - -if version_compare "$server_version" "4.19.9"; then - echo "🎯 Server version ($server_version) is 4.19.9 or higher - continue with the script" -else - echo "🎯 Server version ($server_version) is not supported so stop the script" - exit 1 -fi - -$SCRIPT_DIR/infra/deploy.cert-manager.sh -$SCRIPT_DIR/infra/deploy.lws.sh - -if [ "${KSERVE_DEPLOY}" == "true" ]; then - kubectl create ns opendatahub || true - - kubectl kustomize config/crd/ | kubectl apply --server-side=true -f - - wait_for_crd llminferenceserviceconfigs.serving.kserve.io 90s - - kustomize build config/overlays/odh | kubectl apply --server-side=true --force-conflicts -f - - wait_for_pod_ready "opendatahub" "control-plane=kserve-controller-manager" 300s -fi - -$SCRIPT_DIR/infra/deploy.gateway.ingress.sh - -if [ "${RHCL_DEPLOY}" == "true" ]; then - $SCRIPT_DIR/infra/deploy.kuadrant.sh -fi diff --git a/test/scripts/openshift-ci/teardown-e2e-setup.sh b/test/scripts/openshift-ci/teardown-e2e-setup.sh old mode 100644 new mode 100755 diff --git a/test/scripts/openshift-ci/version.sh b/test/scripts/openshift-ci/version.sh old mode 100644 new mode 100755 index cffa7574205..cfdc9004566 --- a/test/scripts/openshift-ci/version.sh +++ b/test/scripts/openshift-ci/version.sh @@ -39,10 +39,10 @@ get_openshift_server_version() { return 1 } -# version_compare +# is_version_newer # Compares two version strings in semantic version format (e.g., "4.19.9") # Returns 0 if version1 >= version2, 1 otherwise -version_compare() { +is_version_newer() { local version1="$1" local version2="$2"