Skip to content

Commit 2eb6ddb

Browse files
Merge branch 'main' into demo
2 parents 05071af + 7c3cb07 commit 2eb6ddb

54 files changed

Lines changed: 7551 additions & 1009 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/CI.yml

Lines changed: 33 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,28 @@ on:
55
- main # Adjust this to the branch you want to trigger the deployment on
66
- dev
77
- demo
8+
paths:
9+
- 'infra/**'
10+
- 'App/**'
11+
- 'Deployment/**'
12+
- 'azure.yaml'
13+
- '.github/workflows/CI.yml'
14+
- '.github/workflows/test-automation.yml'
15+
- 'tests/**'
816
schedule:
917
- cron: "0 10,22 * * *" # Runs at 10:00 AM and 10:00 PM GMT
10-
18+
permissions:
19+
id-token: write
20+
contents: read
21+
actions: read
1122
env:
1223
GPT_CAPACITY: 150
1324
TEXT_EMBEDDING_CAPACITY: 200
1425

1526
jobs:
1627
deploy:
1728
runs-on: ubuntu-latest
29+
environment: production
1830
outputs:
1931
RESOURCE_GROUP_NAME: ${{ steps.get_webapp_url.outputs.RESOURCE_GROUP_NAME }}
2032
KUBERNETES_RESOURCE_GROUP_NAME: ${{ steps.get_webapp_url.outputs.KUBERNETES_RESOURCE_GROUP_NAME }}
@@ -27,12 +39,6 @@ jobs:
2739
- name: Checkout Code
2840
uses: actions/checkout@v5 # Checks out your repository
2941

30-
- name: Install Azure CLI
31-
shell: bash
32-
run: |
33-
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
34-
az --version # Verify installation
35-
3642
- name: Install Kubernetes CLI (kubectl)
3743
shell: bash
3844
run: |
@@ -74,6 +80,14 @@ jobs:
7480
with:
7581
driver: docker
7682

83+
- name: Login to Azure
84+
uses: azure/login@v2
85+
with:
86+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
87+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
88+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
89+
enable-AzPSSession: true
90+
7791
- name: Run Quota Check
7892
id: quota-check
7993
shell: pwsh
@@ -101,9 +115,6 @@ jobs:
101115
}
102116
env:
103117
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
104-
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
105-
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
106-
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
107118
GPT_MIN_CAPACITY: ${{ env.GPT_CAPACITY }}
108119
TEXT_EMBEDDING_MIN_CAPACITY: ${{ env.TEXT_EMBEDDING_CAPACITY }}
109120
AZURE_REGIONS: "${{ vars.AZURE_REGIONS }}"
@@ -136,10 +147,8 @@ jobs:
136147
- name: Install Bicep CLI
137148
run: az bicep install
138149

139-
- name: Install Azure Developer CLI
140-
run: |
141-
curl -fsSL https://aka.ms/install-azd.sh | bash
142-
shell: bash
150+
- name: Install azd
151+
uses: Azure/setup-azd@v2
143152

144153
- name: Set Deployment Region
145154
run: |
@@ -156,11 +165,6 @@ jobs:
156165
echo "RESOURCE_GROUP_NAME=${UNIQUE_RG_NAME}" >> $GITHUB_ENV
157166
echo "Generated RESOURCE_GROUP_NAME: ${UNIQUE_RG_NAME}"
158167
159-
- name: Login to Azure
160-
run: |
161-
az login --service-principal -u ${{ secrets.AZURE_CLIENT_ID }} -p ${{ secrets.AZURE_CLIENT_SECRET }} --tenant ${{ secrets.AZURE_TENANT_ID }}
162-
az account set --subscription ${{ secrets.AZURE_SUBSCRIPTION_ID }}
163-
164168
- name: Check and Create Resource Group
165169
id: check_create_rg
166170
run: |
@@ -250,11 +254,8 @@ jobs:
250254
Write-Host "Resource Group Name is ${{ env.RESOURCE_GROUP_NAME }}"
251255
Write-Host "Kubernetes resource group is ${{ env.AZURE_AKS_NAME }}"
252256
env:
253-
# From GitHub secrets (for login)
257+
# From GitHub secrets
254258
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
255-
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
256-
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
257-
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
258259

