Skip to content

Commit 788bfca

Browse files
authored
[RHOAIENG-31086] - IG test for raw deployment (#973)
chore: Update the e2e tests to not deploy Serverless when running graph tests. Signed-off-by: Spolti <[email protected]>
1 parent 0922550 commit 788bfca

File tree

3 files changed

+46
-23
lines changed

3 files changed

+46
-23
lines changed

test/scripts/openshift-ci/deploy.ossm.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ EOF
3636

3737
wait_for_pod_ready "openshift-operators" "name=istio-operator"
3838

39-
# Create new namespace
40-
oc new-project istio-system
39+
# Create istio-system namespace if it doesn't exist
40+
oc new-project istio-system || true
4141
# Install OSSM
4242
cat <<EOF | oc apply -f -
4343
apiVersion: maistra.io/v2

test/scripts/openshift-ci/deploy.serverless.sh

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,14 @@ set -eu
1717
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
1818
source "${SCRIPT_DIR}/common.sh"
1919

20-
# Create namespaces(openshift-serverless)
21-
oc create ns openshift-serverless
20+
# Set default value for RUNNING_LOCAL if not set
21+
: "${RUNNING_LOCAL:=false}"
2222

23-
# Create operatorGroup
24-
cat <<EOF | oc create -f -
23+
# Create openshift-serverless namespace if it doesn't exist
24+
oc create ns openshift-serverless || true
25+
26+
# Create operatorGroup if it doesn't exist
27+
cat <<EOF | oc apply -f -
2528
apiVersion: operators.coreos.com/v1
2629
kind: OperatorGroup
2730
metadata:
@@ -33,8 +36,8 @@ spec:
3336
upgradeStrategy: Default
3437
EOF
3538

36-
# Install Serverless operator
37-
cat <<EOF | oc create -f -
39+
# Install Serverless operator if it doesn't exist
40+
cat <<EOF | oc apply -f -
3841
apiVersion: operators.coreos.com/v1alpha1
3942
kind: Subscription
4043
metadata:
@@ -185,10 +188,11 @@ if [ -f "$CA_CERT_PATH" ]; then
185188
export REQUESTS_CA_BUNDLE=$CA_CERT_PATH
186189
fi
187190
export tls_key=$(oc get secret $secret_name -n openshift-ingress -o=jsonpath='{.data.tls\.key}')
191+
# Create TLS secret for knative-serving if it doesn't exist
188192
oc create secret tls knative-serving-cert \
189193
--cert=<(echo $tls_cert | base64 -d) \
190194
--key=<(echo $tls_key | base64 -d) \
191-
-n istio-system
195+
-n istio-system || true
192196
export domain=$(oc get ingresses.config/cluster -o=jsonpath='{ .spec.domain}')
193197

194198

test/scripts/openshift-ci/setup-e2e-tests.sh

Lines changed: 33 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,29 @@ popd
7272

7373
$MY_PATH/deploy.cma.sh
7474

75-
# Install KServe stack
76-
if [ "$1" != "raw" ]; then
75+
# Add CA certificate extraction for raw deployments
76+
if [[ "$1" =~ raw ]]; then
77+
echo "⏳ Extracting OpenShift CA certificates for raw deployment"
78+
# Get comprehensive CA bundle including both cluster and service CAs
79+
{
80+
# Cluster root CA bundle
81+
oc get configmap kube-root-ca.crt -o jsonpath='{.data.ca\.crt}' 2>/dev/null && echo ""
82+
83+
# OpenShift service CA
84+
oc get configmap openshift-service-ca.crt -n openshift-config-managed -o jsonpath='{.data.service-ca\.crt}' 2>/dev/null || \
85+
oc get secret service-ca -n openshift-service-ca -o jsonpath='{.data.service-ca\.crt}' 2>/dev/null | base64 -d || true
86+
} > /tmp/ca.crt
87+
88+
# Verify we got a valid CA bundle
89+
if [ -s "/tmp/ca.crt" ] && grep -q "BEGIN CERTIFICATE" "/tmp/ca.crt"; then
90+
echo "✅ CA certificate bundle extracted ($(grep -c "BEGIN CERTIFICATE" /tmp/ca.crt) certificates)"
91+
else
92+
echo "❌ Failed to extract CA certificates"
93+
fi
94+
fi
95+
96+
# Install KServe stack - skip serverless for raw and graph deployments
97+
if [[ ! "$1" =~ raw && ! "$1" =~ graph ]]; then
7798
echo "Installing OSSM"
7899
$MY_PATH/deploy.ossm.sh
79100
echo "Installing Serverless"
@@ -94,32 +115,30 @@ kustomize build $PROJECT_ROOT/config/overlays/test |
94115
oc apply --server-side=true -f -
95116

96117
# Install DSC/DSCI for test. (sometimes there is timing issue when it is under the same kustomization so it is separated)
97-
oc create -f config/overlays/test/dsci.yaml
98-
oc create -f config/overlays/test/dsc.yaml
118+
oc apply -f config/overlays/test/dsci.yaml
119+
oc apply -f config/overlays/test/dsc.yaml
99120

100121
# Patch the inferenceservice-config ConfigMap, when running RawDeployment tests
101-
if [ "$1" == "raw" ]; then
122+
if [[ "$1" =~ raw || "$1" =~ graph ]]; then
123+
echo "Patching RAW/Graph deployment, markers: $1"
102124
export OPENSHIFT_INGRESS_DOMAIN=$(oc get ingresses.config cluster -o jsonpath='{.spec.domain}')
103125
oc patch configmap inferenceservice-config -n kserve --patch-file <(cat config/overlays/test/configmap/inferenceservice-openshift-ci-raw.yaml | envsubst)
104126
oc delete pod -n kserve -l control-plane=kserve-controller-manager
105127

106128
oc patch DataScienceCluster test-dsc --type='json' -p='[{"op": "replace", "path": "/spec/components/kserve/defaultDeploymentMode", "value": "RawDeployment"}]'
107129
else
108130
export OPENSHIFT_INGRESS_DOMAIN=$(oc get ingresses.config cluster -o jsonpath='{.spec.domain}')
109-
if [ "$1" == "graph" ]; then
110-
oc patch configmap inferenceservice-config -n kserve --patch-file <(cat config/overlays/test/configmap/inferenceservice-openshift-ci-serverless.yaml | envsubst)
111-
else
112-
oc patch configmap inferenceservice-config -n kserve --patch-file <(cat config/overlays/test/configmap/inferenceservice-openshift-ci-serverless-predictor.yaml | envsubst)
113-
fi
131+
oc patch configmap inferenceservice-config -n kserve --patch-file <(cat config/overlays/test/configmap/inferenceservice-openshift-ci-serverless-predictor.yaml | envsubst)
114132
fi
115133

116134
# Wait until KServe starts
135+
echo "waiting kserve-controller get ready..."
117136
oc wait --for=condition=ready pod -l control-plane=kserve-controller-manager -n kserve --timeout=300s
118137

119-
if [ "$1" != "raw" ]; then
138+
if [[ ! "$1" =~ raw && ! "$1" =~ graph ]]; then
120139
echo "Installing authorino and kserve gateways"
121140
# authorino
122-
curl -sL https://raw.githubusercontent.com/Kuadrant/authorino-operator/main/utils/install.sh | sed "s|kubectl|oc|" |
141+
curl -sL https://raw.githubusercontent.com/Kuadrant/authorino-operator/main/utils/install.sh | sed "s|kubectl|oc|" |
123142
bash -s -- -v 0.16.0
124143

125144
fi
@@ -190,7 +209,7 @@ metadata:
190209
name: kserve-ci-e2e-test
191210
EOF
192211

193-
if [ "$1" != "raw" ]; then
212+
if [[ ! "$1" =~ raw && ! "$1" =~ graph ]]; then
194213
cat <<EOF | oc apply -f -
195214
apiVersion: maistra.io/v1
196215
kind: ServiceMeshMember
@@ -214,7 +233,7 @@ kustomize build $PROJECT_ROOT/config/overlays/test/clusterresources |
214233

215234
# Add the enablePassthrough annotation to the ServingRuntimes, to let Knative to
216235
# generate passthrough routes.
217-
if [ "$1" != "raw" ]; then
236+
if [[ ! "$1" =~ raw && ! "$1" =~ graph ]]; then
218237
oc annotate servingruntimes -n kserve-ci-e2e-test --all serving.knative.openshift.io/enablePassthrough=true
219238
fi
220239

0 commit comments

Comments
 (0)