Skip to content

Commit f2b370e

Browse files
Merge remote-tracking branch 'origin/dev' into psl-unit-test-cps-v2
2 parents c5e0434 + 4d78576 commit f2b370e

169 files changed

Lines changed: 9803 additions & 4795 deletions

File tree

Some content is hidden

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

.devcontainer/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ FROM ghcr.io/astral-sh/uv:$UV_VERSION AS uv
77
# Use Debian-based VS Code Dev Container as base
88
FROM mcr.microsoft.com/vscode/devcontainers/base:$DEBIAN_VERSION
99

10+
ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0
11+
1012
# Install dependencies and Node.js 20+ from NodeSource
1113
RUN apt-get update \
1214
&& apt-get install -y --no-install-recommends \
@@ -22,7 +24,7 @@ RUN apt-get update \
2224
COPY --from=uv --chown=vscode: /uv /uvx /bin/
2325

2426
# Install global NPM packages
25-
RUN npm install -g tslint-to-eslint-config typescript yarn react-app-rewired
27+
RUN npm install -g tslint-to-eslint-config typescript react-app-rewired pnpm@10.28.2
2628

2729
# Set default shell
2830
SHELL ["/bin/bash", "-c"]

.devcontainer/setupEnv.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ cd ../../
1818

1919
echo "Installing dependencies for ContentProcessorWeb..."
2020
cd ./src/ContentProcessorWeb
21-
yarn install
21+
export HOME="${HOME:-/home/vscode}"
22+
pnpm install --store-dir "$HOME/.local/share/pnpm/store"
2223

2324
cd ../../
2425

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: AZD Template Validation
2+
on:
3+
schedule:
4+
- cron: '30 1 * * 4' # Every Thursday at 7:00 AM IST (1:30 AM UTC)
5+
workflow_dispatch:
6+
7+
permissions:
8+
contents: read
9+
id-token: write
10+
pull-requests: write
11+
12+
jobs:
13+
template_validation:
14+
runs-on: ubuntu-latest
15+
name: azd template validation
16+
environment: production
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Set timestamp
21+
run: echo "HHMM=$(date -u +'%H%M')" >> $GITHUB_ENV
22+
23+
- uses: microsoft/template-validation-action@v0.4.3
24+
with:
25+
validateAzd: ${{ vars.TEMPLATE_VALIDATE_AZD }}
26+
validateTests: ${{ vars.TEMPLATE_VALIDATE_TESTS }}
27+
useDevContainer: ${{ vars.TEMPLATE_USE_DEV_CONTAINER }}
28+
id: validation
29+
env:
30+
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
31+
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
32+
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
33+
AZURE_ENV_NAME: azd-${{ vars.AZURE_ENV_NAME }}-${{ env.HHMM }}
34+
AZURE_LOCATION: ${{ vars.AZURE_LOCATION }}
35+
AZURE_ENV_AI_SERVICE_LOCATION: ${{ vars.AZURE_LOCATION }}
36+
AZURE_ENV_MODEL_CAPACITY: 1 # keep low to avoid potential quota issues
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
39+
- name: print result
40+
run: cat ${{ steps.validation.outputs.resultFile }}

.github/workflows/azure-dev.yaml

Lines changed: 46 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,57 @@
1-
name: Azure Template Validation
1+
name: Azure Dev Deploy
2+
23
on:
34
workflow_dispatch:
45

56
permissions:
67
contents: read
78
id-token: write
8-
pull-requests: write
99

