Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/deploy-orchestrator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ on:
required: false
default: false
type: boolean
enable_scalability:
description: 'Enable Scalability (WAF only, opt-in)'
required: false
default: false
type: boolean
EXP:
description: 'Enable EXP'
required: false
Expand Down Expand Up @@ -78,6 +83,7 @@ jobs:
azure_location: ${{ inputs.azure_location }}
resource_group_name: ${{ inputs.resource_group_name }}
waf_enabled: ${{ inputs.waf_enabled }}
enable_scalability: ${{ inputs.enable_scalability }}
EXP: ${{ inputs.EXP }}
build_docker_image: ${{ inputs.build_docker_image }}
existing_webapp_url: ${{ inputs.existing_webapp_url }}
Expand Down
45 changes: 33 additions & 12 deletions .github/workflows/deploy-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,59 +43,67 @@ on:
- 'Local'
default: 'codespace'
azure_location:
description: 'Azure Location For Deployment'
description: 'Azure Region (Non-AI Services)'
required: false
default: 'australiaeast'
type: choice
options:
- 'australiaeast'
- 'centralus'
- 'eastasia'
- 'eastus'
- 'eastus2'
- 'japaneast'
- 'northeurope'
- 'southeastasia'
- 'uksouth'
- 'westeurope'
- 'westus3'
resource_group_name:
description: 'Resource Group Name (Optional)'
required: false
default: ''
type: string
build_docker_image:
description: 'Build & Use Custom Images (Optional)'
required: false
default: false
type: boolean

waf_enabled:
description: 'Enable WAF'
description: 'Deploy WAF'
required: false
default: false
type: boolean
EXP:
description: 'Enable EXP'
enable_scalability:
description: 'Enable Scalability (WAF only)'
required: false
default: false
type: boolean
build_docker_image:
description: 'Build And Push Docker Image (Optional)'
EXP:
description: 'Deploy EXP'
required: false
default: false
type: boolean

cleanup_resources:
description: 'Cleanup Deployed Resources'
description: 'Auto Delete RG'
required: false
default: false
type: boolean

AZURE_ENV_EXISTING_LOG_ANALYTICS_WORKSPACE_RID:
description: 'Log Analytics Workspace Resource ID (Optional)'
description: 'Existing Log Analytics Workspace Resource ID (Optional)'
required: false
default: ''
type: string
AZURE_EXISTING_AIPROJECT_RESOURCE_ID:
description: 'Full Azure AI Project Resource ID (Optional, format: /subscriptions/.../resourceGroups/.../providers/...)'
description: 'Existing AI Project Resource ID (Optional)'
required: false
default: ''
type: string
existing_webapp_url:
description: 'Existing WebApp URL (Skips Deployment)'
description: 'Run Tests Against Existing RG (Provide Web App URL)'
required: false
default: ''
type: string
Expand All @@ -109,6 +117,7 @@ jobs:
azure_location: ${{ steps.validate.outputs.azure_location }}
resource_group_name: ${{ steps.validate.outputs.resource_group_name }}
waf_enabled: ${{ steps.validate.outputs.waf_enabled }}
enable_scalability: ${{ steps.validate.outputs.enable_scalability }}
exp: ${{ steps.validate.outputs.exp }}
build_docker_image: ${{ steps.validate.outputs.build_docker_image }}
cleanup_resources: ${{ steps.validate.outputs.cleanup_resources }}
Expand All @@ -124,6 +133,7 @@ jobs:
INPUT_AZURE_LOCATION: ${{ github.event.inputs.azure_location }}
INPUT_RESOURCE_GROUP_NAME: ${{ github.event.inputs.resource_group_name }}
INPUT_WAF_ENABLED: ${{ github.event.inputs.waf_enabled }}
INPUT_ENABLE_SCALABILITY: ${{ github.event.inputs.enable_scalability }}
INPUT_EXP: ${{ github.event.inputs.EXP }}
INPUT_BUILD_DOCKER_IMAGE: ${{ github.event.inputs.build_docker_image }}
INPUT_CLEANUP_RESOURCES: ${{ github.event.inputs.cleanup_resources }}
Expand Down Expand Up @@ -181,6 +191,15 @@ jobs:
else
echo "✅ waf_enabled: '$WAF_ENABLED' is valid"
fi

