Skip to content

Commit c5aede2

Browse files
Merge remote-tracking branch 'origin/dev' into dependabotchanges
2 parents 8a56071 + 201acae commit c5aede2

501 files changed

Lines changed: 90983 additions & 48391 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.

.coverage

-52 KB
Binary file not shown.

.devcontainer/Dockerfile

Lines changed: 5 additions & 2 deletions
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 \
@@ -15,13 +17,14 @@ RUN apt-get update \
1517
&& apt-get install -y nodejs \
1618
&& apt-get clean \
1719
&& rm -rf /var/lib/apt/lists/* \
18-
&& curl -fsSL https://aka.ms/install-azd.sh | bash
20+
&& curl -fsSL https://aka.ms/install-azd.sh | bash \
21+
&& ln -sf /usr/bin/python3 /usr/bin/python
1922

2023
# Copy UV binaries
2124
COPY --from=uv --chown=vscode: /uv /uvx /bin/
2225

2326
# Install global NPM packages
24-
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
2528

2629
# Set default shell
2730
SHELL ["/bin/bash", "-c"]

.devcontainer/setupEnv.sh

Lines changed: 3 additions & 2 deletions
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

@@ -27,6 +28,6 @@ sed -i 's/\r$//' infra/scripts/post_deployment.sh
2728
sudo chmod +x infra/scripts/docker-build.sh
2829
sudo chmod +x infra/scripts/post_deployment.sh
2930
sudo chmod +x src/ContentProcessorAPI/samples/upload_files.sh
30-
sudo chmod +x src/ContentProcessorAPI/samples/schemas/register_schema.sh
31+
# register_schema.py is cross-platform and does not need chmod
3132

3233
echo "Setup complete! 🎉"
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: 44 additions & 25 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
23+
- name: Checkout Code
1924
uses: actions/checkout@v6
2025

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.4
24-
id: validation
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: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,17 @@ on:
4545
- '.github/workflows/build-docker-image.yml'
4646
workflow_dispatch:
4747

48+
permissions:
49+
contents: read
50+
actions: read
51+
id-token: write
52+
4853
jobs:
4954
build-and-push:
5055
runs-on: ubuntu-latest
56+
environment: production
5157
env:
5258
ACR_LOGIN_SERVER: ${{ secrets.ACR_LOGIN_SERVER }}
53-
ACR_USERNAME: ${{ secrets.ACR_USERNAME }}
54-
ACR_PASSWORD: ${{ secrets.ACR_PASSWORD }}
5559

5660
steps:
5761
- name: Checkout repository
@@ -64,13 +68,17 @@ jobs:
6468
id: date
6569
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
6670

67-
- name: Log in to Azure Container Registry
71+
- name: Login to Azure
6872
if: ${{ github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'demo' || github.ref_name == 'hotfix' || github.ref_name == 'dependabotchanges' }}
69-
uses: azure/docker-login@v2
73+
uses: azure/login@v2
7074
with:
71-
login-server: ${{ env.ACR_LOGIN_SERVER }}
72-
username: ${{ env.ACR_USERNAME }}
73-
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 }}
7482

7583
- name: Get registry
7684
id: registry
@@ -84,7 +92,7 @@ jobs:
8492
DATE="${{ steps.date.outputs.date }}"
8593
GITHUB_RUN_NUMBER="${{ github.run_number }}"
8694
if [[ "$BRANCH" == "main" ]]; then
87-
BASE_TAG="latest"
95+
BASE_TAG="latest_v2"
8896
elif [[ "$BRANCH" == "dev" ]]; then
8997
BASE_TAG="dev"
9098
elif [[ "$BRANCH" == "demo" ]]; then
@@ -93,7 +101,6 @@ jobs:
93101
BASE_TAG="hotfix"
94102
elif [[ "$BRANCH" == "dependabotchanges" ]]; then
95103
BASE_TAG="dependabotchanges"
96-
97104
else
98105
BASE_TAG="pullrequest-ignore"
99106
fi
@@ -131,3 +138,13 @@ jobs:
131138
tags: |
132139
${{ steps.registry.outputs.ext_registry }}/contentprocessorweb:${{ env.BASE_TAG }}
133140
${{ steps.registry.outputs.ext_registry }}/contentprocessorweb:${{ env.DATE_TAG }}
141+
142+
- name: Build and Push ContentProcessorWorkflow Docker image
143+
uses: docker/build-push-action@v6
144+
with:
145+
context: ./src/ContentProcessorWorkflow
146+
file: ./src/ContentProcessorWorkflow/Dockerfile
147+
push: ${{ github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'demo' || github.ref_name == 'hotfix' || github.ref_name == 'dependabotchanges' }}
148+
tags: |
149+
${{ steps.registry.outputs.ext_registry }}/contentprocessorworkflow:${{ env.BASE_TAG }}
150+
${{ steps.registry.outputs.ext_registry }}/contentprocessorworkflow:${{ env.DATE_TAG }}

.github/workflows/deploy-linux.yml

Lines changed: 0 additions & 112 deletions
This file was deleted.

0 commit comments

Comments
 (0)