Skip to content

Commit 617c7ce

Browse files
Merge pull request #139 from microsoft/psl-update-notification
ci: refactor notification email templates
2 parents a541c78 + c98c56b commit 617c7ce

5 files changed

Lines changed: 141 additions & 256 deletions

File tree

.github/workflows/deploy-orchestrator.yml

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,25 @@ jobs:
102102
TEST_SUITE: ${{ inputs.trigger_type == 'workflow_dispatch' && inputs.run_e2e_tests || 'GoldenPath-Testing' }}
103103
secrets: inherit
104104

105-
send-notification:
106-
if: "!cancelled()"
105+
cleanup-deployment:
106+
if: "always() && needs.deploy.outputs.RESOURCE_GROUP_NAME != '' && inputs.existing_webapp_url == '' && (inputs.trigger_type != 'workflow_dispatch' || inputs.cleanup_resources)"
107107
needs: [docker-build, deploy, e2e-test]
108+
uses: ./.github/workflows/job-cleanup-deployment.yml
109+
with:
110+
runner_os: ${{ inputs.runner_os }}
111+
trigger_type: ${{ inputs.trigger_type }}
112+
cleanup_resources: ${{ inputs.cleanup_resources }}
113+
existing_webapp_url: ${{ inputs.existing_webapp_url }}
114+
RESOURCE_GROUP_NAME: ${{ needs.deploy.outputs.RESOURCE_GROUP_NAME }}
115+
AZURE_LOCATION: ${{ needs.deploy.outputs.AZURE_LOCATION }}
116+
AZURE_ENV_OPENAI_LOCATION: ${{ needs.deploy.outputs.AZURE_ENV_OPENAI_LOCATION }}
117+
ENV_NAME: ${{ needs.deploy.outputs.ENV_NAME }}
118+
IMAGE_TAG: ${{ needs.deploy.outputs.IMAGE_TAG }}
119+
secrets: inherit
108120

121+
send-notification:
122+
if: "!cancelled()"
123+
needs: [docker-build, deploy, e2e-test, cleanup-deployment]
109124
uses: ./.github/workflows/job-send-notification.yml
110125
with:
111126
trigger_type: ${{ inputs.trigger_type }}
@@ -120,21 +135,5 @@ jobs:
120135
QUOTA_FAILED: ${{ needs.deploy.outputs.QUOTA_FAILED }}
121136
TEST_SUCCESS: ${{ needs.e2e-test.outputs.TEST_SUCCESS }}
122137
TEST_REPORT_URL: ${{ needs.e2e-test.outputs.TEST_REPORT_URL }}
123-
secrets: inherit
124-
125-
cleanup-deployment:
126-
if: "always() && needs.deploy.outputs.RESOURCE_GROUP_NAME != '' && inputs.existing_webapp_url == '' && (inputs.trigger_type != 'workflow_dispatch' || inputs.cleanup_resources)"
127-
needs: [docker-build, deploy, e2e-test]
128-
129-
uses: ./.github/workflows/job-cleanup-deployment.yml
130-
with:
131-
runner_os: ${{ inputs.runner_os }}
132-
trigger_type: ${{ inputs.trigger_type }}
133-
cleanup_resources: ${{ inputs.cleanup_resources }}
134-
existing_webapp_url: ${{ inputs.existing_webapp_url }}
135-
RESOURCE_GROUP_NAME: ${{ needs.deploy.outputs.RESOURCE_GROUP_NAME }}
136-
AZURE_LOCATION: ${{ needs.deploy.outputs.AZURE_LOCATION }}
137-
AZURE_ENV_OPENAI_LOCATION: ${{ needs.deploy.outputs.AZURE_ENV_OPENAI_LOCATION }}
138-
ENV_NAME: ${{ needs.deploy.outputs.ENV_NAME }}
139-
IMAGE_TAG: ${{ needs.deploy.outputs.IMAGE_TAG }}
138+
cleanup_result: ${{ needs.cleanup-deployment.result }}
140139
secrets: inherit

