Skip to content

Commit e622f5f

Browse files
Merge pull request #153 from microsoft/dev
fix: Merging dev changes and packages upgrade into main branch
2 parents 122b7b3 + 474a9a5 commit e622f5f

File tree

18 files changed

+4466
-3097
lines changed

18 files changed

+4466
-3097
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# Each line is a file pattern followed by one or more owners.
33

44
# These owners will be the default owners for everything in the repo.
5-
* @Avijit-Microsoft @Roopan-Microsoft @Prajwal-Microsoft @dongbumlee
5+
* @Avijit-Microsoft @Roopan-Microsoft @Prajwal-Microsoft @dongbumlee

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ Verify that the following are valid
3434
* ...
3535

3636
## Other Information
37-
<!-- Add any other helpful information that may be needed here. -->
37+
<!-- Add any other helpful information that may be needed here. -->

.github/workflows/CI.yml

Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
name: Deploy Resources
2+
3+
on:
4+
push:
5+
branches:
6+
- main # Adjust this to the branch you want to trigger the deployment on
7+
- dev
8+
- demo
9+
schedule:
10+
- cron: '0 6,18 * * *' # Runs at 6:00 AM and 6:00 PM GMT
11+
12+
13+
jobs:
14+
deploy:
15+
runs-on: windows-latest # Use a Windows runner for PowerShell scripts
16+
17+
steps:
18+
- name: Checkout Code
19+
uses: actions/checkout@v3 # Checks out your repository
20+
# Install Azure CLI
21+
- name: Install Azure CLI
22+
shell: pwsh
23+
run: |
24+
Invoke-WebRequest -Uri https://aka.ms/installazurecliwindows -OutFile AzureCLI.msi
25+
Start-Process msiexec.exe -ArgumentList '/I AzureCLI.msi /quiet' -Wait
26+
27+
# Install kubectl (Windows method)
28+
- name: Install kubectl
29+
shell: pwsh
30+
run: |
31+
Invoke-WebRequest -Uri https://dl.k8s.io/release/v1.28.0/bin/windows/amd64/kubectl.exe -OutFile kubectl.exe
32+
Move-Item -Path ./kubectl.exe -Destination "C:\kubectl.exe"
33+
[Environment]::SetEnvironmentVariable('PATH', $env:PATH + ';C:\', [System.EnvironmentVariableTarget]::Machine)
34+
35+
36+
# Install Helm (Windows method)
37+
- name: Install Helm
38+
shell: pwsh
39+
run: |
40+
Invoke-WebRequest -Uri https://get.helm.sh/helm-v3.13.0-windows-amd64.zip -OutFile helm.zip
41+
Expand-Archive helm.zip -DestinationPath helm
42+
Move-Item -Path ./helm/windows-amd64/helm.exe -Destination "C:\helm.exe"
43+
[Environment]::SetEnvironmentVariable('PATH', $env:PATH + ';C:\', [System.EnvironmentVariableTarget]::Machine)
44+
45+
46+
- name: Set Docker environment variables
47+
run: echo "DOCKER_BUILDKIT=0" >> $GITHUB_ENV
48+
49+
# Set up Docker
50+
- name: Set up Docker
51+
uses: docker/setup-buildx-action@v2
52+
with:
53+
driver: docker
54+
55+
- name: Setup PowerShell
56+
shell: pwsh
57+
run: |
58+
$PSVersionTable.PSVersion
59+
60+
- name: Run Deployment Script with Input
61+
shell: pwsh
62+
run: |
63+
cd Deployment
64+
$input = @"
65+
${{ secrets.AZURE_SUBSCRIPTION_ID }}
66+
CanadaCentral
67+
WestUS3
68+
${{ secrets.EMAIL }}
69+
yes
70+
"@
71+
$input | pwsh ./resourcedeployment.ps1
72+
echo "Resource Group Name is ${{ env.rg_name }}"
73+
echo "Kubernetes resource group are ${{ env.krg_name }}"
74+
env:
75+
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
76+
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
77+
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
78+
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
79+
- name: Cleanup Resource Group
80+
if: always() # Ensures this step runs even if the deployment fails
81+
shell: pwsh
82+
run: |
83+
az login --service-principal --username ${{ secrets.AZURE_CLIENT_ID }} --password ${{ secrets.AZURE_CLIENT_SECRET }} --tenant ${{ secrets.AZURE_TENANT_ID }}
84+
az group delete --name ${{ env.rg_name }} --yes --no-wait
85+
az group delete --name ${{ env.krg_name }} --yes --no-wait
86+
env:
87+
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
88+
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
89+
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
90+
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
91+
92+
- name: Wait for Resource Deletion to Complete
93+
shell: pwsh
94+
run: |
95+
$retries = 0
96+
$maxRetries = 3
97+
$sleepIntervals = @(700, 200, 200)
98+
99+
while ($retries -lt $maxRetries) {
100+
$rgStatus = az group exists --name ${{ env.rg_name }}
101+
$krgStatus = az group exists --name ${{ env.krg_name }}
102+
103+
104+
# if (-not $rgStatus -and -not $krgStatus) {
105+
# Write-Host "Both resource groups deleted successfully."
106+
# break
107+
# }
108+
if ($rgStatus -eq "false" -and $krgStatus -eq "false") {
109+
Write-Host "Both resource groups deleted successfully."
110+
break
111+
}
112+
113+
$retries++
114+
if ($retries -eq $maxRetries) {
115+
Write-Host "Resource groups deletion not confirmed after $maxRetries attempts. Exiting."
116+
exit 1
117+
}
118+
119+
Write-Host "Resource groups still exist. Retrying in $($sleepIntervals[$retries - 1]) seconds..."
120+
Start-Sleep -Seconds $sleepIntervals[$retries - 1]
121+
}
122+
123+
- name: Purging the Resources
124+
if: success()
125+
shell: pwsh
126+
run: |
127+
# Set variables using GitHub Actions environment values
128+
$solutionPrefix = "${{ env.SOLUTION_PREFIX }}"
129+
$subscriptionId = "${{ secrets.AZURE_SUBSCRIPTION_ID }}"
130+
$resourceGroupName = "${{ env.rg_name }}"
131+
132+
$openai_name = "openaiservice-$solutionPrefix"
133+
$cognitiveservice_name = "cognitiveservice-$solutionPrefix"
134+
135+
# Debug: Print resource names
136+
Write-Host "Purging OpenAI resource: $openai_name"
137+
Write-Host "Purging CognitiveService Account: $cognitiveservice_name"
138+
139+
# Construct resource IDs
140+
$openaiResourceId = "/subscriptions/$subscriptionId/providers/Microsoft.CognitiveServices/locations/westus3/resourceGroups/$resourceGroupName/deletedAccounts/$openai_name"
141+
$cognitiveResourceId = "/subscriptions/$subscriptionId/providers/Microsoft.CognitiveServices/locations/eastus/resourceGroups/$resourceGroupName/deletedAccounts/$cognitiveservice_name"
142+
143+
# Debug: Print constructed resource IDs
144+
Write-Host "Command to purge OpenAI resource: az resource delete --ids `"$openaiResourceId`" --verbose"
145+
Write-Host "Command to purge CognitiveService Account: az resource delete --ids `"$cognitiveResourceId`" --verbose"
146+
# Purge OpenAI Resource
147+
az resource delete --ids $openaiResourceId --verbose
148+
if (-not $?) {
149+
Write-Host "Failed to purge OpenAI resource: $openaiResourceId"
150+
}
151+
152+
# Purge CognitiveService Account
153+
154+
155+
az resource delete --ids $cognitiveResourceId --verbose
156+
if (-not $?) {
157+
Write-Host "Failed to purge CognitiveService Account."
158+
}
159+
160+
161+
- name: Send Notification on Failure
162+
if: failure()
163+
shell: pwsh
164+
run: |
165+
# Define the RUN_URL variable
166+
$RUN_URL = "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
167+
168+
# Construct the email body using a Here-String
169+
$EMAIL_BODY = @"
170+
{
171+
"body": "<p>Dear Team,</p><p>The Document Knowledge Mining Automation process encountered an issue.</p><p><strong>Build URL:</strong> <a href='$RUN_URL'>$RUN_URL</a></p><p>Please investigate promptly.</p><p>Best regards,<br>Your Automation Team</p>"
172+
}
173+
"@
174+
175+
# Send the notification with error handling
176+
try {
177+
curl -X POST "${{ secrets.LOGIC_APP_URL }}" `
178+
-H "Content-Type: application/json" `
179+
-d "$EMAIL_BODY"
180+
} catch {
181+
Write-Output "Failed to send notification."
182+
}
183+

App/backend-api/Microsoft.GS.DPS.Host/Microsoft.GS.DPS.Host.csproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,22 @@
1313
<ItemGroup>
1414
<PackageReference Include="AutoMapper" Version="13.0.1" />
1515
<PackageReference Include="Azure.Data.AppConfiguration" Version="1.5.0" />
16-
<PackageReference Include="Azure.Identity" Version="1.13.0" />
16+
<PackageReference Include="Azure.Identity" Version="1.13.1" />
1717
<PackageReference Include="Microsoft.Extensions.Azure" Version="1.7.6" />
18-
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
18+
<PackageReference Include="Microsoft.Extensions.Configuration" Version="9.0.0" />
1919
<PackageReference Include="Microsoft.Extensions.Configuration.AzureAppConfiguration" Version="8.0.0" />
2020
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.1" />
21-
<PackageReference Include="Microsoft.Extensions.Options" Version="8.0.2" />
21+
<PackageReference Include="Microsoft.Extensions.Options" Version="9.0.0" />
2222
<PackageReference Include="Microsoft.KernelMemory.WebClient" Version="0.79.241014.2" />
23-
<PackageReference Include="Microsoft.SemanticKernel" Version="1.22.0" />
23+
<PackageReference Include="Microsoft.SemanticKernel" Version="1.32.0" />
2424
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.21.0" />
25-
<PackageReference Include="MimeTypesMap" Version="1.0.8" />
25+
<PackageReference Include="MimeTypesMap" Version="1.0.9" />
2626
<PackageReference Include="MongoDB.Bson" Version="2.29.0" />
2727
<PackageReference Include="MongoDB.Driver" Version="2.29.0" />
2828
<PackageReference Include="MongoDB.Driver.Core" Version="2.29.0" />
29-
<PackageReference Include="NSwag.AspNetCore" Version="14.1.0" />
30-
<PackageReference Include="NSwag.Core" Version="14.1.0" />
31-
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.9.0" />
29+
<PackageReference Include="NSwag.AspNetCore" Version="14.2.0" />
30+
<PackageReference Include="NSwag.Core" Version="14.2.0" />
31+
<PackageReference Include="Swashbuckle.AspNetCore" Version="7.2.0" />
3232
</ItemGroup>
3333

3434
<ItemGroup>

App/backend-api/Microsoft.GS.DPS/Microsoft.GS.DPS.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
<ItemGroup>
1010
<PackageReference Include="AutoMapper" Version="13.0.1" />
1111
<PackageReference Include="Azure.Search.Documents" Version="11.6.0" />
12-
<PackageReference Include="FluentValidation" Version="11.9.2" />
12+
<PackageReference Include="FluentValidation" Version="11.11.0" />
1313
<PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="11.9.2" />
1414
<PackageReference Include="Microsoft.KernelMemory.WebClient" Version="0.79.241014.2" />
15-
<PackageReference Include="Microsoft.Maui.Graphics" Version="8.0.90" />
15+
<PackageReference Include="Microsoft.Maui.Graphics" Version="9.0.21" />
1616
<PackageReference Include="Microsoft.Maui.Graphics.Skia" Version="8.0.90" />
17-
<PackageReference Include="MongoDB.Driver" Version="2.28.0" />
18-
<PackageReference Include="MongoDB.Driver.Core" Version="2.28.0" />
19-
<PackageReference Include="SkiaSharp.NativeAssets.Linux" Version="2.88.8" />
17+
<PackageReference Include="MongoDB.Driver" Version="2.29.0" />
18+
<PackageReference Include="MongoDB.Driver.Core" Version="2.29.0" />
19+
<PackageReference Include="SkiaSharp.NativeAssets.Linux" Version="3.116.1" />
2020
</ItemGroup>
2121

2222
<ItemGroup>

App/frontend-app/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Use the official Node.js image from the Docker Hub
2-
FROM node:18
2+
FROM node:20
33

44
# Set the working directory inside the container
55
WORKDIR /app

0 commit comments

Comments
 (0)