Skip to content

feat: Enhance deployment pipeline, modularize test workflows, simplify infra, and update docs #140

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 58 commits into from
Jun 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
35149fa
checking for user region only at first place then fallback region
Priyanka-Microsoft Jun 10, 2025
7a60aae
script updated
Priyanka-Microsoft Jun 10, 2025
7bdb69b
Merge pull request #125 from microsoft/fix/prefer-user-region-fallback
Roopan-Microsoft Jun 11, 2025
2b5ccc3
refactor: added required changes to skip quota check script if AI Fou…
Abdul-Microsoft Jun 11, 2025
5a9e4a4
Merge branch 'main' into dev
Roopan-Microsoft Jun 11, 2025
0350fb4
Merge branch 'dev' of https://github.com/microsoft/Modernize-your-cod…
Abdul-Microsoft Jun 11, 2025
262fb56
refactor the quota auto validation script
Abdul-Microsoft Jun 11, 2025
9ee00bd
refactor: improve model deployment validation logic and messaging
Abdul-Microsoft Jun 11, 2025
f395a43
script updated
Priyanka-Microsoft Jun 12, 2025
3e2e8d8
regions only who has capacity above 50
Priyanka-Microsoft Jun 12, 2025
c17dfe8
interactive true
Priyanka-Microsoft Jun 12, 2025
c7d9d4b
header and data alignment
Priyanka-Microsoft Jun 12, 2025
a68b091
refactor: improve AI Foundry validation logic
Abdul-Microsoft Jun 12, 2025
97fe578
missing parameter added
VishalS-Microsoft Jun 12, 2025
b4752be
fixed pylint issues
VishalS-Microsoft Jun 12, 2025
2eba2ec
Merge pull request #129 from microsoft/psl-update-customizingazdparam…
Roopan-Microsoft Jun 12, 2025
900ba0e
Merge pull request #128 from microsoft/feature/user-interactive-quota…
Roopan-Microsoft Jun 12, 2025
ac5ca77
initial commit & update sk version
Jun 13, 2025
8ec88b6
bicep changes
Jun 13, 2025
e6d0ea1
updated the validation file
Priyanka-Microsoft Jun 13, 2025
5c5dfbc
updated the recommended list
Priyanka-Microsoft Jun 13, 2025
90f97be
Merge pull request #130 from microsoft/fix/quota-validation-update
Roopan-Microsoft Jun 13, 2025
a7d1e12
fdp code level changes- hardcoded endpoint
Jun 13, 2025
c8da88d
Remove hardcoded ai endpoint value
Jun 16, 2025
f2e1351
prashnat changes
Jun 16, 2025
f606366
bicep changes
Jun 16, 2025
b46d44f
changes package for json formatter
Jun 17, 2025
51e9ed4
updated foundry changes
Prashant-Microsoft Jun 18, 2025
b72c288
Integration of deploy & test automation
AjitPadhi-Microsoft Jun 18, 2025
4a10e77
updated deploy pipeline
AjitPadhi-Microsoft Jun 18, 2025
27d3bc4
updated deploy pipeline
AjitPadhi-Microsoft Jun 18, 2025
762baf2
modify code
Prashant-Microsoft Jun 18, 2025
47fd2b4
Merge branch 'dev' into psl-sw-cm-fdp
Jun 18, 2025
15357df
remove commented code
Jun 18, 2025
eea319d
fix pylint errors
Jun 18, 2025
5579006
updated deploy pipeline
AjitPadhi-Microsoft Jun 18, 2025
cff26a9
updated deploy pipeline
AjitPadhi-Microsoft Jun 18, 2025
e4fa30a
GP Test automation changes
Bangarraju-Microsoft Jun 18, 2025
069fc59
Merge pull request #132 from microsoft/psl-sw-cm-fdp
Roopan-Microsoft Jun 18, 2025
8d0bd7b
updated deploy pipeline
AjitPadhi-Microsoft Jun 18, 2025
bcec6f0
updated deploy pipeline
AjitPadhi-Microsoft Jun 18, 2025
99bf732
Merge branch 'dev' of https://github.com/microsoft/Modernize-your-cod…
Bangarraju-Microsoft Jun 19, 2025
8a07b98
updated test automation pipeline
AjitPadhi-Microsoft Jun 19, 2025
19a198f
PyLint issues
Bangarraju-Microsoft Jun 19, 2025
373e890
pylint issue
Bangarraju-Microsoft Jun 19, 2025
cf387a9
pylint issues
Bangarraju-Microsoft Jun 19, 2025
022893e
updated test automation pipeline with bicep
AjitPadhi-Microsoft Jun 19, 2025
518e3f5
Merge branch 'dev' into PSL-US-18922
AjitPadhi-Microsoft Jun 19, 2025
20db2e5
PyLint issues
Bangarraju-Microsoft Jun 19, 2025
8d5a029
lint issues
Bangarraju-Microsoft Jun 19, 2025
e10c7ab
updated test automation pipeline with bicep
AjitPadhi-Microsoft Jun 19, 2025
018d55b
lint issues
Bangarraju-Microsoft Jun 19, 2025
b590fe0
lint issue in conftest.py
Bangarraju-Microsoft Jun 19, 2025
ec451a2
test: Implemented Log execution time per prompt in Report
Avijit-Microsoft Jun 19, 2025
5bba223
updated bicep
AjitPadhi-Microsoft Jun 19, 2025
42ad60b
removed local branch from workflow
AjitPadhi-Microsoft Jun 19, 2025
2f939b2
test: Integration of deploy & test automation
Avijit-Microsoft Jun 19, 2025
146e075
Merge branch 'main' into dev
Jun 20, 2025
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
96 changes: 81 additions & 15 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,28 @@
name: Validate Deployment
name: Deploy-Test-Cleanup Pipeline

