Skip to content

Commit

Permalink
This commit will remove the source script for coloured text (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyxrmdavidson authored May 3, 2024
1 parent d645fea commit dc8f145
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 deletions.
14 changes: 7 additions & 7 deletions test/scripts/populateDatabase.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ make_post_extract_id() {
-d "$data" | jq -r '.id')

if [ -z "$id" ]; then
echo -e "${RED}Error:${NC} Error: Failed to extract ID from response"
echo -e "Error: Failed to extract ID from response"
exit 1
else
echo "$id"
Expand All @@ -36,10 +36,10 @@ post_model_registry_data() {
}')

if [ $? -ne 0 ]; then
echo -e "${RED}Error:${NC} Registered Model ID not returned"
echo -e "Error: Registered Model ID not returned"
exit 1
else
echo -e "${GREEN}Success:${NC} Registered Model ID: $rm_id"
echo -e "Success: Registered Model ID: $rm_id"
fi

mv_id=$(make_post_extract_id "$MR_HOSTNAME/api/model_registry/v1alpha3/model_versions" '{
Expand All @@ -50,10 +50,10 @@ post_model_registry_data() {
}')

if [ $? -ne 0 ]; then
echo -e "${RED}Error:${NC} Model Version ID not returned"
echo -e "Error: Model Version ID not returned"
exit 1
else
echo -e "${GREEN}Success:${NC} Model Version ID: $mv_id"
echo -e "Success: Model Version ID: $mv_id"
fi

RAW_ML_MODEL_URI='https://huggingface.co/tarilabs/mnist/resolve/v1.nb20231206162408/mnist.onnx'
Expand All @@ -69,10 +69,10 @@ post_model_registry_data() {
}')

if [ $? -ne 0 ]; then
echo -e "${RED}Error:${NC} Model Artifact ID not returned"
echo -e "Error: Model Artifact ID not returned"
exit 1
else
echo -e "${GREEN}Success:${NC} Model Artifact ID: $ma_id"
echo -e "Success: Model Artifact ID: $ma_id"
fi
}

Expand Down
19 changes: 9 additions & 10 deletions test/scripts/rest.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/bash
FLAG_WITH_NAMESPACE=$1
MR_HOSTNAME="http://$(oc get route modelregistry-sample-http $FLAG_WITH_NAMESPACE --template='{{.spec.host}}')"
source "openshift-ci/scripts/colour_text_variables.sh"

# Function to send data and extract ID from response
make_post_extract_id() {
Expand All @@ -13,7 +12,7 @@ make_post_extract_id() {
-d "$data" | jq -r '.id')

if [ -z "$id" ]; then
echo -e "${RED}Error:${NC} Error: Failed to extract ID from response"
echo -e "Error: Failed to extract ID from response"
exit 1
else
echo "$id"
Expand All @@ -31,10 +30,10 @@ post_model_registry_data() {
}')

if [ $? -ne 0 ]; then
echo -e "${RED}Error:${NC} Registered Model ID not returned"
echo -e "Error: Registered Model ID not returned"
exit 1
else
echo -e "${GREEN}Success:${NC} Registered Model ID: $rm_id"
echo -e "Success: Registered Model ID: $rm_id"
fi

mv_id=$(make_post_extract_id "$MR_HOSTNAME/api/model_registry/v1alpha3/model_versions" '{
Expand All @@ -45,10 +44,10 @@ post_model_registry_data() {
}')

if [ $? -ne 0 ]; then
echo -e "${RED}Error:${NC} Model Version ID not returned"
echo -e "Error: Model Version ID not returned"
exit 1
else
echo -e "${GREEN}Success:${NC} Model Version ID: $mv_id"
echo -e "Success: Model Version ID: $mv_id"
fi

RAW_ML_MODEL_URI='https://huggingface.co/tarilabs/mnist/resolve/v1.nb20231206162408/mnist.onnx'
Expand All @@ -64,10 +63,10 @@ post_model_registry_data() {
}')

if [ $? -ne 0 ]; then
echo -e "${RED}Error:${NC} Model Artifact ID not returned"
echo -e "Error: Model Artifact ID not returned"
exit 1
else
echo -e "${GREEN}Success:${NC} Model Artifact ID: $ma_id"
echo -e "Success: Model Artifact ID: $ma_id"
fi
}

Expand Down Expand Up @@ -107,10 +106,10 @@ inference_service() {
-H 'accept: application/json')

if [ $? -ne 0 ]; then
echo -e "${RED}Error:${NC} InferenceService entities on MR not returned"
echo -e "Error: InferenceService entities on MR not returned"
exit 1
else
echo -e "${GREEN}Success:${NC} InferenceService entities on MR: $iss_mr"
echo -e "Success: InferenceService entities on MR: $iss_mr"
fi
}

Expand Down

0 comments on commit dc8f145

Please sign in to comment.