Skip to content

Commit bf30c78

Browse files
authored
Merge pull request #42 from cloudera/feature/add_prechecks
Feature/add prechecks
2 parents 4638d0d + b4ae925 commit bf30c78

File tree

3 files changed

+34
-3
lines changed

3 files changed

+34
-3
lines changed

ClouderaSetup/OnCloud/AWS/build/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ 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+
## [2.3.0] - 2024-12-30
9+
10+
### Added
11+
- Added a new parameter of datalake_version
12+
- Added a precheck for workshop name length
13+
14+
### Fixed
15+
- Updated the enable_gpu parameter to accept only boolean values
16+
17+
818
## [2.2.0] - 2024-12-02
919

1020
### Changed

ClouderaSetup/OnCloud/AWS/build/cdp-wrkshps-quickstarts/cdp-data-services/enable-cml.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
"enabled": true
7070
}
7171
}
72-
{% if enable_gpu %}
72+
{% if enable_gpu | bool %}
7373
, {
7474
"name": "gpu_settings",
7575
"instanceType": "{{ gpu_instance_type }}",

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

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,24 @@ validating_variables() {
120120
echo "========================================================================================="
121121
exit 1
122122
fi
123+
124+
#workshop_name variable to validate
125+
validate_workshop_name() {
126+
if [[ ! "$workshop_name" =~ ^[a-z0-9-]+$ || ${#workshop_name} -gt 12 ]]; then
127+
echo "Error: workshop_name must be 12 characters or less and consist only of lowercase letters, numbers, and hyphens (-)."
128+
exit 1
129+
fi
130+
}
131+
validate_datalake_version() {
132+
if [[ -z "$datalake_version" || "$datalake_version" == "latest" || "$datalake_version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
133+
return 0 # Valid value
134+
else
135+
echo "Error: Valid values for datalake_version are 'latest' or a semantic version (e.g., 7.2.17)."
136+
return 1 # Invalid value
137+
fi
138+
}
139+
validate_workshop_name
140+
validate_datalake_version
123141
}
124142

125143
#--------------------------------------------------------------------------------------------------#
@@ -257,14 +275,16 @@ validating_variables() {
257275
CDP_GROUP_LIMIT)
258276
cdp_group_limit=$value
259277
;;
278+
DATALAKE_VERSION)
279+
datalake_version=$value
280+
;;
260281
# Can Add more cases if required.
261282
esac
262283
fi
263284
done <"$USER_CONFIG_FILE"
264285

265286
# Call the function with the user-provided config file as an argument
266287
check_config "$USER_CONFIG_FILE"
267-
268288
echo
269289
echo " ------------------------------------------------------------------- "
270290
echo " Validated the Configfile and Verified the Provided Input Parameters "
@@ -654,7 +674,8 @@ EOF
654674
-var "aws_region=${aws_region}" \
655675
-var "aws_key_pair=${aws_key_pair}" \
656676
-var "deployment_template=${deployment_template}" \
657-
-var "ingress_extra_cidrs_and_ports={cidrs = ["${cdp_cidr}"],ports = [443, 22]}"
677+
-var "ingress_extra_cidrs_and_ports={cidrs = ["${cdp_cidr}"],ports = [443, 22]}" \
678+
-var "datalake_version=${datalake_version}"
658679
cdp_provision_status=$?
659680
if [ $cdp_provision_status -eq 0 ]; then
660681
export ENV_PUBLIC_SUBNETS=$(terraform output -json aws_public_subnet_ids)

0 commit comments

Comments
 (0)