on:
push:
branches:
- main
schedule:
- cron: '0 5,17 * * *' # Runs at 5:00 AM and 5:00 PM GMT
workflow_dispatch:
workflow_run:
workflows: ["Build Docker and Optional Push"]
types:
- completed
branches:
- main
- dev
- demo
schedule:
- cron: '0 5,17 * * *' # Runs at 5:00 AM and 5:00 PM GMT
workflow_dispatch:

env:
GPT_MIN_CAPACITY: 200
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}

jobs:
deploy:
runs-on: ubuntu-latest
outputs:
RESOURCE_GROUP_NAME: ${{ steps.check_create_rg.outputs.RESOURCE_GROUP_NAME }}
WEBAPP_URL: ${{ steps.get_output.outputs.WEBAPP_URL }}
steps:
- name: Checkout Code
uses: actions/checkout@v3
Expand All @@ -36,7 +48,6 @@ jobs:
UNIQUE_RG_NAME="arg-${ACCL_NAME}-${SHORT_UUID}"
echo "RESOURCE_GROUP_NAME=${UNIQUE_RG_NAME}" >> $GITHUB_ENV
echo "Generated RESOURCE_GROUP_NAME: ${UNIQUE_RG_NAME}"


- name: Check and Create Resource Group
id: check_create_rg
Expand All @@ -50,8 +61,8 @@ jobs:
else
echo "Resource group already exists."
fi
echo "RESOURCE_GROUP_NAME=${{ env.RESOURCE_GROUP_NAME }}" >> $GITHUB_OUTPUT


- name: Generate Unique Solution Prefix
id: generate_solution_prefix
run: |
Expand All @@ -63,17 +74,42 @@ jobs:
echo "SOLUTION_PREFIX=${UNIQUE_SOLUTION_PREFIX}" >> $GITHUB_ENV
echo "Generated SOLUTION_PREFIX: ${UNIQUE_SOLUTION_PREFIX}"


- name: Deploy Bicep Template
id: deploy
run: |
set -e
# set image tag based on branch
if [[ "${{ env.BRANCH_NAME }}" == "main" ]]; then
IMAGE_TAG="latest"
elif [[ "${{ env.BRANCH_NAME }}" == "dev" ]]; then
IMAGE_TAG="dev"
elif [[ "${{ env.BRANCH_NAME }}" == "demo" ]]; then
IMAGE_TAG="demo"
else
IMAGE_TAG="latest"
fi

