Skip to content

Commit 779c257

Browse files
Merge remote-tracking branch 'origin/main' into architeture_update
2 parents a9b68e1 + d75db01 commit 779c257

618 files changed

Lines changed: 102990 additions & 49035 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/devcontainer.json

Lines changed: 62 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,63 @@
1-
{
2-
"name": "Multi-Project DevContainer",
3-
"build": {
4-
"dockerfile": "Dockerfile"
5-
},
6-
"features": {
7-
"ghcr.io/devcontainers/features/docker-in-docker:2": {
8-
"version": "latest"
9-
},
10-
"ghcr.io/va-h/devcontainers-features/uv:1": {
11-
"shellautocompletion": true,
12-
"version": "latest"
13-
},
14-
"azure-cli": "latest"
15-
},
16-
"customizations": {
17-
"vscode": {
18-
"extensions": [
19-
"ms-python.python",
20-
"charliermarsh.ruff",
21-
"exiasr.hadolint",
22-
"kevinrose.vsc-python-indent",
23-
"mosapride.zenkaku",
24-
"ms-azuretools.vscode-docker",
25-
"ms-python.python",
26-
"njpwerner.autodocstring",
27-
"redhat.vscode-yaml",
28-
"shardulm94.trailing-spaces",
29-
"tamasfe.even-better-toml",
30-
"yzhang.markdown-all-in-one",
31-
"ms-azuretools.azure-dev",
32-
"charliermarsh.ruff",
33-
"exiasr.hadolint",
34-
"kevinrose.vsc-python-indent",
35-
"mosapride.zenkaku",
36-
"ms-azuretools.vscode-docker",
37-
"ms-python.python",
38-
"njpwerner.autodocstring",
39-
"redhat.vscode-yaml",
40-
"shardulm94.trailing-spaces",
41-
"tamasfe.even-better-toml",
42-
"yzhang.markdown-all-in-one",
43-
"ms-azuretools.azure-dev",
44-
"ms-vscode.azurecli"
45-
]
46-
}
47-
},
48-
"containerEnv": {
49-
"DISPLAY": "dummy",
50-
"PYTHONUNBUFFERED": "True",
51-
"UV_LINK_MODE": "copy",
52-
"UV_PROJECT_ENVIRONMENT": "/home/vscode/.venv"
53-
},
54-
"postCreateCommand": "sed -i 's/\r$//' ./.devcontainer/setupEnv.sh && sh ./.devcontainer/setupEnv.sh",
55-
"remoteEnv": {
56-
"PYTHONPATH": "/home/vscode/.venv/bin"
57-
}
1+
{
2+
"name": "Multi-Project DevContainer",
3+
"build": {
4+
"dockerfile": "Dockerfile"
5+
},
6+
"features": {
7+
"ghcr.io/devcontainers/features/docker-in-docker:2": {
8+
"version": "latest"
9+
},
10+
"ghcr.io/va-h/devcontainers-features/uv:1": {
11+
"shellautocompletion": true,
12+
"version": "latest"
13+
},
14+
"ghcr.io/devcontainers/features/azure-cli:1": {
15+
"installBicep": true,
16+
"version": "latest",
17+
"bicepVersion": "latest"
18+
},
19+
"azure-cli": "latest"
20+
},
21+
"customizations": {
22+
"vscode": {
23+
"extensions": [
24+
"ms-python.python",
25+
"charliermarsh.ruff",
26+
"exiasr.hadolint",
27+
"kevinrose.vsc-python-indent",
28+
"mosapride.zenkaku",
29+
"ms-azuretools.vscode-docker",
30+
"ms-python.python",
31+
"njpwerner.autodocstring",
32+
"redhat.vscode-yaml",
33+
"shardulm94.trailing-spaces",
34+
"tamasfe.even-better-toml",
35+
"yzhang.markdown-all-in-one",
36+
"ms-azuretools.azure-dev",
37+
"charliermarsh.ruff",
38+
"exiasr.hadolint",
39+
"kevinrose.vsc-python-indent",
40+
"mosapride.zenkaku",
41+
"ms-azuretools.vscode-docker",
42+
"ms-python.python",
43+
"njpwerner.autodocstring",
44+
"redhat.vscode-yaml",
45+
"shardulm94.trailing-spaces",
46+
"tamasfe.even-better-toml",
47+
"yzhang.markdown-all-in-one",
48+
"ms-azuretools.azure-dev",
49+
"ms-vscode.azurecli"
50+
]
51+
}
52+
},
53+
"containerEnv": {
54+
"DISPLAY": "dummy",
55+
"PYTHONUNBUFFERED": "True",
56+
"UV_LINK_MODE": "copy",
57+
"UV_PROJECT_ENVIRONMENT": "/home/vscode/.venv"
58+
},
59+
"postCreateCommand": "sed -i 's/\r$//' ./.devcontainer/setupEnv.sh && sh ./.devcontainer/setupEnv.sh",
60+
"remoteEnv": {
61+
"PYTHONPATH": "/home/vscode/.venv/bin"
62+
}
5863
}

.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: 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@v6
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/broken-links-checker.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ jobs:
1616

1717
steps:
1818
- name: Checkout Repo
19-
uses: actions/checkout@v5
19+
uses: actions/checkout@v6
2020
with:
2121
fetch-depth: 0
2222

2323
# For PR : Get only changed markdown files
2424
- name: Get changed markdown files (PR only)
2525
id: changed-markdown-files
2626
if: github.event_name == 'pull_request'
27-
uses: tj-actions/changed-files@24d32ffd492484c1d75e0c0b894501ddb9d30d62 # v46
27+
uses: tj-actions/changed-files@22103cc46bda19c2b464ffe86db46df6922fd323 # v46
2828
with:
2929
files: |
3030
**/*.md
@@ -34,7 +34,7 @@ jobs:
3434
- name: Check Broken Links in Changed Markdown Files
3535
id: lychee-check-pr
3636
if: github.event_name == 'pull_request' && steps.changed-markdown-files.outputs.any_changed == 'true'
37-
uses: lycheeverse/lychee-action@v2.6.1
37+
uses: lycheeverse/lychee-action@v2.8.0
3838
with:
3939
args: >
4040
--verbose --no-progress --exclude ^https?://
@@ -47,7 +47,7 @@ jobs:
4747
- name: Check Broken Links in All Markdown Files in Entire Repo (Manual Trigger)
4848
id: lychee-check-manual
4949
if: github.event_name == 'workflow_dispatch'
50-
uses: lycheeverse/lychee-action@v2.6.1
50+
uses: lycheeverse/lychee-action@v2.8.0
5151
with:
5252
args: >
5353
--verbose --no-progress --exclude ^https?://

0 commit comments

Comments
 (0)