Skip to content

Commit 384c724

Browse files
Merge pull request #303 from microsoft/psl-deploymentv2-pipeline-integration
ci: added Deployment v2 workflow
2 parents e5db458 + ecca2f5 commit 384c724

15 files changed

Lines changed: 1699 additions & 3 deletions

.github/workflows/deploy-linux.yml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: Deploy-Test-Cleanup (v2) Linux
2+
on:
3+
workflow_run:
4+
workflows: ["Build Docker and Optional Push"]
5+
types:
6+
- completed
7+
branches:
8+
- main
9+
- dev
10+
- demo
11+
workflow_dispatch:
12+
inputs:
13+
azure_location:
14+
description: 'Azure Location For Deployment'
15+
required: false
16+
default: 'australiaeast'
17+
type: choice
18+
options:
19+
- 'australiaeast'
20+
- 'centralus'
21+
- 'eastasia'
22+
- 'eastus2'
23+
- 'japaneast'
24+
- 'northeurope'
25+
- 'southeastasia'
26+
- 'uksouth'
27+
resource_group_name:
28+
description: 'Resource Group Name (Optional)'
29+
required: false
30+
default: ''
31+
type: string
32+
waf_enabled:
33+
description: 'Enable WAF'
34+
required: false
35+
default: false
36+
type: boolean
37+
EXP:
38+
description: 'Enable EXP'
39+
required: false
40+
default: false
41+
type: boolean
42+
build_docker_image:
43+
description: 'Build & Push Docker Image (Optional)'
44+
required: false
45+
default: false
46+
type: boolean
47+
cleanup_resources:
48+
description: 'Cleanup Deployed Resources'
49+
required: false
50+
default: false
51+
type: boolean
52+
run_e2e_tests:
53+
description: 'Run End-to-End Tests'
54+
required: false
55+
default: 'GoldenPath-Testing'
56+
type: choice
57+
options:
58+
- 'GoldenPath-Testing'
59+
- 'Smoke-Testing'
60+
- 'None'
61+
AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID:
62+
description: 'Log Analytics Workspace ID (Optional)'
63+
required: false
64+
default: ''
65+
type: string
66+
AZURE_EXISTING_AI_PROJECT_RESOURCE_ID:
67+
description: 'AI Project Resource ID (Optional)'
68+
required: false
69+
default: ''
70+
type: string
71+
existing_webapp_url:
72+
description: 'Existing Container WebApp URL (Skips Deployment)'
73+
required: false
74+
default: ''
75+
type: string
76+
77+
schedule:
78+
- cron: '0 5,17 * * *' # Runs at 5:00 AM and 5:00 PM GMT
79+
80+
jobs:
81+
Run:
82+
uses: ./.github/workflows/deploy-orchestrator.yml
83+
with:
84+
runner_os: ubuntu-latest
85+
azure_location: ${{ github.event.inputs.azure_location || 'australiaeast' }}
86+
resource_group_name: ${{ github.event.inputs.resource_group_name || '' }}
87+
waf_enabled: ${{ github.event.inputs.waf_enabled == 'true' }}
88+
EXP: ${{ github.event.inputs.EXP == 'true' }}
89+
build_docker_image: ${{ github.event.inputs.build_docker_image == 'true' }}
90+
cleanup_resources: ${{ github.event.inputs.cleanup_resources == 'true' }}
91+
run_e2e_tests: ${{ github.event.inputs.run_e2e_tests || 'GoldenPath-Testing' }}
92+
AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID: ${{ github.event.inputs.AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID || '' }}
93+
AZURE_EXISTING_AI_PROJECT_RESOURCE_ID: ${{ github.event.inputs.AZURE_EXISTING_AI_PROJECT_RESOURCE_ID || '' }}
94+
existing_webapp_url: ${{ github.event.inputs.existing_webapp_url || '' }}
95+
trigger_type: ${{ github.event_name }}
96+
secrets: inherit
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
name: Deployment orchestrator
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
runner_os:
7+
description: 'Runner OS (ubuntu-latest or windows-latest)'
8+
required: true
9+
type: string
10+
azure_location:
11+
description: 'Azure Location For Deployment'
12+
required: false
13+
default: 'australiaeast'
14+
type: string
15+
resource_group_name:
16+
description: 'Resource Group Name (Optional)'
17+
required: false
18+
default: ''
19+
type: string
20+
waf_enabled:
21+
description: 'Enable WAF'
22+
required: false
23+
default: false
24+
type: boolean
25+
EXP:
26+
description: 'Enable EXP'
27+
required: false
28+
default: false
29+
type: boolean
30+
build_docker_image:
31+
description: 'Build And Push Docker Image (Optional)'
32+
required: false
33+
default: false
34+
type: boolean
35+
cleanup_resources:
36+
description: 'Cleanup Deployed Resources'
37+
required: false
38+
default: false
39+
type: boolean
40+
run_e2e_tests:
41+
description: 'Run End-to-End Tests'
42+
required: false
43+
default: 'GoldenPath-Testing'
44+
type: string
45+
AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID:
46+
description: 'Log Analytics Workspace ID (Optional)'
47+
required: false
48+
default: ''
49+
type: string
50+
AZURE_EXISTING_AI_PROJECT_RESOURCE_ID:
51+
description: 'AI Project Resource ID (Optional)'
52+
required: false
53+
default: ''
54+
type: string
55+
existing_webapp_url:
56+
description: 'Existing Container WebApp URL (Skips Deployment)'
57+
required: false
58+
default: ''
59+
type: string
60+
trigger_type:
61+
description: 'Trigger type (workflow_dispatch, pull_request, schedule)'
62+
required: true
63+
type: string
64+
65+
env:
66+
AZURE_DEV_COLLECT_TELEMETRY: ${{ vars.AZURE_DEV_COLLECT_TELEMETRY }}
67+
68+
jobs:
69+
docker-build:
70+
uses: ./.github/workflows/job-docker-build.yml
71+
with:
72+
trigger_type: ${{ inputs.trigger_type }}
73+
build_docker_image: ${{ inputs.build_docker_image }}
74+
secrets: inherit
75+
76+
deploy:
77+
if: "!cancelled() && (inputs.trigger_type != 'workflow_dispatch' || inputs.existing_webapp_url == '' || inputs.existing_webapp_url == null)"
78+
needs: docker-build
79+
uses: ./.github/workflows/job-deploy.yml
80+
with:
81+
trigger_type: ${{ inputs.trigger_type }}
82+
runner_os: ${{ inputs.runner_os }}
83+
azure_location: ${{ inputs.azure_location }}
84+
resource_group_name: ${{ inputs.resource_group_name }}
85+
waf_enabled: ${{ inputs.waf_enabled }}
86+
EXP: ${{ inputs.EXP }}
87+
build_docker_image: ${{ inputs.build_docker_image }}
88+
existing_webapp_url: ${{ inputs.existing_webapp_url }}
89+
AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID: ${{ inputs.AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID }}
90+
AZURE_EXISTING_AI_PROJECT_RESOURCE_ID: ${{ inputs.AZURE_EXISTING_AI_PROJECT_RESOURCE_ID }}
91+
docker_image_tag: ${{ needs.docker-build.outputs.IMAGE_TAG }}
92+
run_e2e_tests: ${{ inputs.run_e2e_tests }}
93+
cleanup_resources: ${{ inputs.cleanup_resources }}
94+
secrets: inherit
95+
96+
e2e-test:
97+
if: "!cancelled() && ((needs.deploy.result == 'success' && needs.deploy.outputs.CONTAINER_WEB_APPURL != '') || (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))"
98+
needs: [docker-build, deploy]
99+
uses: ./.github/workflows/test-automation-v2.yml
100+
with:
101+
TEST_URL: ${{ needs.deploy.outputs.CONTAINER_WEB_APPURL || inputs.existing_webapp_url }}
102+
TEST_SUITE: ${{ inputs.trigger_type == 'workflow_dispatch' && inputs.run_e2e_tests || 'GoldenPath-Testing' }}
103+
secrets: inherit
104+
105+
send-notification:
106+
if: "!cancelled()"
107+
needs: [docker-build, deploy, e2e-test]
108+
uses: ./.github/workflows/job-send-notification.yml
109+
with:
110+
trigger_type: ${{ inputs.trigger_type }}
111+
waf_enabled: ${{ inputs.waf_enabled }}
112+
EXP: ${{ inputs.EXP }}
113+
run_e2e_tests: ${{ inputs.run_e2e_tests }}
114+
existing_webapp_url: ${{ inputs.existing_webapp_url }}
115+
deploy_result: ${{ needs.deploy.result }}
116+
e2e_test_result: ${{ needs.e2e-test.result }}
117+
CONTAINER_WEB_APPURL: ${{ needs.deploy.outputs.CONTAINER_WEB_APPURL }}
118+
RESOURCE_GROUP_NAME: ${{ needs.deploy.outputs.RESOURCE_GROUP_NAME }}
119+
QUOTA_FAILED: ${{ needs.deploy.outputs.QUOTA_FAILED }}
120+
TEST_SUCCESS: ${{ needs.e2e-test.outputs.TEST_SUCCESS }}
121+
TEST_REPORT_URL: ${{ needs.e2e-test.outputs.TEST_REPORT_URL }}
122+
secrets: inherit
123+
124+
cleanup-deployment:
125+
if: "!cancelled() && needs.deploy.result == 'success' && needs.deploy.outputs.RESOURCE_GROUP_NAME != '' && inputs.existing_webapp_url == '' && (inputs.trigger_type != 'workflow_dispatch' || inputs.cleanup_resources)"
126+
needs: [docker-build, deploy, e2e-test]
127+
uses: ./.github/workflows/job-cleanup-deployment.yml
128+
with:
129+
runner_os: ${{ inputs.runner_os }}
130+
trigger_type: ${{ inputs.trigger_type }}
131+
cleanup_resources: ${{ inputs.cleanup_resources }}
132+
existing_webapp_url: ${{ inputs.existing_webapp_url }}
133+
RESOURCE_GROUP_NAME: ${{ needs.deploy.outputs.RESOURCE_GROUP_NAME }}
134+
AZURE_LOCATION: ${{ needs.deploy.outputs.AZURE_LOCATION }}
135+
AZURE_ENV_OPENAI_LOCATION: ${{ needs.deploy.outputs.AZURE_ENV_OPENAI_LOCATION }}
136+
ENV_NAME: ${{ needs.deploy.outputs.ENV_NAME }}
137+
IMAGE_TAG: ${{ needs.deploy.outputs.IMAGE_TAG }}
138+
secrets: inherit
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: Deploy-Test-Cleanup (v2) Windows
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
azure_location:
6+
description: 'Azure Location For Deployment'
7+
required: false
8+
default: 'australiaeast'
9+
type: choice
10+
options:
11+
- 'australiaeast'
12+
- 'centralus'
13+
- 'eastasia'
14+
- 'eastus2'
15+
- 'japaneast'
16+
- 'northeurope'
17+
- 'southeastasia'
18+
- 'uksouth'
19+
resource_group_name:
20+
description: 'Resource Group Name (Optional)'
21+
required: false
22+
default: ''
23+
type: string
24+
25+
waf_enabled:
26+
description: 'Enable WAF'
27+
required: false
28+
default: false
29+
type: boolean
30+
EXP:
31+
description: 'Enable EXP'
32+
required: false
33+
default: false
34+
type: boolean
35+
build_docker_image:
36+
description: 'Build & Push Docker Image (Optional)'
37+
required: false
38+
default: false
39+
type: boolean
40+
41+
cleanup_resources:
42+
description: 'Cleanup Deployed Resources'
43+
required: false
44+
default: false
45+
type: boolean
46+
47+
run_e2e_tests:
48+
description: 'Run End-to-End Tests'
49+
required: false
50+
default: 'GoldenPath-Testing'
51+
type: choice
52+
options:
53+
- 'GoldenPath-Testing'
54+
- 'Smoke-Testing'
55+
- 'None'
56+
57+
AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID:
58+
description: 'Log Analytics Workspace ID (Optional)'
59+
required: false
60+
default: ''
61+
type: string
62+
AZURE_EXISTING_AI_PROJECT_RESOURCE_ID:
63+
description: 'AI Project Resource ID (Optional)'
64+
required: false
65+
default: ''
66+
type: string
67+
existing_webapp_url:
68+
description: 'Existing Container WebApp URL (Skips Deployment)'
69+
required: false
70+
default: ''
71+
type: string
72+
73+
# schedule:
74+
# - cron: '0 5,17 * * *' # Runs at 5:00 AM and 5:00 PM GMT
75+
76+
jobs:
77+
Run:
78+
uses: ./.github/workflows/deploy-orchestrator.yml
79+
with:
80+
runner_os: windows-latest
81+
azure_location: ${{ github.event.inputs.azure_location || 'australiaeast' }}
82+
resource_group_name: ${{ github.event.inputs.resource_group_name || '' }}
83+
waf_enabled: ${{ github.event.inputs.waf_enabled == 'true' }}
84+
EXP: ${{ github.event.inputs.EXP == 'true' }}
85+
build_docker_image: ${{ github.event.inputs.build_docker_image == 'true' }}
86+
cleanup_resources: ${{ github.event.inputs.cleanup_resources == 'true' }}
87+
run_e2e_tests: ${{ github.event.inputs.run_e2e_tests || 'GoldenPath-Testing' }}
88+
AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID: ${{ github.event.inputs.AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID || '' }}
89+
AZURE_EXISTING_AI_PROJECT_RESOURCE_ID: ${{ github.event.inputs.AZURE_EXISTING_AI_PROJECT_RESOURCE_ID || '' }}
90+
existing_webapp_url: ${{ github.event.inputs.existing_webapp_url || '' }}
91+
trigger_type: ${{ github.event_name }}
92+
secrets: inherit

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ jobs:
142142
azureAiServiceLocation='${{ env.AZURE_LOCATION }}' \
143143
imageVersion="${IMAGE_TAG}" \
144144
createdBy="Pipeline" \
145-
tags="{'SecurityControl':'Ignore','Purpose':'Deploying and Cleaning Up Resources for Validation','CreatedDate':'$current_date'}"
145+
tags="{'Purpose':'Deploying and Cleaning Up Resources for Validation','CreatedDate':'$current_date'}"
146146
147147
- name: Assign Contributor role to Service Principal
148148
if: always()

0 commit comments

Comments
 (0)