.github/workflows/job-deploy-linux.yml

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ jobs:
241241
242242
# Set additional parameters
243243
azd env set AZURE_SUBSCRIPTION_ID="${{ secrets.AZURE_SUBSCRIPTION_ID }}"
244-
azd env set AZURE_ENV_AI_SERVICE_LOCATION="$INPUT_AZURE_ENV_OPENAI_LOCATION"
244+
azd env set AZURE_ENV_OPENAI_LOCATION="$INPUT_AZURE_ENV_OPENAI_LOCATION"
245245
azd env set AZURE_LOCATION="$INPUT_AZURE_LOCATION"
246246
azd env set AZURE_RESOURCE_GROUP="$INPUT_RESOURCE_GROUP_NAME"
247247
azd env set AZURE_ENV_IMAGETAG="$INPUT_IMAGE_TAG"
@@ -409,15 +409,19 @@ jobs:
409409
# Navigate to workspace root
410410
cd $GITHUB_WORKSPACE
411411
412-
# Run the data upload script (it will pull parameters from azd env and install its own requirements)
413-
bash ./infra/scripts/data_scripts/run_upload_data_scripts.sh
414-
415-
if [[ $? -eq 0 ]]; then
416-
echo "✅ Data upload completed successfully"
417-
else
418-
echo "❌ Data upload failed"
419-
exit 1
420-
fi
412+
MAX_RETRIES=3
413+
RETRY_DELAY=30
414+
for attempt in $(seq 1 $MAX_RETRIES); do
415+
echo "🔄 Attempt $attempt of $MAX_RETRIES..."
416+
bash ./infra/scripts/data_scripts/run_upload_data_scripts.sh && break
417+
if [[ $attempt -eq $MAX_RETRIES ]]; then
418+
echo "❌ Data upload failed after $MAX_RETRIES attempts"
419+
exit 1
420+
fi
421+
echo "⚠️ Attempt $attempt failed. Retrying in ${RETRY_DELAY}s..."
422+
sleep $RETRY_DELAY
423+
done
424+
echo "✅ Data upload completed successfully"
421425
- name: Run Agent Creation Scripts
422426
shell: bash
423427
run: |
@@ -426,15 +430,19 @@ jobs:
426430
# Navigate to workspace root
427431
cd $GITHUB_WORKSPACE
428432
429-
# Run the agent creation script (it will pull parameters from azd env and install its own requirements)
430-
bash ./infra/scripts/agent_scripts/run_create_agents_scripts.sh
431-
432-
if [[ $? -eq 0 ]]; then
433-
echo "✅ Agent creation completed successfully"
434-
else
435-
echo "❌ Agent creation failed"
436-
exit 1
437-
fi
433+
MAX_RETRIES=3
434+
RETRY_DELAY=30
435+
for attempt in $(seq 1 $MAX_RETRIES); do
436+
echo "🔄 Attempt $attempt of $MAX_RETRIES..."
437+
bash ./infra/scripts/agent_scripts/run_create_agents_scripts.sh && break
438+
if [[ $attempt -eq $MAX_RETRIES ]]; then
439+
echo "❌ Agent creation failed after $MAX_RETRIES attempts"
440+
exit 1
441+
fi
442+
echo "⚠️ Attempt $attempt failed. Retrying in ${RETRY_DELAY}s..."
443+
sleep $RETRY_DELAY
444+
done
445+
echo "✅ Agent creation completed successfully"
438446
439447
- name: Wait for Data Propagation
440448
shell: bash

.github/workflows/job-deploy-windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ jobs:
245245
246246
# Set additional parameters
247247
azd env set AZURE_SUBSCRIPTION_ID="${{ secrets.AZURE_SUBSCRIPTION_ID }}"
248-
azd env set AZURE_ENV_AI_SERVICE_LOCATION="$env:INPUT_AZURE_ENV_OPENAI_LOCATION"
248+
azd env set AZURE_ENV_OPENAI_LOCATION="$env:INPUT_AZURE_ENV_OPENAI_LOCATION"
249249
azd env set AZURE_LOCATION="$env:INPUT_AZURE_LOCATION"
250250
azd env set AZURE_RESOURCE_GROUP="$env:INPUT_RESOURCE_GROUP_NAME"
251251
azd env set AZURE_ENV_IMAGETAG="$env:INPUT_IMAGE_TAG"

.github/workflows/job-deploy.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,12 @@ on:
9090
value: ${{ jobs.azure-setup.outputs.QUOTA_FAILED }}
9191