az deployment group create \
--name ${{ env.SOLUTION_PREFIX }}-deployment \
--resource-group ${{ env.RESOURCE_GROUP_NAME }} \
--template-file infra/main.bicep \
--parameters AzureAiServiceLocation=swedencentral Prefix=${{ env.SOLUTION_PREFIX }}\
--parameters \
Prefix="${{ env.SOLUTION_PREFIX }}" \
AzureAiServiceLocation="eastus" \
capacity=${{ env.GPT_MIN_CAPACITY }} \
imageVersion="${IMAGE_TAG}"\
--debug

- name: Get Deployment Output and extract Values
id: get_output
run: |
set -e
echo "Fetching deployment output..."
BICEP_OUTPUT=$(az deployment group show --name ${{ env.SOLUTION_PREFIX }}-deployment --resource-group ${{ env.RESOURCE_GROUP_NAME }} --query "properties.outputs" -o json)
echo "Extracting deployment output..."
WEBAPP_URL=$(echo $BICEP_OUTPUT | jq -r '.weB_APP_URL.value')
echo "WEBAPP_URL=$WEBAPP_URL" >> $GITHUB_OUTPUT
echo "Deployment output: $BICEP_OUTPUT"

- name: Send Notification on Failure
if: failure()
Expand All @@ -93,6 +129,34 @@ jobs:
-H "Content-Type: application/json" \
-d "$EMAIL_BODY" || echo "Failed to send notification"

- name: Logout from Azure
if: always()
run: |
az logout
echo "Logged out from Azure."

e2e-test:
needs: deploy
uses: ./.github/workflows/test-automation.yml
with:
CODEMOD_WEB_URL: ${{ needs.deploy.outputs.WEBAPP_URL }}
secrets: inherit

cleanup-deployment:
if: always() && needs.deploy.outputs.RESOURCE_GROUP_NAME != ''
needs: [deploy, e2e-test]
runs-on: ubuntu-latest
env:
RESOURCE_GROUP_NAME: ${{ needs.deploy.outputs.RESOURCE_GROUP_NAME }}
steps:
- name: Setup Azure CLI
run: |
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
az --version # Verify installation

- name: Login to Azure
run: |
az login --service-principal -u ${{ secrets.AZURE_CLIENT_ID }} -p ${{ secrets.AZURE_CLIENT_SECRET }} --tenant ${{ secrets.AZURE_TENANT_ID }}

- name: Get Log Analytics Workspace and OpenAI from Resource Group
if: always()
Expand Down Expand Up @@ -126,7 +190,6 @@ jobs:
echo "OpenAI resource name: ${openai_resource_name}"
fi


- name: List KeyVaults and Store in Array
if: always()
id: list_keyvaults
Expand Down Expand Up @@ -177,7 +240,6 @@ jobs:

echo "Log analytics workspace resource purging completed successfully"


- name: Delete Bicep Deployment
if: always()
run: |
Expand All @@ -195,7 +257,6 @@ jobs:
echo "Resource group does not exists."
fi


- name: Wait for resource deletion to complete
if: always()
run: |
Expand Down Expand Up @@ -255,7 +316,6 @@ jobs:
break
fi
done


- name: Purging the Resources
if: always()
Expand Down Expand Up @@ -302,3 +362,9 @@ jobs:
fi
done
echo "Resource purging completed successfully"

- name: Logout from Azure
if: always()
run: |
az logout
echo "Logged out from Azure."
50 changes: 18 additions & 32 deletions .github/workflows/test-automation.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
name: Test Automation Code Modernization

on:
push:
branches:
- main
- dev
paths:
- 'tests/e2e-test/**'
schedule:
- cron: '0 13 * * *' # Runs at 1 PM UTC
workflow_dispatch:
workflow_call:
inputs:
CODEMOD_WEB_URL:
required: true
type: string
description: "Web URL for Code Modernization"
secrets:
EMAILNOTIFICATION_LOGICAPP_URL_TA:
required: false
description: "Logic App URL for email notifications"

env:
url: ${{ vars.CODEMOD_WEB_URL }}
accelerator_name: "Code Modernization"
url: ${{ inputs.CODEMOD_WEB_URL }}
accelerator_name: "Code Modernization"

jobs:
test:

runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand All @@ -33,15 +33,6 @@ jobs:
with:
creds: '{"clientId":"${{ secrets.AZURE_CLIENT_ID }}","clientSecret":"${{ secrets.AZURE_CLIENT_SECRET }}","subscriptionId":"${{ secrets.AZURE_SUBSCRIPTION_ID }}","tenantId":"${{ secrets.AZURE_TENANT_ID }}"}'

- name: Start Container App
id: start-container-app
uses: azure/cli@v2
with:
azcliversion: 'latest'
inlineScript: |
az rest -m post -u "/subscriptions/${{ secrets.AZURE_SUBSCRIPTION_ID }}/resourceGroups/${{ vars.CODEMOD_RG }}/providers/Microsoft.App/containerApps/${{ vars.CODEMOD_FRONTEND_CONTAINER_NAME }}/start?api-version=2025-01-01"
az rest -m post -u "/subscriptions/${{ secrets.AZURE_SUBSCRIPTION_ID }}/resourceGroups/${{ vars.CODEMOD_RG }}/providers/Microsoft.App/containerApps/${{ vars.CODEMOD_BACKEND_CONTAINER_NAME }}/start?api-version=2025-01-01"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -50,6 +41,11 @@ jobs:
- name: Ensure browsers are installed
run: python -m playwright install --with-deps chromium

- name: Open URL
run: |
echo "Opening URL: ${{ env.url }}"
python -m webbrowser "${{ env.url }}"

- name: Run tests(1)
id: test1
run: |
Expand Down Expand Up @@ -118,14 +114,4 @@ jobs:
# Send the notification
curl -X POST "${{ secrets.EMAILNOTIFICATION_LOGICAPP_URL_TA }}" \
-H "Content-Type: application/json" \
-d "$EMAIL_BODY" || echo "Failed to send notification"

- name: Stop Container App
if: always()
uses: azure/cli@v2
with:
azcliversion: 'latest'
inlineScript: |
az rest -m post -u "/subscriptions/${{ secrets.AZURE_SUBSCRIPTION_ID }}/resourceGroups/${{ vars.CODEMOD_RG }}/providers/Microsoft.App/containerApps/${{ vars.CODEMOD_FRONTEND_CONTAINER_NAME }}/stop?api-version=2025-01-01"
az rest -m post -u "/subscriptions/${{ secrets.AZURE_SUBSCRIPTION_ID }}/resourceGroups/${{ vars.CODEMOD_RG }}/providers/Microsoft.App/containerApps/${{ vars.CODEMOD_BACKEND_CONTAINER_NAME }}/stop?api-version=2025-01-01"
az logout
-d "$EMAIL_BODY" || echo "Failed to send notification"
6 changes: 3 additions & 3 deletions azure.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ hooks:
posix:
shell: sh
run: >
chmod u+r+x ./scripts/validate_model_deployment_quota.sh; chmod u+r+x ./scripts/validate_model_quota.sh; ./scripts/validate_model_deployment_quota.sh --subscription "$AZURE_SUBSCRIPTION_ID" --location "${AZURE_AISERVICE_LOCATION:-japaneast}" --models-parameter "aiModelDeployments"
interactive: false
chmod u+r+x ./scripts/validate_model_deployment_quota.sh; chmod u+r+x ./scripts/validate_model_quota.sh; ./scripts/validate_model_deployment_quota.sh --SubscriptionId "$AZURE_SUBSCRIPTION_ID" --Location "${AZURE_AISERVICE_LOCATION:-japaneast}" --ModelsParameter "aiModelDeployments"
interactive: true
continueOnError: false

windows:
shell: pwsh
run: >
$location = if ($env:AZURE_AISERVICE_LOCATION) { $env:AZURE_AISERVICE_LOCATION } else { "japaneast" };
./scripts/validate_model_deployment_quota.ps1 -SubscriptionId $env:AZURE_SUBSCRIPTION_ID -Location $location -ModelsParameter "aiModelDeployments"
interactive: false
interactive: true
continueOnError: false
2 changes: 2 additions & 0 deletions infra/abbreviations.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"ai": {
"aiSearch": "srch-",
"aiServices": "aisa-",
"aiFoundry": "aif-",
"aiFoundryProject": "aifp-",
"aiVideoIndexer": "avi-",
"machineLearningWorkspace": "mlw-",
"openAIService": "oai-",
Expand Down
Loading