# Validate enable_scalability (boolean, opt-in, default false)
ENABLE_SCALABILITY="${INPUT_ENABLE_SCALABILITY:-false}"
if [[ "$ENABLE_SCALABILITY" != "true" && "$ENABLE_SCALABILITY" != "false" ]]; then
echo "❌ ERROR: enable_scalability must be 'true' or 'false', got: '$ENABLE_SCALABILITY'"
VALIDATION_FAILED=true
else
echo "✅ enable_scalability: '$ENABLE_SCALABILITY' is valid"
fi

# Validate EXP (boolean)
EXP_ENABLED="${INPUT_EXP:-false}"
Expand Down Expand Up @@ -265,6 +284,7 @@ jobs:
echo "azure_location=$LOCATION" >> $GITHUB_OUTPUT
echo "resource_group_name=$INPUT_RESOURCE_GROUP_NAME" >> $GITHUB_OUTPUT
echo "waf_enabled=$WAF_ENABLED" >> $GITHUB_OUTPUT
echo "enable_scalability=$ENABLE_SCALABILITY" >> $GITHUB_OUTPUT
echo "exp=$EXP_ENABLED" >> $GITHUB_OUTPUT
echo "build_docker_image=$BUILD_DOCKER" >> $GITHUB_OUTPUT
echo "cleanup_resources=$CLEANUP_RESOURCES" >> $GITHUB_OUTPUT
Expand All @@ -281,6 +301,7 @@ jobs:
azure_location: ${{ needs.validate-inputs.outputs.azure_location || 'australiaeast' }}
resource_group_name: ${{ needs.validate-inputs.outputs.resource_group_name || '' }}
waf_enabled: ${{ needs.validate-inputs.outputs.waf_enabled == 'true' }}
enable_scalability: ${{ needs.validate-inputs.outputs.enable_scalability == 'true' }}
EXP: ${{ needs.validate-inputs.outputs.exp == 'true' }}
build_docker_image: ${{ needs.validate-inputs.outputs.build_docker_image == 'true' }}
cleanup_resources: ${{ needs.validate-inputs.outputs.cleanup_resources == 'true' }}
Expand Down
25 changes: 23 additions & 2 deletions .github/workflows/job-deploy-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ on:
required: false
type: string
default: 'false'
ENABLE_SCALABILITY:
description: 'Enable Scalability (WAF only, opt-in)'
required: false
type: string
default: 'false'
AZURE_ENV_EXISTING_LOG_ANALYTICS_WORKSPACE_RID:
required: false
type: string
Expand Down Expand Up @@ -187,11 +192,27 @@ jobs:
- name: Configure Parameters Based on WAF Setting
shell: bash
env:
WAF_ENABLED: ${{ inputs.WAF_ENABLED }}
INPUT_WAF_ENABLED: ${{ inputs.WAF_ENABLED }}
INPUT_ENABLE_SCALABILITY: ${{ inputs.ENABLE_SCALABILITY }}
run: |
if [[ "$WAF_ENABLED" == "true" ]]; then
set -euo pipefail
if [[ "$INPUT_WAF_ENABLED" == "true" ]]; then
cp infra/main.waf.parameters.json infra/main.parameters.json
echo "✅ Successfully copied WAF parameters to main parameters file"
SCALABILITY_VALUE="${INPUT_ENABLE_SCALABILITY:-false}"
if [[ "$SCALABILITY_VALUE" != "true" && "$SCALABILITY_VALUE" != "false" ]]; then
echo "❌ ERROR: ENABLE_SCALABILITY must be 'true' or 'false', got: '$SCALABILITY_VALUE'"
exit 1
fi
echo "🔧 Setting enableScalability=${SCALABILITY_VALUE}"
tmpfile=$(mktemp)
if ! jq --argjson v "$SCALABILITY_VALUE" '.parameters.enableScalability.value = $v' infra/main.parameters.json > "$tmpfile"; then
echo "❌ ERROR: jq failed to update enableScalability in infra/main.parameters.json"
rm -f "$tmpfile"
exit 1
fi
mv "$tmpfile" infra/main.parameters.json
echo "✅ enableScalability set to ${SCALABILITY_VALUE}"
else
echo "🔧 Configuring Non-WAF deployment - using default main.parameters.json..."
fi
Expand Down
25 changes: 23 additions & 2 deletions .github/workflows/job-deploy-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ on:
required: false
type: string
default: 'false'
ENABLE_SCALABILITY:
description: 'Enable Scalability (WAF only, opt-in)'
required: false
type: string
default: 'false'
AZURE_ENV_EXISTING_LOG_ANALYTICS_WORKSPACE_RID:
required: false
type: string
Expand Down Expand Up @@ -187,11 +192,27 @@ jobs:
- name: Configure Parameters Based on WAF Setting
shell: bash
env:
WAF_ENABLED: ${{ inputs.WAF_ENABLED }}
INPUT_WAF_ENABLED: ${{ inputs.WAF_ENABLED }}
INPUT_ENABLE_SCALABILITY: ${{ inputs.ENABLE_SCALABILITY }}
run: |
if [[ "$WAF_ENABLED" == "true" ]]; then
set -euo pipefail
if [[ "$INPUT_WAF_ENABLED" == "true" ]]; then
cp infra/main.waf.parameters.json infra/main.parameters.json
echo "✅ Successfully copied WAF parameters to main parameters file"
SCALABILITY_VALUE="${INPUT_ENABLE_SCALABILITY:-false}"
if [[ "$SCALABILITY_VALUE" != "true" && "$SCALABILITY_VALUE" != "false" ]]; then
echo "❌ ERROR: ENABLE_SCALABILITY must be 'true' or 'false', got: '$SCALABILITY_VALUE'"
exit 1
fi
echo "🔧 Setting enableScalability=${SCALABILITY_VALUE}"
tmpfile=$(mktemp)
if ! jq --argjson v "$SCALABILITY_VALUE" '.parameters.enableScalability.value = $v' infra/main.parameters.json > "$tmpfile"; then
echo "❌ ERROR: jq failed to update enableScalability in infra/main.parameters.json"
rm -f "$tmpfile"
exit 1
fi
mv "$tmpfile" infra/main.parameters.json
echo "✅ enableScalability set to ${SCALABILITY_VALUE}"
else
echo "🔧 Configuring Non-WAF deployment - using default main.parameters.json..."
fi
Expand Down
26 changes: 24 additions & 2 deletions .github/workflows/job-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ on:
required: false
default: false
type: boolean
enable_scalability:
description: 'Enable Scalability (WAF only, opt-in)'
required: false
default: false
type: boolean
EXP:
description: 'Enable EXP'
required: false
Expand Down Expand Up @@ -88,6 +93,7 @@ env:
GPT_MIN_CAPACITY: 500
BRANCH_NAME: ${{ github.event.workflow_run.head_branch || github.head_ref || github.ref_name }}
WAF_ENABLED: ${{ inputs.trigger_type == 'workflow_dispatch' && (inputs.waf_enabled || false) || false }}
ENABLE_SCALABILITY: ${{ inputs.trigger_type == 'workflow_dispatch' && (inputs.enable_scalability || false) || false }}
EXP: ${{ inputs.trigger_type == 'workflow_dispatch' && (inputs.EXP || false) || false }}
CLEANUP_RESOURCES: ${{ inputs.trigger_type != 'workflow_dispatch' || inputs.cleanup_resources }}
BUILD_DOCKER_IMAGE: ${{ inputs.trigger_type == 'workflow_dispatch' && (inputs.build_docker_image || false) || false }}
Expand Down Expand Up @@ -118,6 +124,7 @@ jobs:
INPUT_AZURE_LOCATION: ${{ inputs.azure_location }}
INPUT_RESOURCE_GROUP_NAME: ${{ inputs.resource_group_name }}
INPUT_WAF_ENABLED: ${{ inputs.waf_enabled }}
INPUT_ENABLE_SCALABILITY: ${{ inputs.enable_scalability }}
INPUT_EXP: ${{ inputs.EXP }}
INPUT_CLEANUP_RESOURCES: ${{ inputs.cleanup_resources }}
INPUT_AZURE_ENV_EXISTING_LOG_ANALYTICS_WORKSPACE_RID: ${{ inputs.AZURE_ENV_EXISTING_LOG_ANALYTICS_WORKSPACE_RID }}
Expand Down Expand Up @@ -189,6 +196,15 @@ jobs:
else
echo "✅ waf_enabled: '$INPUT_WAF_ENABLED' is valid"
fi

