Skip to content

Commit c22b2d3

Browse files
Merge pull request #604 from microsoft/psl-dk-e2epipeline
fix: added e2e testing in validate non waf pipeline and fixed WAF deployment pipeline
2 parents a53bf13 + 0fff97f commit c22b2d3

File tree

5 files changed

+78
-15
lines changed

5 files changed

+78
-15
lines changed

.github/workflows/deploy-waf.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ on:
1010
jobs:
1111
deploy:
1212
runs-on: ubuntu-latest
13+
env:
14+
GPT_MIN_CAPACITY: 1
15+
O4_MINI_MIN_CAPACITY: 1
16+
GPT41_MINI_MIN_CAPACITY: 1
1317
steps:
1418
- name: Checkout Code
1519
uses: actions/checkout@v3
@@ -21,7 +25,9 @@ jobs:
2125
export AZURE_TENANT_ID=${{ secrets.AZURE_TENANT_ID }}
2226
export AZURE_CLIENT_SECRET=${{ secrets.AZURE_CLIENT_SECRET }}
2327
export AZURE_SUBSCRIPTION_ID="${{ secrets.AZURE_SUBSCRIPTION_ID }}"
24-
export GPT_MIN_CAPACITY="150"
28+
export GPT_MIN_CAPACITY="1"
29+
export O4_MINI_MIN_CAPACITY="1"
30+
export GPT41_MINI_MIN_CAPACITY="1"
2531
export AZURE_REGIONS="${{ vars.AZURE_REGIONS }}"
2632
2733
chmod +x infra/scripts/checkquota.sh
@@ -116,7 +122,9 @@ jobs:
116122
solutionName=${{ env.SOLUTION_PREFIX }} \
117123
location="${{ env.AZURE_LOCATION }}" \
118124
azureAiServiceLocation='${{ env.AZURE_LOCATION }}' \
119-
gptModelCapacity=5 \
125+
gptModelCapacity=${{ env.GPT_MIN_CAPACITY }} \
126+
gpt4_1ModelCapacity=${{ env.GPT41_MINI_MIN_CAPACITY }} \
127+
gptReasoningModelCapacity=${{ env.O4_MINI_MIN_CAPACITY }} \
120128
enableTelemetry=true \
121129
enableMonitoring=true \
122130
enablePrivateNetworking=true \

.github/workflows/deploy.yml

Lines changed: 57 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ on:
1313
- cron: "0 11,23 * * *" # Runs at 11:00 AM and 11:00 PM GMT
1414
workflow_dispatch: #Allow manual triggering
1515
env:
16-
GPT_MIN_CAPACITY: 1
16+
GPT_MIN_CAPACITY: 150
17+
O4_MINI_MIN_CAPACITY: 50
18+
GPT41_MINI_MIN_CAPACITY: 50
1719
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
1820

