Skip to content

Psl dev #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 44 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
a8b1d40
edits 1
Jan 1, 2025
9ba9d34
edit 2
Jan 1, 2025
a009099
edit 3
Jan 1, 2025
b192b13
edit 3
Jan 1, 2025
c2b9180
edit 4
Jan 1, 2025
f14a3d0
edit 5
Jan 2, 2025
b325269
updated test file
Jan 2, 2025
75dccba
edit 1
Jan 2, 2025
83e35d1
edit 2
Jan 2, 2025
4e2af15
edit 3
Jan 2, 2025
d56bcae
edit 4
Jan 2, 2025
13963a9
edit 5
Jan 2, 2025
254e0f5
edit 6
Jan 2, 2025
2641ced
edit 7
Jan 2, 2025
05d7e3a
edit 8
Jan 2, 2025
436f9f6
edit 9
Jan 2, 2025
173a0c3
edit 10
Jan 2, 2025
98e3d00
edit 11
Jan 2, 2025
01a85f5
edit 12
Jan 2, 2025
baa1461
Delete .github/workflows/tests.yml
Harmanpreet-Microsoft Jan 2, 2025
94642be
Delete .github/CODEOWNERS
Harmanpreet-Microsoft Jan 2, 2025
4d4cc99
Delete .github/ISSUE_TEMPLATE/bug_report.md
Harmanpreet-Microsoft Jan 2, 2025
8fca4e5
Delete .github/ISSUE_TEMPLATE/feature_request.md
Harmanpreet-Microsoft Jan 2, 2025
913f0d7
Delete .github/ISSUE_TEMPLATE/subtask.md
Harmanpreet-Microsoft Jan 2, 2025
1806a51
Delete .github/PULL_REQUEST_TEMPLATE.md
Harmanpreet-Microsoft Jan 2, 2025
990487a
Delete .github/workflows/pr-title-checker.yml
Harmanpreet-Microsoft Jan 2, 2025
f753f6a
Delete .github/workflows/stale-bot.yml
Harmanpreet-Microsoft Jan 2, 2025
cc3a4ec
Delete App/kernel-memory/service/Abstractions/Constants.cs
Harmanpreet-Microsoft Jan 2, 2025
e60dfd2
Delete App/kernel-memory/service/Core/Core.csproj
Harmanpreet-Microsoft Jan 2, 2025
42722aa
Delete App/kernel-memory/service/Core/Handlers/KeywordExtractingHandl…
Harmanpreet-Microsoft Jan 2, 2025
60fc9c8
Delete App/kernel-memory/service/Core/Prompts/extract-keywords.txt
Harmanpreet-Microsoft Jan 2, 2025
f335f7e
Create Constants.cs
Harmanpreet-Microsoft Jan 2, 2025
5906ef2
Update Constants.cs
Harmanpreet-Microsoft Jan 2, 2025
a25adac
Create Core.csproj
Harmanpreet-Microsoft Jan 2, 2025
7b717aa
Create KeywordExtractingHandler.cs
Harmanpreet-Microsoft Jan 2, 2025
e2e7a6e
Rename App/kernel-memory/service/Core/KeywordExtractingHandler.cs to …
Harmanpreet-Microsoft Jan 2, 2025
7589338
Update KeywordExtractingHandler.cs
Harmanpreet-Microsoft Jan 2, 2025
8444b79
Update KeywordExtractingHandler.cs
Harmanpreet-Microsoft Jan 2, 2025
b9b2d2d
Create extract-keywords.txt
Harmanpreet-Microsoft Jan 2, 2025
8ef238b
Update extract-keywords.txt
Harmanpreet-Microsoft Jan 2, 2025
a3f6cf0
Update extract-keywords.txt
Harmanpreet-Microsoft Jan 2, 2025
541a526
Update extract-keywords.txt
Harmanpreet-Microsoft Jan 2, 2025
7098856
Update extract-keywords.txt
Harmanpreet-Microsoft Jan 2, 2025
bae1291
Merge pull request #143 from Harmanpreet-Microsoft/main
Roopan-Microsoft Jan 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .github/CODEOWNERS

This file was deleted.

45 changes: 0 additions & 45 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

32 changes: 0 additions & 32 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

22 changes: 0 additions & 22 deletions .github/ISSUE_TEMPLATE/subtask.md

This file was deleted.

37 changes: 0 additions & 37 deletions .github/PULL_REQUEST_TEMPLATE.md

This file was deleted.

181 changes: 181 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
name: Deploy Resources

on:
push:
branches:
- main # Adjust this to the branch you want to trigger the deployment on
schedule:
- cron: '0 6,18 * * *' # Runs at 6:00 AM and 6:00 PM GMT


jobs:
deploy:
runs-on: windows-latest # Use a Windows runner for PowerShell scripts

steps:
- name: Checkout Code
uses: actions/checkout@v3 # Checks out your repository
# Install Azure CLI
- name: Install Azure CLI
shell: pwsh
run: |
Invoke-WebRequest -Uri https://aka.ms/installazurecliwindows -OutFile AzureCLI.msi
Start-Process msiexec.exe -ArgumentList '/I AzureCLI.msi /quiet' -Wait

