Skip to content

Commit 7b7d120

Browse files
author
Avanish Tiwari
committed
updated timeout and check condition for CAII
1 parent 2138a40 commit 7b7d120

File tree

4 files changed

+89
-28
lines changed

4 files changed

+89
-28
lines changed

ClouderaSetup/OnCloud/AWS/build/CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,24 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [3.2.2] - 2025-08-13
9+
10+
### Fixed
11+
- Increased the timeout and added a check for AI regsitry.
12+
13+
## [3.2.1] - 2025-07-16
14+
15+
### Added
16+
- Added new AWS region support for Keycloak server deployment.
17+
18+
### Fixed
19+
- Logging enhancements and error handling for keycloak deployment.
20+
21+
## [3.2.0]
22+
23+
### Added
24+
- Added a new feature to provision and destroy CAII service
25+
826
## [3.1.2] - 2025-04-16
927

1028
### Fixed

ClouderaSetup/OnCloud/AWS/build/cdp-wrkshps-quickstarts/CAII/compute_cluster_deploy.sh

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,13 @@ existing_cluster_status=$(cdp compute list-clusters | jq -r --arg name "$cluster
1414
| .status
1515
')
1616

17-
if [[ "$existing_cluster_status" == "RUNNING" ]]; then
17+
# Normalize status to lowercase for case-insensitive matching
18+
existing_status_lower=$(echo "$existing_cluster_status" | tr '[:upper:]' '[:lower:]')
19+
20+
if [[ "$existing_status_lower" == "running" ]]; then
1821
echo "✅ Compute cluster '$cluster_name' is already RUNNING. Skipping creation."
1922

20-
elif [[ "$existing_cluster_status" == "CREATING" ]]; then
23+
elif [[ "$existing_status_lower" == "creating" ]]; then
2124
echo "ℹ️ Compute cluster '$cluster_name' is already being created. Skipping creation."
2225

2326
else
@@ -34,18 +37,23 @@ else
3437

3538
echo " ➤ Attempt $i: Status = $current_status"
3639

37-
if [[ "$current_status" == "RUNNING" ]]; then
40+
# Convert to lowercase for comparison
41+
current_status_lower=$(echo "$current_status" | tr '[:upper:]' '[:lower:]')
42+
43+
if [[ "$current_status_lower" == "running" ]]; then
3844
echo "✅ Compute cluster '$cluster_name' is now RUNNING."
3945
break
40-
elif [[ "$current_status" == "FAILED" ]]; then
41-
echo "❌ Compute cluster creation FAILED."
46+
elif [[ "$current_status_lower" == *"failed"* ]]; then
47+
echo "❌ Compute cluster creation FAILED with status: $current_status"
4248
exit 1
4349
fi
50+
4451
sleep 30
4552
done
4653

47-
if [[ "$current_status" != "RUNNING" ]]; then
54+
if [[ "$current_status_lower" != "running" ]]; then
4855
echo "❌ Timeout Error: Compute cluster did not reach RUNNING state."
4956
exit 1
5057
fi
5158
fi
59+

ClouderaSetup/OnCloud/AWS/build/cdp-wrkshps-quickstarts/CAII/initialize_default_cluster.sh

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,20 @@ for i in {1..60}; do
2929

3030
echo " ➤ Attempt $i: Status = $default_cluster_status"
3131

32-
if [[ "$default_cluster_status" == "RUNNING" ]]; then
32+
# Convert to lowercase for case-insensitive matching
33+
status_lower=$(echo "$default_cluster_status" | tr '[:upper:]' '[:lower:]')
34+
35+
if [[ "$status_lower" == "running" ]]; then
3336
echo "✅ Default compute cluster is now RUNNING."
3437
break
35-
elif [[ "$default_cluster_status" == "FAILED" ]]; then
36-
echo "❌ Default compute cluster initialization FAILED."
38+
elif [[ "$status_lower" == *"failed"* ]]; then
39+
echo "❌ Default compute cluster initialization FAILED with status: $default_cluster_status."
3740
exit 1
3841
fi
39-
sleep 30
42+
sleep 60
4043
done
4144

42-
if [[ "$default_cluster_status" != "RUNNING" ]]; then
43-
echo "❌ Timeout Error: Default cluster did not reach RUNNING state after 30 minutes."
45+
if [[ "$status_lower" != "running" ]]; then
46+
echo "❌ Timeout Error: Default cluster did not reach RUNNING state after 60 minutes."
4447
exit 1
4548
fi

ClouderaSetup/OnCloud/AWS/build/entrypoint/hol-functions.sh

Lines changed: 48 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -914,24 +914,56 @@ echo -e "\n ==============================Provisioning Compute Clu
914914
}
915915