# Validate enable_scalability (boolean, opt-in, default false)
ENABLE_SCALABILITY_VALUE="${INPUT_ENABLE_SCALABILITY:-false}"
if [[ "$ENABLE_SCALABILITY_VALUE" != "true" && "$ENABLE_SCALABILITY_VALUE" != "false" ]]; then
echo "❌ ERROR: enable_scalability must be 'true' or 'false', got: '$ENABLE_SCALABILITY_VALUE'"
VALIDATION_FAILED=true
else
echo "✅ enable_scalability: '$ENABLE_SCALABILITY_VALUE' is valid"
Comment on lines +200 to +206
fi

# Validate EXP (boolean)
if [[ "$INPUT_EXP" != "true" && "$INPUT_EXP" != "false" ]]; then
Expand Down Expand Up @@ -383,15 +399,19 @@ jobs:
id: check_create_rg
shell: bash
run: |
set -e
set -e
OWNER_TAG_VALUE="${{ github.actor }}"
echo "🔍 Checking if resource group '$RESOURCE_GROUP_NAME' exists..."
rg_exists=$(az group exists --name $RESOURCE_GROUP_NAME)
if [ "$rg_exists" = "false" ]; then
echo "📦 Resource group does not exist. Creating new resource group '$RESOURCE_GROUP_NAME' in location '$AZURE_LOCATION'..."
az group create --name $RESOURCE_GROUP_NAME --location $AZURE_LOCATION --tags ${{ env.RG_TAGS }} || { echo "❌ Error creating resource group"; exit 1; }
echo "🏷️ Adding Owner tag: Owner=${OWNER_TAG_VALUE}"
az group create --name $RESOURCE_GROUP_NAME --location $AZURE_LOCATION --tags ${{ env.RG_TAGS }} "Owner=${OWNER_TAG_VALUE}" || { echo "❌ Error creating resource group"; exit 1; }
echo "✅ Resource group '$RESOURCE_GROUP_NAME' created successfully."
else
echo "✅ Resource group '$RESOURCE_GROUP_NAME' already exists. Deploying to existing resource group."
echo "🏷️ Adding Owner tag on existing resource group: Owner=${OWNER_TAG_VALUE}"
az group update --name "$RESOURCE_GROUP_NAME" --set tags.Owner="${OWNER_TAG_VALUE}" --output none || echo "⚠️ Warning: failed to update Owner tag on existing resource group '$RESOURCE_GROUP_NAME'."
fi
echo "RESOURCE_GROUP_NAME=$RESOURCE_GROUP_NAME" >> $GITHUB_OUTPUT
echo "RESOURCE_GROUP_NAME=$RESOURCE_GROUP_NAME" >> $GITHUB_ENV
Expand Down Expand Up @@ -511,6 +531,7 @@ jobs:
BUILD_DOCKER_IMAGE: ${{ inputs.build_docker_image || 'false' }}
EXP: ${{ needs.azure-setup.outputs.EXP_ENABLED }}
WAF_ENABLED: ${{ inputs.waf_enabled == true && 'true' || 'false' }}
ENABLE_SCALABILITY: ${{ inputs.enable_scalability == true && 'true' || 'false' }}
AZURE_ENV_EXISTING_LOG_ANALYTICS_WORKSPACE_RID: ${{ inputs.AZURE_ENV_EXISTING_LOG_ANALYTICS_WORKSPACE_RID }}
AZURE_EXISTING_AIPROJECT_RESOURCE_ID: ${{ inputs.AZURE_EXISTING_AIPROJECT_RESOURCE_ID }}
secrets: inherit
Expand All @@ -529,6 +550,7 @@ jobs:
BUILD_DOCKER_IMAGE: ${{ inputs.build_docker_image || 'false' }}
EXP: ${{ needs.azure-setup.outputs.EXP_ENABLED }}
WAF_ENABLED: ${{ inputs.waf_enabled == true && 'true' || 'false' }}
ENABLE_SCALABILITY: ${{ inputs.enable_scalability == true && 'true' || 'false' }}
AZURE_ENV_EXISTING_LOG_ANALYTICS_WORKSPACE_RID: ${{ inputs.AZURE_ENV_EXISTING_LOG_ANALYTICS_WORKSPACE_RID }}
AZURE_EXISTING_AIPROJECT_RESOURCE_ID: ${{ inputs.AZURE_EXISTING_AIPROJECT_RESOURCE_ID }}
secrets: inherit
Loading
Loading