From 2a8a433ab89af05b675a5b84653bca57a8023124 Mon Sep 17 00:00:00 2001 From: Bobbins228 Date: Tue, 14 May 2024 15:35:21 +0100 Subject: [PATCH] Added kueue setup make target --- Makefile | 5 +++ scripts/setup-kueue-resources.sh | 77 ++++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100755 scripts/setup-kueue-resources.sh diff --git a/Makefile b/Makefile index cbe476a5..8f2a9cdd 100644 --- a/Makefile +++ b/Makefile @@ -400,3 +400,8 @@ image-mnist-job-test-build: ## Build container image with the MNIST job. .PHONY: image-mnist-job-test-push image-mnist-job-test-push: image-mnist-job-test-build ## Push container image with the MNIST job. podman push ${MNIST_JOB_TEST_IMG} + +# Make target for generating kueue related resources +.PHONY: kueue-setup +kueue-setup: + bash scripts/setup-kueue-resources.sh diff --git a/scripts/setup-kueue-resources.sh b/scripts/setup-kueue-resources.sh new file mode 100755 index 00000000..ad5736d2 --- /dev/null +++ b/scripts/setup-kueue-resources.sh @@ -0,0 +1,77 @@ +#!/bin/bash + +# Function to prompt the user for input with a default value +prompt_for_input() { + local prompt_message=$1 + local default_value=$2 + local user_input + + read -p "$prompt_message [$default_value] ): " user_input + echo "${user_input:-$default_value}" +} + +echo "ClusterQueue Configuration" + +# Using function to get user inputs +name=$(prompt_for_input "Enter your Cluster Queue name, (default : " "cluster-queue") +cpu=$(prompt_for_input "Enter your Cluster Queue CPU (The amount of CPUs available: (default: " "16") +memory=$(prompt_for_input "Enter your Cluster Queue Memory (The amount of memory available) (default: " "60Gi") +gpu=$(prompt_for_input "Enter your Cluster Queue GPU count (The amount of GPUs available) (default: " "0") +pods=$(prompt_for_input "Enter your Cluster Queue Pods limit (The maximum amount of pods that can be created) (default:" "10") +flavour=$(prompt_for_input "Enter your Cluster Queue Resource Flavour (default: " "default-flavor") + +# Applying ClusterQueue configuration +kubectl apply --server-side -f - <