916916
enable_model_registry() {
917-
echo -e "\n =============================Deploying Model Registry ========================================="
918-
USER_NAMESPACE=$workshop_name
919-
cd /userconfig/.$USER_NAMESPACE/CAII
920-
environment_crn=$(cdp environments describe-environment --environment-name ${workshop_name}-cdp-env | jq -r .environment.crn)
921-
# Check if ML Model Registry exists and is already installed
922-
registry_status=$(cdp ml list-model-registries | jq -r --arg env_name "${workshop_name}-cdp-env" '
923-
.modelRegistries[]
924-
| select(.environmentName == $env_name)
925-
| .status
926-
')
917+
echo -e "\n =============================Deploying Model Registry ========================================="
918+
USER_NAMESPACE=$workshop_name
919+
cd /userconfig/.$USER_NAMESPACE/CAII
920+
921+
environment_crn=$(cdp environments describe-environment --environment-name ${workshop_name}-cdp-env | jq -r .environment.crn)
922+
923+
# Check if ML Model Registry exists and is already installed
924+
registry_status=$(cdp ml list-model-registries | jq -r --arg env_name "${workshop_name}-cdp-env" '
925+
.modelRegistries[]
926+
| select(.environmentName == $env_name)
927+
| .status
928+
')
929+
930+
if [[ "$registry_status" == "installation:finished" ]]; then
931+
echo "✅ ML Model Registry for environment '${workshop_name}-cdp-env' is already installed. Skipping creation."
932+
return
933+
else
934+
echo "🚀 Proceeding with model registry deployment"
935+
cdp ml create-model-registry \
936+
--environment-crn "$environment_crn" \
937+
--environment-name "${workshop_name}-cdp-env" \
938+
--use-public-load-balancer
939+
fi
927940

928-
if [[ "$registry_status" == "installation:finished" ]]; then
929-
echo "✅ ML Model Registry for environment '${workshop_name}-cdp-env' is already installed. Skipping creation."
930-
else
931-
echo "🚀 Proceeding with model registry deployment"
932-
cdp ml create-model-registry --environment-crn $environment_crn --environment-name $workshop_name-cdp-env --use-public-load-balancer
933-
fi
941+
echo "⏳ Waiting for ML Model Registry installation to finish..."
942+
for i in {1..75}; do
943+
registry_status=$(cdp ml list-model-registries | jq -r --arg env_name "${workshop_name}-cdp-env" '
944+
.modelRegistries[]
945+
| select(.environmentName == $env_name)
946+
| .status
947+
')
948+
949+
echo " ➤ Attempt $i: Status = $registry_status"
950+
951+
# Normalize to lowercase for matching
952+
status_lower=$(echo "$registry_status" | tr '[:upper:]' '[:lower:]')
953+
954+
if [[ "$status_lower" == "installation:finished" ]]; then
955+
echo "✅ ML Model Registry installation finished successfully."
956+
return
957+
elif [[ "$status_lower" == *"failed"* ]]; then
958+
echo "❌ ML Model Registry installation FAILED with status: $registry_status"
959+
exit 1
960+
fi
961+
962+
sleep 60
963+
done
934964

965+
echo "❌ Timeout Error: ML Model Registry did not reach 'installation:finished' state."
966+
exit 1
935967
}
936968

937969
provision_caii_service_app() {

0 commit comments

Comments
 (0)