1010
jobs:
11-
template_validation_job:
12-
environment: production
11+
deploy:
1312
runs-on: ubuntu-latest
14-
name: Template validation
15-
13+
environment: production
14+
env:
15+
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
16+
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
17+
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
18+
AZURE_ENV_NAME: ${{ vars.AZURE_ENV_NAME }}
19+
AZURE_LOCATION: ${{ vars.AZURE_LOCATION }}
20+
AZURE_ENV_MODEL_CAPACITY: 1 # keep low to avoid potential quota issues
21+
AZURE_DEV_COLLECT_TELEMETRY: ${{ vars.AZURE_DEV_COLLECT_TELEMETRY }}
1622
steps:
17-
# Step 1: Checkout the code from your repository
18-
- name: Checkout code
19-
uses: actions/checkout@v5
20-
21-
# Step 2: Validate the Azure template using microsoft/template-validation-action
22-
- name: Validate Azure Template
23-
uses: microsoft/template-validation-action@v0.4.3
24-
id: validation
23+
- name: Checkout Code
24+
uses: actions/checkout@v4
25+
26+
- name: Set timestamp and env name
27+
run: |
28+
HHMM=$(date -u +'%H%M')
29+
echo "AZURE_ENV_NAME=azd-${{ vars.AZURE_ENV_NAME }}-${HHMM}" >> $GITHUB_ENV
30+
31+
- name: Install azd
32+
uses: Azure/setup-azd@v2
33+
34+
- name: Login to Azure
35+
uses: azure/login@v2
2536
with:
26-
useDevContainer: false
27-
env:
28-
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
29-
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
30-
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
31-
AZURE_ENV_NAME: ${{ secrets.AZURE_ENV_NAME }}
32-
AZURE_LOCATION: ${{ secrets.AZURE_LOCATION }}
33-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34-
AZURE_DEV_COLLECT_TELEMETRY: ${{ vars.AZURE_DEV_COLLECT_TELEMETRY }}
35-
36-
# Step 3: Print the result of the validation
37-
- name: Print result
38-
run: cat ${{ steps.validation.outputs.resultFile }}
37+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
38+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
39+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
40+
41+
- name: Login to AZD
42+
shell: bash
43+
run: |
44+
azd auth login \
45+
--client-id "$AZURE_CLIENT_ID" \
46+
--federated-credential-provider "github" \
47+
--tenant-id "$AZURE_TENANT_ID"
48+
49+
- name: Provision and Deploy
50+
shell: bash
51+
run: |
52+
if ! azd env select "$AZURE_ENV_NAME"; then
53+
azd env new "$AZURE_ENV_NAME" --subscription "$AZURE_SUBSCRIPTION_ID" --location "$AZURE_LOCATION" --no-prompt
54+
fi
55+
azd config set defaults.subscription "$AZURE_SUBSCRIPTION_ID"
56+
azd env set AZURE_ENV_AI_SERVICE_LOCATION="$AZURE_LOCATION"
57+
azd up --no-prompt

.github/workflows/build-docker-image.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ on:
4848
permissions:
4949
contents: read
5050
actions: read
51+
id-token: write
5152

5253
jobs:
5354
build-and-push:
5455
runs-on: ubuntu-latest
56+
environment: production
5557
env:
5658
ACR_LOGIN_SERVER: ${{ secrets.ACR_LOGIN_SERVER }}
57-
ACR_USERNAME: ${{ secrets.ACR_USERNAME }}
58-
ACR_PASSWORD: ${{ secrets.ACR_PASSWORD }}
5959

6060
steps:
6161
- name: Checkout repository
@@ -68,13 +68,17 @@ jobs:
6868
id: date
6969
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
7070

71-
- name: Log in to Azure Container Registry
71+
- name: Login to Azure
7272
if: ${{ github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'demo' || github.ref_name == 'hotfix' || github.ref_name == 'dependabotchanges' }}
73-
uses: azure/docker-login@v2
73+
uses: azure/login@v2
7474
with:
75-
login-server: ${{ env.ACR_LOGIN_SERVER }}
76-
username: ${{ env.ACR_USERNAME }}
77-
password: ${{ env.ACR_PASSWORD }}
75+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
76+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
77+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
78+
79+
- name: Log in to Azure Container Registry
80+
if: ${{ github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'demo' || github.ref_name == 'hotfix' || github.ref_name == 'dependabotchanges' }}
81+
run: az acr login --name ${{ env.ACR_LOGIN_SERVER }}
7882

7983
- name: Get registry
8084
id: registry
@@ -97,7 +101,6 @@ jobs:
97101
BASE_TAG="hotfix"
98102
elif [[ "$BRANCH" == "dependabotchanges" ]]; then
99103
BASE_TAG="dependabotchanges"
100-
101104
else
102105
BASE_TAG="pullrequest-ignore"
103106
fi