# Install kubectl (Windows method)
- name: Install kubectl
shell: pwsh
run: |
Invoke-WebRequest -Uri https://dl.k8s.io/release/v1.28.0/bin/windows/amd64/kubectl.exe -OutFile kubectl.exe
Move-Item -Path ./kubectl.exe -Destination "C:\kubectl.exe"
[Environment]::SetEnvironmentVariable('PATH', $env:PATH + ';C:\', [System.EnvironmentVariableTarget]::Machine)


# Install Helm (Windows method)
- name: Install Helm
shell: pwsh
run: |
Invoke-WebRequest -Uri https://get.helm.sh/helm-v3.13.0-windows-amd64.zip -OutFile helm.zip
Expand-Archive helm.zip -DestinationPath helm
Move-Item -Path ./helm/windows-amd64/helm.exe -Destination "C:\helm.exe"
[Environment]::SetEnvironmentVariable('PATH', $env:PATH + ';C:\', [System.EnvironmentVariableTarget]::Machine)


- name: Set Docker environment variables
run: echo "DOCKER_BUILDKIT=0" >> $GITHUB_ENV

# Set up Docker
- name: Set up Docker
uses: docker/setup-buildx-action@v2
with:
driver: docker

- name: Setup PowerShell
shell: pwsh
run: |
$PSVersionTable.PSVersion

- name: Run Deployment Script with Input
shell: pwsh
run: |
cd Deployment
$input = @"
${{ secrets.AZURE_SUBSCRIPTION_ID }}
CanadaCentral
WestUS3
${{ secrets.EMAIL }}
yes
"@
$input | pwsh ./resourcedeployment.ps1
echo "Resource Group Name is ${{ env.rg_name }}"
echo "Kubernetes resource group are ${{ env.krg_name }}"
env:
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
- name: Cleanup Resource Group
if: always() # Ensures this step runs even if the deployment fails
shell: pwsh
run: |
az login --service-principal --username ${{ secrets.AZURE_CLIENT_ID }} --password ${{ secrets.AZURE_CLIENT_SECRET }} --tenant ${{ secrets.AZURE_TENANT_ID }}
az group delete --name ${{ env.rg_name }} --yes --no-wait
az group delete --name ${{ env.krg_name }} --yes --no-wait
env:
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}

- name: Wait for Resource Deletion to Complete
shell: pwsh
run: |
$retries = 0
$maxRetries = 3
$sleepIntervals = @(700, 200, 200)

while ($retries -lt $maxRetries) {
$rgStatus = az group exists --name ${{ env.rg_name }}
$krgStatus = az group exists --name ${{ env.krg_name }}


# if (-not $rgStatus -and -not $krgStatus) {
# Write-Host "Both resource groups deleted successfully."
# break
# }
if ($rgStatus -eq "false" -and $krgStatus -eq "false") {
Write-Host "Both resource groups deleted successfully."
break
}

$retries++
if ($retries -eq $maxRetries) {
Write-Host "Resource groups deletion not confirmed after $maxRetries attempts. Exiting."
exit 1
}

Write-Host "Resource groups still exist. Retrying in $($sleepIntervals[$retries - 1]) seconds..."
Start-Sleep -Seconds $sleepIntervals[$retries - 1]
}

- name: Purging the Resources
if: success()
shell: pwsh
run: |
# Set variables using GitHub Actions environment values
$solutionPrefix = "${{ env.SOLUTION_PREFIX }}"
$subscriptionId = "${{ secrets.AZURE_SUBSCRIPTION_ID }}"
$resourceGroupName = "${{ env.rg_name }}"

$openai_name = "openaiservice-$solutionPrefix"
$cognitiveservice_name = "cognitiveservice-$solutionPrefix"

# Debug: Print resource names
Write-Host "Purging OpenAI resource: $openai_name"
Write-Host "Purging CognitiveService Account: $cognitiveservice_name"

# Construct resource IDs
$openaiResourceId = "/subscriptions/$subscriptionId/providers/Microsoft.CognitiveServices/locations/westus3/resourceGroups/$resourceGroupName/deletedAccounts/$openai_name"
$cognitiveResourceId = "/subscriptions/$subscriptionId/providers/Microsoft.CognitiveServices/locations/eastus/resourceGroups/$resourceGroupName/deletedAccounts/$cognitiveservice_name"

# Debug: Print constructed resource IDs
Write-Host "Command to purge OpenAI resource: az resource delete --ids `"$openaiResourceId`" --verbose"
Write-Host "Command to purge CognitiveService Account: az resource delete --ids `"$cognitiveResourceId`" --verbose"
# Purge OpenAI Resource
az resource delete --ids $openaiResourceId --verbose
if (-not $?) {
Write-Host "Failed to purge OpenAI resource: $openaiResourceId"
}

# Purge CognitiveService Account


az resource delete --ids $cognitiveResourceId --verbose
if (-not $?) {
Write-Host "Failed to purge CognitiveService Account."
}


- name: Send Notification on Failure
if: failure()
shell: pwsh
run: |
# Define the RUN_URL variable
$RUN_URL = "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"

# Construct the email body using a Here-String
$EMAIL_BODY = @"
{
"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>"
}
"@

# Send the notification with error handling
try {
curl -X POST "${{ secrets.LOGIC_APP_URL }}" `
-H "Content-Type: application/json" `
-d "$EMAIL_BODY"
} catch {
Write-Output "Failed to send notification."
}

22 changes: 0 additions & 22 deletions .github/workflows/pr-title-checker.yml

This file was deleted.

19 changes: 0 additions & 19 deletions .github/workflows/stale-bot.yml

This file was deleted.

1 change: 0 additions & 1 deletion App/kernel-memory/service/Abstractions/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,5 +163,4 @@ public static class Summary
// Standard prompt names
public const string PromptNamesSummarize = "summarize";
public const string PromptNamesAnswerWithFacts = "answer-with-facts";
public const string PromptNamesExtractKeywords = "extract-keywords";
}
1 change: 0 additions & 1 deletion App/kernel-memory/service/Core/Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
<ItemGroup>
<EmbeddedResource Include="Prompts\summarize.txt" />
<EmbeddedResource Include="Prompts\answer-with-facts.txt" />
<EmbeddedResource Include="Prompts\extract-keywords.txt" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading
Loading