1921
jobs:
@@ -36,7 +38,9 @@ jobs:
3638
export AZURE_TENANT_ID=${{ secrets.AZURE_TENANT_ID }}
3739
export AZURE_CLIENT_SECRET=${{ secrets.AZURE_CLIENT_SECRET }}
3840
export AZURE_SUBSCRIPTION_ID="${{ secrets.AZURE_SUBSCRIPTION_ID }}"
39-
export GPT_MIN_CAPACITY="1"
41+
export GPT_MIN_CAPACITY="150"
42+
export O4_MINI_MIN_CAPACITY="50"
43+
export GPT41_MINI_MIN_CAPACITY="50"
4044
export AZURE_REGIONS="${{ vars.AZURE_REGIONS }}"
4145
4246
chmod +x infra/scripts/checkquota.sh
@@ -122,7 +126,7 @@ jobs:
122126
elif [[ "${{ env.BRANCH_NAME }}" == "hotfix" ]]; then
123127
IMAGE_TAG="hotfix"
124128
else
125-
IMAGE_TAG="latest"
129+
IMAGE_TAG="latest_v3"
126130
fi
127131
128132
# Generate current timestamp in desired format: YYYY-MM-DDTHH:MM:SS.SSSSSSSZ
@@ -135,12 +139,12 @@ jobs:
135139
solutionName=${{ env.SOLUTION_PREFIX }} \
136140
location="${{ env.AZURE_LOCATION }}" \
137141
gptModelDeploymentType="GlobalStandard" \
138-
gptModelName="gpt-4o" \
139-
gptModelVersion="2024-08-06" \
142+
gptModelName="gpt-4.1-mini" \
143+
gptModelVersion="2025-04-14" \
140144
backendContainerImageTag="${IMAGE_TAG}" \
141145
frontendContainerImageTag="${IMAGE_TAG}" \
142146
azureAiServiceLocation='${{ env.AZURE_LOCATION }}' \
143-
gptModelCapacity=1 \
147+
gptModelCapacity=50 \
144148
createdBy="Pipeline" \
145149
tags="{'SecurityControl':'Ignore','Purpose':'Deploying and Cleaning Up Resources for Validation','CreatedDate':'$current_date'}" \
146150
--output json
@@ -159,9 +163,10 @@ jobs:
159163
- name: Get Container App Backend URL
160164
id: get_backend_url
161165
run: |
166+
# Get specifically the backend container app (not the MCP container app)
162167
CONTAINER_APP_NAME=$(az containerapp list \
163168
--resource-group ${{ env.RESOURCE_GROUP_NAME }} \
164-
--query "[0].name" -o tsv)
169+
--query "[?starts_with(name, 'ca-') && !contains(name, 'mcp')].name" -o tsv)
165170
166171
MACAE_URL_API=$(az containerapp show \
167172
--name "$CONTAINER_APP_NAME" \
@@ -171,6 +176,38 @@ jobs:
171176
echo "MACAE_URL_API=https://${MACAE_URL_API}" >> $GITHUB_OUTPUT
172177
echo "CONTAINER_APP=${CONTAINER_APP_NAME}" >> $GITHUB_OUTPUT
173178
179+
- name: Run Post deployment scripts
180+
run: |
181+
set -e
182+
az account set --subscription "${{ secrets.AZURE_SUBSCRIPTION_ID }}"
183+
184+
echo "Running post-deployment script..."
185+
186+
# Extract required resource names from the deployment
187+
STORAGE_ACCOUNT=$(az resource list --resource-group ${{ env.RESOURCE_GROUP_NAME }} --resource-type "Microsoft.Storage/storageAccounts" --query "[0].name" -o tsv)
188+
AI_SEARCH=$(az resource list --resource-group ${{ env.RESOURCE_GROUP_NAME }} --resource-type "Microsoft.Search/searchServices" --query "[0].name" -o tsv)
189+
190+
echo "Found Storage Account: $STORAGE_ACCOUNT"
191+
echo "Found AI Search Service: $AI_SEARCH"
192+
echo "Backend URL: ${{ steps.get_backend_url.outputs.MACAE_URL_API }}"
193+
194+
# Run upload team config script with parameters
195+
bash infra/scripts/upload_team_config.sh \
196+
"${{ steps.get_backend_url.outputs.MACAE_URL_API }}" \
197+
"data/agent_teams" \
198+
"${{ secrets.AZURE_SUBSCRIPTION_ID }}"
199+
200+
# Run process sample data script with parameters
201+
bash infra/scripts/process_sample_data.sh \
202+
"$STORAGE_ACCOUNT" \
203+
"sample-dataset" \
204+
"$AI_SEARCH" \
205+
"sample-dataset-index" \
206+
"${{ env.RESOURCE_GROUP_NAME }}" \
207+
"${{ secrets.AZURE_SUBSCRIPTION_ID }}"
208+
209+
echo "=== Post-Deployment Script Completed Successfully ==="
210+
174211
- name: Set Deployment Status
175212
id: deployment_status
176213
if: always()
@@ -181,9 +218,20 @@ jobs:
181218
echo "SUCCESS=false" >> $GITHUB_OUTPUT
182219
fi
183220
221+
e2e-test:
222+
needs: deploy
223+
if: needs.deploy.outputs.DEPLOYMENT_SUCCESS == 'true'
224+
uses: ./.github/workflows/test-automation.yml
225+
with:
226+
MACAE_WEB_URL: ${{ needs.deploy.outputs.WEBAPP_URL }}
227+
MACAE_URL_API: ${{ needs.deploy.outputs.MACAE_URL_API }}
228+
MACAE_RG: ${{ needs.deploy.outputs.RESOURCE_GROUP_NAME }}
229+
MACAE_CONTAINER_APP: ${{ needs.deploy.outputs.CONTAINER_APP }}
230+
secrets: inherit
231+
184232
cleanup-deployment:
185233
if: always() && needs.deploy.outputs.RESOURCE_GROUP_NAME != ''
186-
needs: [deploy]
234+
needs: [deploy, e2e-test]
187235
runs-on: ubuntu-latest
188236
env:
189237
RESOURCE_GROUP_NAME: ${{ needs.deploy.outputs.RESOURCE_GROUP_NAME }}
@@ -317,7 +365,7 @@ jobs:
317365
echo "Resource purging completed successfully"
318366
319367
- name: Send Notification on Failure
320-
if: failure()
368+
321369
run: |
322370
RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
323371

.github/workflows/test-automation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
MACAE_URL_API: ${{ inputs.MACAE_URL_API }}
3232
MACAE_RG: ${{ inputs.MACAE_RG }}
3333
MACAE_CONTAINER_APP: ${{ inputs.MACAE_CONTAINER_APP }}
34-
accelerator_name: "MACAE"
34+
accelerator_name: "MACAE v3"
3535

3636
steps:
3737
- name: Checkout repository

infra/scripts/checkquota.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ IFS=', ' read -ra REGIONS <<< "$AZURE_REGIONS"
55

66
SUBSCRIPTION_ID="${AZURE_SUBSCRIPTION_ID}"
77
GPT_MIN_CAPACITY="${GPT_MIN_CAPACITY}"
8+
O4_MINI_MIN_CAPACITY="${O4_MINI_MIN_CAPACITY}"
9+
GPT41_MINI_MIN_CAPACITY="${GPT41_MINI_MIN_CAPACITY}"
810
AZURE_CLIENT_ID="${AZURE_CLIENT_ID}"
911
AZURE_TENANT_ID="${AZURE_TENANT_ID}"
1012
AZURE_CLIENT_SECRET="${AZURE_CLIENT_SECRET}"
@@ -17,8 +19,10 @@ if ! az login --service-principal -u "$AZURE_CLIENT_ID" -p "$AZURE_CLIENT_SECRET
1719
fi
1820

1921
echo "🔄 Validating required environment variables..."
20-
if [[ -z "$SUBSCRIPTION_ID" || -z "$GPT_MIN_CAPACITY" || -z "$REGIONS" ]]; then
22+
if [[ -z "$SUBSCRIPTION_ID" || -z "$REGIONS" ]]; then
2123
echo "❌ ERROR: Missing required environment variables."
24+
echo "Required: AZURE_SUBSCRIPTION_ID, AZURE_REGIONS"
25+
echo "Optional: O4_MINI_MIN_CAPACITY (default: 50), GPT41_MINI_MIN_CAPACITY (default: 50)"
2226
exit 1
2327
fi
2428

@@ -31,7 +35,9 @@ echo "✅ Azure subscription set successfully."
3135

3236
# Define models and their minimum required capacities
3337
declare -A MIN_CAPACITY=(
34-
["OpenAI.GlobalStandard.gpt-4o"]=$GPT_MIN_CAPACITY
38+
["OpenAI.GlobalStandard.o4-mini"]="${O4_MINI_MIN_CAPACITY}"
39+
["OpenAI.GlobalStandard.gpt4.1"]="${GPT_MIN_CAPACITY}"
40+
["OpenAI.GlobalStandard.gpt4.1-mini"]="${GPT41_MINI_MIN_CAPACITY}"
3541
)
3642

3743
VALID_REGION=""

infra/scripts/upload_team_config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def check_team_exists(backend_url, team_id, user_principal_id):
3939

4040
backend_url = sys.argv[1]
4141
directory_path = sys.argv[2]
42-
user_principal_id = sys.argv[3] if len(sys.argv) > 3 else "00000000-0000-0000-0000-000000000000"
42+
user_principal_id = sys.argv[3] if len(sys.argv) > 3 and sys.argv[3].strip() != "" else "00000000-0000-0000-0000-000000000000"
4343

4444
# Convert to absolute path if provided as relative
4545
directory_path = os.path.abspath(directory_path)
@@ -80,6 +80,7 @@ def check_team_exists(backend_url, team_id, user_principal_id):
8080
headers = {
8181
'x-ms-client-principal-id': user_principal_id
8282
}
83+
8384
params = {
8485
'team_id': team_id
8586
}

0 commit comments

Comments
 (0)