259260
# From deployment outputs step (these come from $GITHUB_ENV)
260261
RESOURCE_GROUP_NAME: ${{ env.RESOURCE_GROUP_NAME }}
@@ -290,10 +291,9 @@ jobs:
290291
if az account show &> /dev/null; then
291292
echo "Azure CLI is authenticated."
292293
else
293-
echo "Azure CLI is not authenticated. Logging in..."
294-
az login --service-principal --username ${{ secrets.AZURE_CLIENT_ID }} --password ${{ secrets.AZURE_CLIENT_SECRET }} --tenant ${{ secrets.AZURE_TENANT_ID }}
294+
echo "Azure CLI is not authenticated. Please check the OIDC login step."
295+
exit 1
295296
fi
296-
az account set --subscription ${{ secrets.AZURE_SUBSCRIPTION_ID }}
297297
298298
# Get the Web App URL and save it to GITHUB_OUTPUT
299299
echo "Retrieving Web App URL..."
@@ -348,6 +348,7 @@ jobs:
348348
349349
- name: Run Post Deployment Script
350350
shell: pwsh
351+
continue-on-error: true
351352
run: |
352353
Write-Host "Running post deployment script to upload files..."
353354
cd Deployment
@@ -390,6 +391,7 @@ jobs:
390391
if: always()
391392
needs: [deploy, e2e-test]
392393
runs-on: ubuntu-latest
394+
environment: production
393395
env:
394396
RESOURCE_GROUP_NAME: ${{ needs.deploy.outputs.RESOURCE_GROUP_NAME }}
395397
KUBERNETES_RESOURCE_GROUP_NAME: ${{ needs.deploy.outputs.KUBERNETES_RESOURCE_GROUP_NAME }}
@@ -398,17 +400,12 @@ jobs:
398400
VALID_REGION: ${{ needs.deploy.outputs.VALID_REGION }}
399401

400402
steps:
401-
- name: Install Azure CLI
402-
shell: bash
403-
run: |
404-
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
405-
az --version # Verify installation
406-
407403
- name: Login to Azure
408-
shell: bash
409-
run: |
410-
az login --service-principal --username ${{ secrets.AZURE_CLIENT_ID }} --password ${{ secrets.AZURE_CLIENT_SECRET }} --tenant ${{ secrets.AZURE_TENANT_ID }}
411-
az account set --subscription "${{ secrets.AZURE_SUBSCRIPTION_ID }}"
404+
uses: azure/login@v2
405+
with:
406+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
407+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
408+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
412409

413410
- name: Delete Resource Groups
414411
if: env.RESOURCE_GROUP_NAME != ''

