From 43c3ad5e4aea6824d31484fa1f887b775422b9ed Mon Sep 17 00:00:00 2001 From: Avanish Tiwari Date: Tue, 24 Dec 2024 13:55:38 +0530 Subject: [PATCH 1/3] updated datalake_version and workshop_name prechecks --- .../AWS/build/entrypoint/hol-functions.sh | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/ClouderaSetup/OnCloud/AWS/build/entrypoint/hol-functions.sh b/ClouderaSetup/OnCloud/AWS/build/entrypoint/hol-functions.sh index fd92870..13fd787 100644 --- a/ClouderaSetup/OnCloud/AWS/build/entrypoint/hol-functions.sh +++ b/ClouderaSetup/OnCloud/AWS/build/entrypoint/hol-functions.sh @@ -120,6 +120,24 @@ validating_variables() { echo "=========================================================================================" exit 1 fi + + #workshop_name variable to validate + validate_workshop_name() { + if [[ ! "$workshop_name" =~ ^[a-z0-9-]+$ || ${#workshop_name} -gt 12 ]]; then + echo "Error: workshop_name must be 12 characters or less and consist only of lowercase letters, numbers, and hyphens (-)." + exit 1 + fi + } + validate_datalake_version() { + if [[ -z "$datalake_version" || "$datalake_version" == "latest" || "$datalake_version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + return 0 # Valid value + else + echo "Error: Valid values for datalake_version are 'latest' or a semantic version (e.g., 7.2.17)." + return 1 # Invalid value + fi + } + validate_workshop_name + validate_datalake_version } #--------------------------------------------------------------------------------------------------# @@ -257,6 +275,9 @@ validating_variables() { CDP_GROUP_LIMIT) cdp_group_limit=$value ;; + DATALAKE_VERSION) + datalake_version=$value + ;; # Can Add more cases if required. esac fi @@ -264,7 +285,6 @@ validating_variables() { # Call the function with the user-provided config file as an argument check_config "$USER_CONFIG_FILE" - echo echo " ------------------------------------------------------------------- " echo " Validated the Configfile and Verified the Provided Input Parameters " @@ -654,7 +674,8 @@ EOF -var "aws_region=${aws_region}" \ -var "aws_key_pair=${aws_key_pair}" \ -var "deployment_template=${deployment_template}" \ - -var "ingress_extra_cidrs_and_ports={cidrs = ["${cdp_cidr}"],ports = [443, 22]}" + -var "ingress_extra_cidrs_and_ports={cidrs = ["${cdp_cidr}"],ports = [443, 22]}" \ + -var "datalake_version=${datalake_version}" cdp_provision_status=$? if [ $cdp_provision_status -eq 0 ]; then export ENV_PUBLIC_SUBNETS=$(terraform output -json aws_public_subnet_ids) From c556eaa0924f82c0c7d91f9438c80a52aa5b161f Mon Sep 17 00:00:00 2001 From: Avanish Tiwari Date: Tue, 24 Dec 2024 18:16:10 +0530 Subject: [PATCH 2/3] updated cml playbook --- .../cdp-wrkshps-quickstarts/cdp-data-services/enable-cml.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ClouderaSetup/OnCloud/AWS/build/cdp-wrkshps-quickstarts/cdp-data-services/enable-cml.yml b/ClouderaSetup/OnCloud/AWS/build/cdp-wrkshps-quickstarts/cdp-data-services/enable-cml.yml index 142df59..1b4dd7a 100644 --- a/ClouderaSetup/OnCloud/AWS/build/cdp-wrkshps-quickstarts/cdp-data-services/enable-cml.yml +++ b/ClouderaSetup/OnCloud/AWS/build/cdp-wrkshps-quickstarts/cdp-data-services/enable-cml.yml @@ -69,7 +69,7 @@ "enabled": true } } - {% if enable_gpu %} + {% if enable_gpu | bool %} , { "name": "gpu_settings", "instanceType": "{{ gpu_instance_type }}", From b4ae925566b6e9bea81b9c6a62b60b8784a31ec9 Mon Sep 17 00:00:00 2001 From: Avanish Tiwari Date: Mon, 30 Dec 2024 18:04:42 +0530 Subject: [PATCH 3/3] updated CHANGELOG.md --- ClouderaSetup/OnCloud/AWS/build/CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ClouderaSetup/OnCloud/AWS/build/CHANGELOG.md b/ClouderaSetup/OnCloud/AWS/build/CHANGELOG.md index a6a184d..0bc4260 100644 --- a/ClouderaSetup/OnCloud/AWS/build/CHANGELOG.md +++ b/ClouderaSetup/OnCloud/AWS/build/CHANGELOG.md @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.3.0] - 2024-12-30 + +### Added +- Added a new parameter of datalake_version +- Added a precheck for workshop name length + +### Fixed +- Updated the enable_gpu parameter to accept only boolean values + + ## [2.2.0] - 2024-12-02 ### Changed