9292
env:
93-
GPT_MIN_CAPACITY: 150
93+
GPT_MIN_CAPACITY: 50
9494
BRANCH_NAME: ${{ github.event.workflow_run.head_branch || github.head_ref || github.ref_name }}
9595
WAF_ENABLED: ${{ inputs.trigger_type == 'workflow_dispatch' && (inputs.waf_enabled || false) || false }}
9696
EXP: ${{ inputs.trigger_type == 'workflow_dispatch' && (inputs.EXP || false) || false }}
9797
CLEANUP_RESOURCES: ${{ inputs.trigger_type != 'workflow_dispatch' || inputs.cleanup_resources }}
98-
# RUN_E2E_TESTS: ${{ inputs.trigger_type == 'workflow_dispatch' && (inputs.run_e2e_tests || 'GoldenPath-Testing') || 'GoldenPath-Testing' }}
98+
RUN_E2E_TESTS: ${{ inputs.trigger_type == 'workflow_dispatch' && (inputs.run_e2e_tests || 'GoldenPath-Testing') || 'GoldenPath-Testing' }}
9999
BUILD_DOCKER_IMAGE: ${{ inputs.trigger_type == 'workflow_dispatch' && (inputs.build_docker_image || false) || false }}
100100

101101
jobs:
@@ -121,7 +121,7 @@ jobs:
121121
INPUT_EXP: ${{ inputs.EXP }}
122122
INPUT_WAF_ENABLED: ${{ inputs.waf_enabled }}
123123
INPUT_CLEANUP_RESOURCES: ${{ inputs.cleanup_resources }}
124-
# INPUT_RUN_E2E_TESTS: ${{ inputs.run_e2e_tests }}
124+
INPUT_RUN_E2E_TESTS: ${{ inputs.run_e2e_tests }}
125125
INPUT_AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID: ${{ inputs.AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID }}
126126
INPUT_AZURE_EXISTING_AI_PROJECT_RESOURCE_ID: ${{ inputs.AZURE_EXISTING_AI_PROJECT_RESOURCE_ID }}
127127
INPUT_DOCKER_IMAGE_TAG: ${{ inputs.docker_image_tag }}
@@ -176,16 +176,16 @@ jobs:
176176
echo "✅ cleanup_resources: '$INPUT_CLEANUP_RESOURCES' is valid"
177177
fi
178178
179-
# # Validate run_e2e_tests (specific allowed values)
180-
# if [[ -n "$INPUT_RUN_E2E_TESTS" ]]; then
181-
# ALLOWED_VALUES=("None" "GoldenPath-Testing" "Smoke-Testing")
182-
# if [[ ! " ${ALLOWED_VALUES[@]} " =~ " ${INPUT_RUN_E2E_TESTS} " ]]; then
183-
# echo "❌ ERROR: run_e2e_tests '$INPUT_RUN_E2E_TESTS' is invalid. Allowed values: ${ALLOWED_VALUES[*]}"
184-
# VALIDATION_FAILED=true
185-
# else
186-
# echo "✅ run_e2e_tests: '$INPUT_RUN_E2E_TESTS' is valid"
187-
# fi
188-
# fi
179+
# Validate run_e2e_tests (specific allowed values)
180+
if [[ -n "$INPUT_RUN_E2E_TESTS" ]]; then
181+
ALLOWED_VALUES=("None" "GoldenPath-Testing" "Smoke-Testing")
182+
if [[ ! " ${ALLOWED_VALUES[@]} " =~ " ${INPUT_RUN_E2E_TESTS} " ]]; then
183+
echo "❌ ERROR: run_e2e_tests '$INPUT_RUN_E2E_TESTS' is invalid. Allowed values: ${ALLOWED_VALUES[*]}"
184+
VALIDATION_FAILED=true
185+
else
186+
echo "✅ run_e2e_tests: '$INPUT_RUN_E2E_TESTS' is valid"
187+
fi
188+
fi
189189
190190
# Validate AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID (Azure Resource ID format)
191191
if [[ -n "$INPUT_AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID" ]]; then
@@ -393,14 +393,14 @@ jobs:
393393
echo "Current branch: $BRANCH_NAME"
394394
395395
if [[ "$BRANCH_NAME" == "main" ]]; then
396-
IMAGE_TAG="latest"
396+
IMAGE_TAG="latest_v2"
397397
elif [[ "$BRANCH_NAME" == "dev" ]]; then
398398
IMAGE_TAG="dev"
399399
elif [[ "$BRANCH_NAME" == "demo" ]]; then
400400
IMAGE_TAG="demo"
401401
else
402-
IMAGE_TAG="latest"
403-
echo "Using default for branch '$BRANCH_NAME' - image tag: latest"
402+
IMAGE_TAG="latest_v2"
403+
echo "Using default for branch '$BRANCH_NAME' - image tag: latest_v2"
404404
fi
405405
echo "Using existing Docker image tag: $IMAGE_TAG"
406406
fi

0 commit comments

Comments
 (0)