summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2024-12-29 21:46:18 +0100
committerSanto Cariotti <santo@dcariotti.me>2024-12-29 21:46:18 +0100
commitebc7927407d9423c65df657da77b9e6bcdf930a9 (patch)
treeeddd44e082b586514e023ac4c1eeb32f891693d3
parentaf26d3188ec8adb00fdc3d9ab7370468df02bee5 (diff)
Fix creation cluster choosing machine type
-rwxr-xr-xscripts/04-dataproc-create-cluster.sh17
1 files changed, 15 insertions, 2 deletions
diff --git a/scripts/04-dataproc-create-cluster.sh b/scripts/04-dataproc-create-cluster.sh
index ada258d..d2dd080 100755
--- a/scripts/04-dataproc-create-cluster.sh
+++ b/scripts/04-dataproc-create-cluster.sh
@@ -14,6 +14,19 @@ if [ "$NUM_WORKERS" -lt 1 ] || [ "$NUM_WORKERS" -gt 4 ]; then
exit 1
fi
+read -p "Enter worker-machine-type: " worker_machine
+
+if [ -z "$worker_machine" ]; then
+ echo "Error: Worker machine type cannot be empty."
+ exit 1
+fi
+
+read -p "Enter master-machine-type: " master_machine
+
+if [ -z "$master_machine" ]; then
+ echo "Error: Master machine type cannot be empty."
+ exit 1
+fi
COMMON_PARAMS="\
--project=${PROJECT} \
@@ -21,8 +34,8 @@ COMMON_PARAMS="\
--service-account=${SERVICE_ACCOUNT}@${PROJECT}.iam.gserviceaccount.com \
--master-boot-disk-size=240 \
--worker-boot-disk-size=240 \
- --worker-machine-type=n1-standard-2 \
- --master-machine-type=n1-standard-2"
+ --worker-machine-type=${worker_machine} \
+ --master-machine-type=${master_machine}"
if [ "$NUM_WORKERS" -eq 1 ]; then