Skip to content

Commit

Permalink
Upgrade to SK 1.12 (microsoft#980)
Browse files Browse the repository at this point in the history
### Motivation and Context
This change is to make Chat Copilot work with the latest and greatest
version of SK.

### Description
Update NuGet versions.
Make minor changes in memory pipeline code to work with latest NuGets.

### Contribution Checklist
- [ ] The code builds clean without any errors or warnings
- [ ] The PR follows the [Contribution
Guidelines](https://github.com/microsoft/chat-copilot/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/chat-copilot/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
  • Loading branch information
glahaye authored Jun 12, 2024
1 parent a12b658 commit 0f0f5fe
Show file tree
Hide file tree
Showing 27 changed files with 66 additions and 70 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/copilot-build-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
fail-fast: false
matrix:
include:
- { dotnet: "6.0", configuration: Release, os: windows-latest }
- { dotnet: "8.0", configuration: Release, os: windows-latest }

runs-on: ${{ matrix.os }}

Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:
- name: Package Copilot Chat WebAPI
run: |
scripts\deploy\package-webapi.ps1 -Configuration Release -DotnetFramework net6.0 -TargetRuntime win-x64 -OutputDirectory ${{ github.workspace }}\scripts\deploy -Version ${{ steps.versiontag.outputs.versiontag }} -InformationalVersion "Built from commit ${{ steps.gitversion.outputs.ShortSha }} on $(Get-Date -Format 'yyyy-MM-dd')" -SkipFrontendFiles ('${{ github.event_name == 'pull_request' }}' -eq 'true')
scripts\deploy\package-webapi.ps1 -Configuration Release -DotnetFramework net8.0 -TargetRuntime win-x64 -OutputDirectory ${{ github.workspace }}\scripts\deploy -Version ${{ steps.versiontag.outputs.versiontag }} -InformationalVersion "Built from commit ${{ steps.gitversion.outputs.ShortSha }} on $(Get-Date -Format 'yyyy-MM-dd')" -SkipFrontendFiles ('${{ github.event_name == 'pull_request' }}' -eq 'true')
- name: Upload package to artifacts
uses: actions/upload-artifact@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/copilot-build-memorypipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ jobs:
- name: Set .Net Core version
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x
dotnet-version: 8.0.x

- name: Package Copilot Chat Memory Pipeline
run: |
scripts\deploy\package-memorypipeline.ps1 -Configuration Release -DotnetFramework net6.0 -TargetRuntime win-x64 -OutputDirectory ${{ github.workspace }}\scripts\deploy -Version ${{ steps.versiontag.outputs.versiontag }} -InformationalVersion "Built from commit ${{ steps.gitversion.outputs.ShortSha }} on $(Get-Date -Format "yyyy-MM-dd")"
scripts\deploy\package-memorypipeline.ps1 -Configuration Release -DotnetFramework net8.0 -TargetRuntime win-x64 -OutputDirectory ${{ github.workspace }}\scripts\deploy -Version ${{ steps.versiontag.outputs.versiontag }} -InformationalVersion "Built from commit ${{ steps.gitversion.outputs.ShortSha }} on $(Get-Date -Format "yyyy-MM-dd")"
- name: Upload package to artifacts
uses: actions/upload-artifact@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/copilot-build-plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ jobs:
- name: Set .Net Core version
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x
dotnet-version: 8.0.x

- name: Package Copilot Chat Plugins
run: |
scripts\deploy\package-plugins.ps1 `
-BuildConfiguration Release `
-DotNetFramework net6.0 `
-DotNetFramework net8.0 `
-OutputDirectory ${{ github.workspace }}\scripts\deploy `
-Version ${{ steps.versiontag.outputs.versiontag }} `
-InformationalVersion "Built from commit ${{ steps.gitversion.outputs.ShortSha }} on $(Get-Date -Format "yyyy-MM-dd")"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/copilot-deploy-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
fail-fast: false
matrix:
include:
- { dotnet: "6.0", configuration: Release, os: ubuntu-latest }
- { dotnet: "8.0", configuration: Release, os: ubuntu-latest }
# Map the job output to step output
outputs:
backend-host: ${{steps.app-name.outputs.backend-host}}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/copilot-deploy-infra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
fail-fast: false
matrix:
include:
- { dotnet: "6.0", configuration: Release, os: ubuntu-latest }
- { dotnet: "8.0", configuration: Release, os: ubuntu-latest }
outputs:
deployment-id: ${{steps.deployment-id.outputs.deployment_name}}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/copilot-deploy-memorypipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
fail-fast: false
matrix:
include:
- { dotnet: "6.0", configuration: Release, os: ubuntu-latest }
- { dotnet: "8.0", configuration: Release, os: ubuntu-latest }

runs-on: ${{ matrix.os }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/copilot-deploy-plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
fail-fast: false
matrix:
include:
- { dotnet: "6.0", configuration: Release, os: ubuntu-latest }
- { dotnet: "8.0", configuration: Release, os: ubuntu-latest }

runs-on: ${{ matrix.os }}
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/copilot-test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 18
cache-dependency-path: webapp/yarn.lock
cache: "yarn"

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x
dotnet-version: 8.0.x

- name: Install dependencies
run: yarn install
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dotnet-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x

- name: Check formatting
if: steps.find-csproj.outputs.csproj_files != ''
Expand Down
4 changes: 2 additions & 2 deletions docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ services:
- KernelMemory__Services__RabbitMq__Port=5672
- KernelMemory__Services__RabbitMq__Username=chat-copilot
- KernelMemory__Services__RabbitMq__Password=chat-copilot
- KernelMemory__ContentStorageType=AzureBlobs
- KernelMemory__DocumentStorageType=AzureBlobs
- KernelMemory__ImageOcrType=Tesseract
- KernelMemory__TextGeneratorType=AzureOpenAI
- KernelMemory__DataIngestion__OrchestrationType=Distributed
Expand Down Expand Up @@ -123,7 +123,7 @@ services:
- KernelMemory__Services__RabbitMq__Port=5672
- KernelMemory__Services__RabbitMq__Username=chat-copilot
- KernelMemory__Services__RabbitMq__Password=chat-copilot
- KernelMemory__ContentStorageType=AzureBlobs
- KernelMemory__DocumentStorageType=AzureBlobs
- KernelMemory__ImageOcrType=Tesseract
- KernelMemory__TextGeneratorType=AzureOpenAI
- KernelMemory__DataIngestion__OrchestrationType=Distributed
Expand Down
4 changes: 2 additions & 2 deletions docker/memorypipeline/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# docker build -f docker/webapi/Dockerfile -t chat-copilot-memorypipeline .

# builder
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS builder
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS builder
WORKDIR /source
# generate dev-certs for https
RUN dotnet dev-certs https
Expand All @@ -17,7 +17,7 @@ RUN cd memorypipeline && \


# final stage/image
FROM mcr.microsoft.com/dotnet/aspnet:7.0
FROM mcr.microsoft.com/dotnet/aspnet:8.0
WORKDIR /app
COPY --from=builder /app .
COPY --from=builder /root/.dotnet/corefx/cryptography/x509stores/my/* /root/.dotnet/corefx/cryptography/x509stores/my/
Expand Down
4 changes: 2 additions & 2 deletions docker/plugins/web-searcher/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# docker build -f docker/plugins/web-searcher/Dockerfile -t web-searcher .

# builder
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS installer-env
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS installer-env
ARG AZURE_FUNCTION_MASTER_KEY
WORKDIR /source
COPY plugins/shared shared
Expand All @@ -13,7 +13,7 @@ RUN cd /source/web-searcher && \
echo "{\"masterKey\":{\"name\":\"master\",\"value\":\"$AZURE_FUNCTION_MASTER_KEY\",\"encrypted\":false},\"functionKeys\":[]}" > /azure-functions-host/Secrets/host.json

# final stage/image
FROM mcr.microsoft.com/azure-functions/dotnet-isolated:4.0-dotnet-isolated6.0-appservice
FROM mcr.microsoft.com/azure-functions/dotnet-isolated:4.0-dotnet-isolated8.0-appservice
ENV AzureWebJobsScriptRoot=/home/site/wwwroot \
AzureFunctionsJobHost__Logging__Console__IsEnabled=true \
AzureWebJobsSecretStorageType=files
Expand Down
4 changes: 2 additions & 2 deletions docker/webapi/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# docker build -f docker/webapi/Dockerfile -t chat-copilot-webapi .

# builder
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS builder
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS builder
WORKDIR /source
# generate dev-certs for https
RUN dotnet dev-certs https
Expand All @@ -15,7 +15,7 @@ RUN cd webapi && \
dotnet publish --use-current-runtime --self-contained false --no-restore -o /app

# final stage/image
FROM mcr.microsoft.com/dotnet/aspnet:7.0
FROM mcr.microsoft.com/dotnet/aspnet:8.0
ENV Kestrel__Endpoints__Http__Url=http://0.0.0.0:8080
WORKDIR /app
COPY --from=builder /app .
Expand Down
10 changes: 5 additions & 5 deletions integration-tests/ChatCopilotIntegrationTests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
Expand All @@ -14,13 +14,13 @@
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="xunit" Version="2.7.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="xunit" Version="2.8.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.1">
<PackageReference Include="coverlet.collector" Version="6.0.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
6 changes: 3 additions & 3 deletions memorypipeline/CopilotChatMemoryPipeline.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<RootNamespace>CopilotChat.MemoryPipeline</RootNamespace>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RollForward>LatestMajor</RollForward>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
Expand All @@ -15,8 +15,8 @@

<ItemGroup>
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.22.0" />
<PackageReference Include="Microsoft.KernelMemory.Core" Version="0.30.240227.1" />
<PackageReference Include="Microsoft.SemanticKernel" Version="1.5.0" />
<PackageReference Include="Microsoft.KernelMemory.Core" Version="0.62.240605.1" />
<PackageReference Include="Microsoft.SemanticKernel" Version="1.14.1" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions memorypipeline/appsettings.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
//
// Kernel Memory configuration - https://github.com/microsoft/kernel-memory
// - ContentStorageType is the storage configuration for memory transfer: "AzureBlobs" or "SimpleFileStorage"
// - DocumentStorageType is the storage configuration for memory transfer: "AzureBlobs" or "SimpleFileStorage"
// - TextGeneratorType is the AI completion service configuration: "AzureOpenAIText" or "OpenAI"
// - ImageOcrType is the image OCR configuration: "None" or "AzureFormRecognizer" or "Tesseract"
// - DataIngestion is the configuration section for data ingestion pipelines.
// - Retrieval is the configuration section for memory retrieval.
// - Services is the configuration sections for various memory settings.
//
"KernelMemory": {
"ContentStorageType": "SimpleFileStorage",
"DocumentStorageType": "SimpleFileStorage",
"TextGeneratorType": "AzureOpenAIText",
"ImageOcrType": "None",
// Data ingestion pipelines configuration.
Expand Down
5 changes: 3 additions & 2 deletions scripts/deploy/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ resource appServiceWebConfig 'Microsoft.Web/sites/config@2022-09-01' = {
value: '~2'
}
{
name: 'KernelMemory:ContentStorageType'
name: 'KernelMemory:DocumentStorageType'
value: 'AzureBlobs'
}
{
Expand Down Expand Up @@ -442,6 +442,7 @@ resource appServiceMemoryPipeline 'Microsoft.Web/sites@2022-09-01' = {
skweb: '1'
}
properties: {
httpsOnly: true
serverFarmId: appServicePlan.id
virtualNetworkSubnetId: memoryStore == 'Qdrant' ? virtualNetwork.properties.subnets[0].id : null
siteConfig: {
Expand All @@ -465,7 +466,7 @@ resource appServiceMemoryPipelineConfig 'Microsoft.Web/sites/config@2022-09-01'
vnetRouteAllEnabled: true
appSettings: [
{
name: 'KernelMemory:ContentStorageType'
name: 'KernelMemory:DocumentStorageType'
value: 'AzureBlobs'
}
{
Expand Down
Loading

0 comments on commit 0f0f5fe

Please sign in to comment.