Skip to content

Commit

Permalink
This commit will update the iib for odh-nightly build (#29)
Browse files Browse the repository at this point in the history
* This commit will update the iib for odh-nightly build
and fix the paths as the script will be run from the root of the repo instead of directly from the host directory

* This commit removes color text from echo statements
  • Loading branch information
tonyxrmdavidson committed Mar 20, 2024
1 parent ffa5c3f commit 18d77fa
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion openshift-ci/resources/opendatahub-catalogue-source.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ metadata:
namespace: openshift-marketplace
spec:
displayName: ''
image: 'registry-proxy.engineering.redhat.com/rh-osbs/iib:688477'
image: 'registry-proxy.engineering.redhat.com/rh-osbs/iib:692156'
publisher: ''
sourceType: grpc
28 changes: 14 additions & 14 deletions openshift-ci/scripts/oci-model-registry-deploy.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/bash

# Define variables for ODH nightly deployment
OPENDATAHUB_CATALOGUE_SOURCE_CREATE="../resources/opendatahub-catalogue-source.yaml"
OPENDATAHUB_DEPLOY_MANIFEST="../resources/opendatahub-operator-deploy.yaml"
DATA_SCIENCE_CLUSTER_MANIFEST="../resources/opendatahub-data-science-cluster.yaml"
OPENDATAHUB_CATALOGUE_SOURCE_CREATE="openshift-ci/resources/opendatahub-catalogue-source.yaml"
OPENDATAHUB_DEPLOY_MANIFEST="openshift-ci/resources/opendatahub-operator-deploy.yaml"
DATA_SCIENCE_CLUSTER_MANIFEST="openshift-ci/resources/opendatahub-data-science-cluster.yaml"
MODEL_REGISTRY_OPERATOR_GIT_URL="https://github.com/opendatahub-io/model-registry-operator.git"
source colour_text_variables.sh
source

# Function to deploy and wait for deployment
deploy_and_wait() {
Expand Down Expand Up @@ -62,14 +62,14 @@ check_deployment_availability() {

# Check if the deployment is available
if [[ $deployment_status != "" ]]; then
echo -e "${GREEN}✔ Success:${NC} Deployment $deployment is available"
echo "✔ Success: Deployment $deployment is available"
return 0 # Success
fi

sleep 5 # Wait for 5 seconds before checking again
done

echo -e "${RED}X Fail:${NC} Timeout reached. Deployment $deployment did not become available within $timeout seconds"
echo "X Fail: Timeout reached. Deployment $deployment did not become available within $timeout seconds"
return 1 # Failure
}

Expand Down Expand Up @@ -98,10 +98,10 @@ check_pod_status() {

# Check if the pod is Running and all containers are ready
if [[ $pod_status == "Running" ]] && [[ $ready_containers -eq $expected_ready_containers ]]; then
echo -e "${GREEN}✔ Success:${NC} Pod $pod_name is running and $ready_containers out of $expected_ready_containers containers are ready"
echo "✔ Success: Pod $pod_name is running and $ready_containers out of $expected_ready_containers containers are ready"
return 0 # Success
else
echo -e "${YELLOW}! Info:${NC} Pod $pod_name is not running or does not have $expected_ready_containers containers ready"
echo "! Info: Pod $pod_name is not running or does not have $expected_ready_containers containers ready"
fi
done <<< "$pod_list"

Expand All @@ -126,30 +126,30 @@ check_route_status() {
local route_url="http://$route"

if [[ -z "$route_url" ]]; then
echo -e "${RED}X Fail:${NC} Route '$route_name' does not exist in namespace '$namespace'"
echo "X Fail: Route '$route_name' does not exist in namespace '$namespace'"
return 1
else
echo -e "${GREEN}✔ Success:${NC} Route '$route_name' exists in namespace '$namespace'"
echo "✔ Success: Route '$route_name' exists in namespace '$namespace'"
fi

# Test if the route is live
local response=$(curl -s -o /dev/null -w "%{http_code}" "$route_url/api/model_registry/v1alpha2/registered_models")

# Check if the response status code is 200 OK or 404 Not Found
if [[ "$response" == "200" ]]; then
echo -e "${GREEN}✔ Success:${NC} Route server is reachable. Status code: 200 OK"
echo "✔ Success: Route server is reachable. Status code: 200 OK"
return 0
elif [[ "$response" == "404" ]]; then
echo -e "${GREEN}✔ Success:${NC} Route server is reachable. Status code: 404 Not Found"
echo "✔ Success: Route server is reachable. Status code: 404 Not Found"
return 0
else
echo -e "${RED}X Fail:${NC} Route server is unreachable. Status code: $response"
echo "X Fail: Route server is unreachable. Status code: $response"
fi

sleep "$interval"
done

echo -e "${RED}X Fail:${NC} Timeout reached. Route '$route_name' did not become live within $timeout seconds."
echo "X Fail: Timeout reached. Route '$route_name' did not become live within $timeout seconds."
return 1
}

Expand Down

0 comments on commit 18d77fa

Please sign in to comment.