.github/workflows/deploy-orchestrator.yml

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ on:
4242
required: false
4343
default: 'GoldenPath-Testing'
4444
type: string
45-
AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID:
46-
description: 'Log Analytics Workspace ID (Optional)'
45+
AZURE_ENV_EXISTING_LOG_ANALYTICS_WORKSPACE_RID:
46+
description: 'Log Analytics Workspace Resource ID (Optional)'
4747
required: false
4848
default: ''
4949
type: string
@@ -64,9 +64,7 @@ on:
6464

6565
env:
6666
AZURE_DEV_COLLECT_TELEMETRY: ${{ vars.AZURE_DEV_COLLECT_TELEMETRY }}
67-
permissions:
68-
contents: read
69-
actions: read
67+
7068
jobs:
7169
docker-build:
7270
uses: ./.github/workflows/job-docker-build.yml
@@ -88,7 +86,7 @@ jobs:
8886
EXP: ${{ inputs.EXP }}
8987
build_docker_image: ${{ inputs.build_docker_image }}
9088
existing_webapp_url: ${{ inputs.existing_webapp_url }}
91-
AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID: ${{ inputs.AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID }}
89+
AZURE_ENV_EXISTING_LOG_ANALYTICS_WORKSPACE_RID: ${{ inputs.AZURE_ENV_EXISTING_LOG_ANALYTICS_WORKSPACE_RID }}
9290
AZURE_EXISTING_AI_PROJECT_RESOURCE_ID: ${{ inputs.AZURE_EXISTING_AI_PROJECT_RESOURCE_ID }}
9391
docker_image_tag: ${{ needs.docker-build.outputs.IMAGE_TAG }}
9492
run_e2e_tests: ${{ inputs.run_e2e_tests }}
@@ -104,9 +102,25 @@ jobs:
104102
TEST_SUITE: ${{ inputs.trigger_type == 'workflow_dispatch' && inputs.run_e2e_tests || 'GoldenPath-Testing' }}
105103
secrets: inherit
106104

105+
cleanup-deployment:
106+
if: "!cancelled() && needs.deploy.result == 'success' && needs.deploy.outputs.RESOURCE_GROUP_NAME != '' && inputs.existing_webapp_url == '' && (inputs.trigger_type != 'workflow_dispatch' || inputs.cleanup_resources)"
107+
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
120+
107121
send-notification:
108122
if: "!cancelled()"
109-
needs: [docker-build, deploy, e2e-test]
123+
needs: [docker-build, deploy, e2e-test, cleanup-deployment]
110124
uses: ./.github/workflows/job-send-notification.yml
111125
with:
112126
trigger_type: ${{ inputs.trigger_type }}
@@ -116,25 +130,10 @@ jobs:
116130
existing_webapp_url: ${{ inputs.existing_webapp_url }}
117131
deploy_result: ${{ needs.deploy.result }}
118132
e2e_test_result: ${{ needs.e2e-test.result }}
133+
cleanup_result: ${{ needs.cleanup-deployment.result }}
119134
CONTAINER_WEB_APPURL: ${{ needs.deploy.outputs.CONTAINER_WEB_APPURL }}
120135
RESOURCE_GROUP_NAME: ${{ needs.deploy.outputs.RESOURCE_GROUP_NAME }}
121136
QUOTA_FAILED: ${{ needs.deploy.outputs.QUOTA_FAILED }}
122137
TEST_SUCCESS: ${{ needs.e2e-test.outputs.TEST_SUCCESS }}
123138
TEST_REPORT_URL: ${{ needs.e2e-test.outputs.TEST_REPORT_URL }}
124139
secrets: inherit
125-
126-
cleanup-deployment:
127-
if: "!cancelled() && needs.deploy.result == 'success' && needs.deploy.outputs.RESOURCE_GROUP_NAME != '' && inputs.existing_webapp_url == '' && (inputs.trigger_type != 'workflow_dispatch' || inputs.cleanup_resources)"
128-
needs: [docker-build, deploy, e2e-test]
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 }}
140-
secrets: inherit

0 commit comments

Comments
 (0)