.github/workflows/codeql.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,18 @@ name: "CodeQL Advanced"
33
on:
44
push:
55
branches: [ "main", "dev", "demo" ]
6+
paths:
7+
- 'App/backend-api/**'
8+
- 'App/frontend-app/**'
9+
- 'App/kernel-memory/**'
10+
- '.github/workflows/codeql.yml'
611
pull_request:
712
branches: [ "main", "dev", "demo" ]
13+
paths:
14+
- 'App/backend-api/**'
15+
- 'App/frontend-app/**'
16+
- 'App/kernel-memory/**'
17+
- '.github/workflows/codeql.yml'
818
schedule:
919
- cron: '37 2 * * 5'
1020

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
name: Deployment orchestrator
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
azure_location:
7+
description: 'Azure Location For Deployment'
8+
required: false
9+
default: 'australiaeast'
10+
type: string
11+
resource_group_name:
12+
description: 'Resource Group Name (Optional)'
13+
required: false
14+
default: ''
15+
type: string
16+
waf_enabled:
17+
description: 'Enable WAF'
18+
required: false
19+
default: false
20+
type: boolean
21+
EXP:
22+
description: 'Enable EXP'
23+
required: false
24+
default: false
25+
type: boolean
26+
cleanup_resources:
27+
description: 'Cleanup Deployed Resources'
28+
required: false
29+
default: false
30+
type: boolean
31+
run_e2e_tests:
32+
description: 'Run End-to-End Tests'
33+
required: false
34+
default: 'GoldenPath-Testing'
35+
type: string
36+
AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID:
37+
description: 'Log Analytics Workspace ID (Optional)'
38+
required: false
39+
default: ''
40+
type: string
41+
existing_webapp_url:
42+
description: 'Existing Container WebApp URL (Skips Deployment)'
43+
required: false
44+
default: ''
45+
type: string
46+
trigger_type:
47+
description: 'Trigger type (workflow_dispatch, pull_request, schedule)'
48+
required: true
49+
type: string
50+
51+
env:
52+
AZURE_DEV_COLLECT_TELEMETRY: ${{ vars.AZURE_DEV_COLLECT_TELEMETRY }}
53+
54+
jobs:
55+
deploy:
56+
if: "!cancelled() && (inputs.trigger_type != 'workflow_dispatch' || inputs.existing_webapp_url == '' || inputs.existing_webapp_url == null)"
57+
uses: ./.github/workflows/job-deploy.yml
58+
with:
59+
trigger_type: ${{ inputs.trigger_type }}
60+
azure_location: ${{ inputs.azure_location }}
61+
resource_group_name: ${{ inputs.resource_group_name }}
62+
waf_enabled: ${{ inputs.waf_enabled }}
63+
EXP: ${{ inputs.EXP }}
64+
existing_webapp_url: ${{ inputs.existing_webapp_url }}
65+
AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID: ${{ inputs.AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID }}
66+
run_e2e_tests: ${{ inputs.run_e2e_tests }}
67+
cleanup_resources: ${{ inputs.cleanup_resources }}
68+
secrets: inherit
69+
70+
e2e-test:
71+
if: "!cancelled() && ((needs.deploy.outputs.WEB_APPURL != '' && needs.deploy.outputs.WEB_APPURL != null) || (inputs.existing_webapp_url != '' && inputs.existing_webapp_url != null)) && (inputs.trigger_type != 'workflow_dispatch' || (inputs.run_e2e_tests != 'None' && inputs.run_e2e_tests != '' && inputs.run_e2e_tests != null))"
72+
needs: [deploy]
73+
uses: ./.github/workflows/test-automation-v2.yml
74+
with:
75+
TEST_URL: ${{ needs.deploy.outputs.WEB_APPURL || inputs.existing_webapp_url }}
76+
TEST_SUITE: ${{ inputs.trigger_type == 'workflow_dispatch' && inputs.run_e2e_tests || 'GoldenPath-Testing' }}
77+
secrets: inherit
78+
79+
cleanup-deployment:
80+
if: "!cancelled() && needs.deploy.outputs.RESOURCE_GROUP_NAME != '' && inputs.existing_webapp_url == '' && (inputs.trigger_type != 'workflow_dispatch' || inputs.cleanup_resources)"
81+
needs: [deploy, e2e-test]
82+
uses: ./.github/workflows/job-cleanup-deployment.yml
83+
with:
84+
trigger_type: ${{ inputs.trigger_type }}
85+
cleanup_resources: ${{ inputs.cleanup_resources }}
86+
existing_webapp_url: ${{ inputs.existing_webapp_url }}
87+
RESOURCE_GROUP_NAME: ${{ needs.deploy.outputs.RESOURCE_GROUP_NAME }}
88+
AZURE_LOCATION: ${{ needs.deploy.outputs.AZURE_LOCATION }}
89+
AZURE_ENV_OPENAI_LOCATION: ${{ needs.deploy.outputs.AZURE_ENV_OPENAI_LOCATION }}
90+
ENV_NAME: ${{ needs.deploy.outputs.ENV_NAME }}
91+
IMAGE_TAG: ${{ needs.deploy.outputs.IMAGE_TAG }}
92+
secrets: inherit
93+
94+
send-notification:
95+
if: "!cancelled()"
96+
needs: [deploy, e2e-test, cleanup-deployment]
97+
uses: ./.github/workflows/job-send-notification.yml
98+
with:
99+
trigger_type: ${{ inputs.trigger_type }}
100+
waf_enabled: ${{ inputs.waf_enabled }}
101+
EXP: ${{ inputs.EXP }}
102+
run_e2e_tests: ${{ inputs.run_e2e_tests }}
103+
existing_webapp_url: ${{ inputs.existing_webapp_url }}
104+
deploy_result: ${{ needs.deploy.result }}
105+
e2e_test_result: ${{ needs.e2e-test.result }}
106+
WEB_APPURL: ${{ needs.deploy.outputs.WEB_APPURL || inputs.existing_webapp_url }}
107+
RESOURCE_GROUP_NAME: ${{ needs.deploy.outputs.RESOURCE_GROUP_NAME }}
108+
QUOTA_FAILED: ${{ needs.deploy.outputs.QUOTA_FAILED }}
109+
TEST_SUCCESS: ${{ needs.e2e-test.outputs.TEST_SUCCESS }}
110+
TEST_REPORT_URL: ${{ needs.e2e-test.outputs.TEST_REPORT_URL }}
111+
cleanup_result: ${{ needs.cleanup-deployment.result }}
112+
secrets: inherit

0 commit comments

Comments
 (0)