From b91b2bc845fe9c702cf76a9331e039645c71e3f6 Mon Sep 17 00:00:00 2001 From: "Priyanka Singhal (Persistent Systems Inc)" Date: Wed, 26 Feb 2025 14:28:37 +0530 Subject: [PATCH 1/2] Made region list dynamic using variables for better flexibility and scalability. --- .github/workflows/deploy.yml | 1 + deploy/scripts/checkquota.sh | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 75f2da6d7..eae398856 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -22,6 +22,7 @@ jobs: export AZURE_CLIENT_SECRET=${{ secrets.AZURE_CLIENT_SECRET }} export AZURE_SUBSCRIPTION_ID="${{ secrets.AZURE_SUBSCRIPTION_ID }}" export GPT_MIN_CAPACITY="50" + export AZURE_REGIONS="${{ vars.AZURE_REGIONS }}" chmod +x deploy/scripts/checkquota.sh if ! deploy/scripts/checkquota.sh; then diff --git a/deploy/scripts/checkquota.sh b/deploy/scripts/checkquota.sh index e037419de..a27922b5a 100644 --- a/deploy/scripts/checkquota.sh +++ b/deploy/scripts/checkquota.sh @@ -1,7 +1,7 @@ #!/bin/bash # List of Azure regions to check for quota (update as needed) -REGIONS=("eastus" "westus" "northcentralus" "uksouth" "swedencentral") +IFS=' ' read -ra REGIONS <<< "$AZURE_REGIONS" SUBSCRIPTION_ID="${AZURE_SUBSCRIPTION_ID}" GPT_MIN_CAPACITY="${GPT_MIN_CAPACITY}" @@ -17,7 +17,7 @@ if ! az login --service-principal -u "$AZURE_CLIENT_ID" -p "$AZURE_CLIENT_SECRET fi echo "🔄 Validating required environment variables..." -if [[ -z "$SUBSCRIPTION_ID" || -z "$GPT_MIN_CAPACITY" ]]; then +if [[ -z "$SUBSCRIPTION_ID" || -z "$GPT_MIN_CAPACITY" || -z "$REGIONS" ]]; then echo "❌ ERROR: Missing required environment variables." exit 1 fi From 094b0de39c3c1c81ec632f9531041a44a1f23754 Mon Sep 17 00:00:00 2001 From: "Priyanka Singhal (Persistent Systems Inc)" Date: Wed, 26 Feb 2025 17:19:14 +0530 Subject: [PATCH 2/2] comma separated values --- deploy/scripts/checkquota.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/scripts/checkquota.sh b/deploy/scripts/checkquota.sh index a27922b5a..afc340378 100644 --- a/deploy/scripts/checkquota.sh +++ b/deploy/scripts/checkquota.sh @@ -1,7 +1,7 @@ #!/bin/bash # List of Azure regions to check for quota (update as needed) -IFS=' ' read -ra REGIONS <<< "$AZURE_REGIONS" +IFS=', ' read -ra REGIONS <<< "$AZURE_REGIONS" SUBSCRIPTION_ID="${AZURE_SUBSCRIPTION_ID}" GPT_MIN_CAPACITY="${GPT_MIN_CAPACITY}"