Skip to content
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

Adding Support for .Net 9 #919

Open
wants to merge 35 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
ab4517d
net9 changes
TedHartMS Jan 8, 2025
ed7cd27
Merge remote-tracking branch 'origin/main' into tedhar/net9
TedHartMS Jan 8, 2025
5f996a0
Collection expression fix
TedHartMS Jan 9, 2025
8b3d966
Fixing SYSLIB0057
TalZaccai Jan 9, 2025
44874e1
Removing ServicePointManager
TalZaccai Jan 9, 2025
2340ba5
Temporary fix for RedisCallErrors test failing in .net9
TalZaccai Jan 16, 2025
0cb7ff7
merging with latest main
TalZaccai Jan 17, 2025
8059a3a
some fixes
TalZaccai Jan 17, 2025
80b3dc4
Merge branch 'main' into tedhar/net9
TalZaccai Jan 17, 2025
84cc8cd
Added .net90 to CI and the Nightly GitHub Action
darrenge Jan 22, 2025
d0d948a
Fixed Garnet Worker to be both .net80 and .net90 and updated ADO pipe…
darrenge Jan 22, 2025
121d14f
Updated Tsav CI that runs in ADO when mirrored
darrenge Jan 22, 2025
faae98a
Fix to RedisCallErrors
TalZaccai Jan 23, 2025
2b67210
test
TalZaccai Jan 23, 2025
3e3ed56
fix
TalZaccai Jan 23, 2025
d94a323
Skipping RedisCallErrors test
TalZaccai Jan 23, 2025
b49a1b5
Merge branch 'tedhar/net9' of https://github.com/microsoft/garnet int…
darrenge Jan 23, 2025
a74e664
Reverting ignored test
TalZaccai Jan 23, 2025
0214669
Updating CI
TalZaccai Jan 23, 2025
ebd5f05
CI fix
TalZaccai Jan 23, 2025
3fc3ffe
Ignoring RedisCallErrors test when environment variable is not set
TalZaccai Jan 23, 2025
027fe0e
Added net90 to the external release pipeline. Required changed to pub…
darrenge Jan 24, 2025
99621f7
Merge branch 'tedhar/net9' of https://github.com/microsoft/garnet int…
darrenge Jan 24, 2025
0d668ec
Fixed bug in compressed file directory
darrenge Jan 24, 2025
2cedd73
Another try on fixing the destination directory issue
darrenge Jan 24, 2025
c82efda
Added CodeQL.yml which is custom so it works with net90 as well. Upda…
darrenge Jan 29, 2025
064ac3f
merging with latest main
TalZaccai Jan 30, 2025
37e1cbd
Set RunTImes to only be packed once since they are C++ and not depend…
darrenge Jan 30, 2025
078c297
Fixed broken merge
TalZaccai Jan 30, 2025
ffff185
Merge branch 'tedhar/net9' of https://github.com/microsoft/garnet int…
TalZaccai Jan 30, 2025
039499f
Added WorkFlow dispatch and commented out net90
darrenge Jan 30, 2025
9f3b2a6
Added net90 to CodeQL
darrenge Jan 30, 2025
ff9e9e4
Enabled the Create GH Release and Push Nuget packages tasks so it is …
darrenge Jan 30, 2025
939e97a
Merge branch 'main' into tedhar/net9
darrenge Jan 30, 2025
3dd2172
Merge branch 'main' into tedhar/net9
darrenge Jan 31, 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
4 changes: 4 additions & 0 deletions .azure/pipelines/azure-pipelines-compliance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ jobs:
displayName: 'Use .NET Core sdk 8.0.x'
inputs:
version: 8.0.x
- task: UseDotNet@2
displayName: 'Use .NET Core sdk 9.0.x'
inputs:
version: 9.0.x
- task: NuGetToolInstaller@1
displayName: Nuget Tool Installer
inputs:
Expand Down
8 changes: 6 additions & 2 deletions .azure/pipelines/azure-pipelines-external-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ jobs:
displayName: Use .NET Core sdk 8.0.x
inputs:
version: 8.0.x
- task: UseDotNet@2
displayName: Use .NET Core sdk 9.0.x
inputs:
version: 9.0.x

- task: DotNetCoreCLI@2
displayName: dotnet build
Expand Down Expand Up @@ -152,10 +156,10 @@ jobs:
workingDirectory: .azure/pipelines

- task: CopyFiles@2
displayName: 'Copy Zipped Files to Artifacts dir: $(Build.artifactstagingdirectory)'
displayName: 'Copy Zipped Files (both net80 and net90 in zipped file) to Artifacts dir: $(Build.artifactstagingdirectory)'
inputs:
Contents: '**'
SourceFolder: '$(Build.SourcesDirectory)/main/GarnetServer/bin/Release/net8.0/publish/output'
SourceFolder: '$(Build.SourcesDirectory)/main/GarnetServer/bin/Release/publish/output'
TargetFolder: $(build.artifactstagingdirectory)

- task: PublishBuildArtifacts@1
Expand Down
12 changes: 12 additions & 0 deletions .azure/pipelines/azure-pipelines-tsavorite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ jobs:
packageType: 'sdk'
version: '8.0.x'

- task: UseDotNet@2
displayName: Use .NET 9.0
inputs:
packageType: 'sdk'
version: '9.0.x'

- task: NodeTool@0
displayName: Node Tool
inputs:
Expand Down Expand Up @@ -126,6 +132,12 @@ jobs:
packageType: 'sdk'
version: '8.0.x'

- task: UseDotNet@2
displayName: Use .NET 9.0
inputs:
packageType: 'sdk'
version: '9.0.x'

- bash: |
sudo npm install -g azurite
sudo mkdir azurite
Expand Down
11 changes: 11 additions & 0 deletions .azure/pipelines/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ jobs:
packageType: 'sdk'
version: '8.0.x'

- task: UseDotNet@2
displayName: Use .NET 9.0
inputs:
packageType: 'sdk'
version: '9.0.x'

- task: NodeTool@0
displayName: Node Tool
inputs:
Expand Down Expand Up @@ -118,6 +124,11 @@ jobs:
inputs:
packageType: 'sdk'
version: '8.0.x'
- task: UseDotNet@2
displayName: Use .NET 9.0
inputs:
packageType: 'sdk'
version: '9.0.x'

- bash: |
sudo npm install -g azurite
Expand Down
113 changes: 81 additions & 32 deletions .azure/pipelines/createbinaries.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ param (

################## CleanUpFiles #####################
#
# Publishes the files and clean it up so only the necessary files will be ready to be zipped
# After build is published, this cleans it up so only the necessary files will be ready to be zipped
#
######################################################
function CleanUpFiles {
param ($publishFolder, $platform)
param ($publishFolder, $platform, $framework)

$publishPath = "$basePath/main/GarnetServer/bin/Release/net8.0/publish/$publishFolder"
$publishPath = "$basePath/main/GarnetServer/bin/Release/$framework/publish/$publishFolder"
$garnetServerEXE = "$publishPath/GarnetServer.exe"
$excludeGarnetServerPDB = 'GarnetServer.pdb'

Expand Down Expand Up @@ -85,46 +85,95 @@ Set-Location $basePath/main/GarnetServer
if ($mode -eq 0 -or $mode -eq 1) {
Write-Host "** Publish ... **"
dotnet publish GarnetServer.csproj -p:PublishProfile=linux-arm64-based -f:net8.0
dotnet publish GarnetServer.csproj -p:PublishProfile=linux-x64-based -f:net8.0
dotnet publish GarnetServer.csproj -p:PublishProfile=osx-arm64-based -f:net8.0
dotnet publish GarnetServer.csproj -p:PublishProfile=osx-x64-based -f:net8.0
dotnet publish GarnetServer.csproj -p:PublishProfile=portable -f:net8.0
dotnet publish GarnetServer.csproj -p:PublishProfile=win-arm64-based-readytorun -f:net8.0
dotnet publish GarnetServer.csproj -p:PublishProfile=win-x64-based-readytorun -f:net8.0
dotnet publish GarnetServer.csproj -p:PublishProfile=linux-x64-based -f:net8.0
dotnet publish GarnetServer.csproj -p:PublishProfile=osx-arm64-based -f:net8.0
dotnet publish GarnetServer.csproj -p:PublishProfile=osx-x64-based -f:net8.0
dotnet publish GarnetServer.csproj -p:PublishProfile=portable -f:net8.0
dotnet publish GarnetServer.csproj -p:PublishProfile=win-arm64-based-readytorun -f:net8.0
dotnet publish GarnetServer.csproj -p:PublishProfile=win-x64-based-readytorun -f:net8.0

dotnet publish GarnetServer.csproj -p:PublishProfile=linux-arm64-based -f:net9.0
dotnet publish GarnetServer.csproj -p:PublishProfile=linux-x64-based -f:net9.0
dotnet publish GarnetServer.csproj -p:PublishProfile=osx-arm64-based -f:net9.0
dotnet publish GarnetServer.csproj -p:PublishProfile=osx-x64-based -f:net9.0
dotnet publish GarnetServer.csproj -p:PublishProfile=portable -f:net9.0
dotnet publish GarnetServer.csproj -p:PublishProfile=win-arm64-based-readytorun -f:net9.0
dotnet publish GarnetServer.csproj -p:PublishProfile=win-x64-based-readytorun -f:net9.0

# Clean up all the extra files
CleanUpFiles "linux-arm64" "linux-x64"
CleanUpFiles "linux-x64" "linux-x64"
CleanUpFiles "osx-arm64" "linux-x64"
CleanUpFiles "osx-x64" "linux-x64"
#CleanUpFiles "portable" "win-x64" # don't clean up all files for portable ... leave as is
CleanUpFiles "win-x64" "win-x64"
CleanUpFiles "win-arm64" "win-x64"
CleanUpFiles "linux-arm64" "linux-x64" "net8.0"
CleanUpFiles "linux-x64" "linux-x64" "net8.0"
CleanUpFiles "osx-arm64" "linux-x64" "net8.0"
CleanUpFiles "osx-x64" "linux-x64" "net8.0"
#CleanUpFiles "portable" "win-x64" "net8.0" # don't clean up all files for portable ... leave as is
CleanUpFiles "win-x64" "win-x64" "net8.0"
CleanUpFiles "win-arm64" "win-x64" "net8.0"

CleanUpFiles "linux-arm64" "linux-x64" "net9.0"
CleanUpFiles "linux-x64" "linux-x64" "net9.0"
CleanUpFiles "osx-arm64" "linux-x64" "net9.0"
CleanUpFiles "osx-x64" "linux-x64" "net9.0"
#CleanUpFiles "portable" "win-x64" "net9.0" # don't clean up all files for portable ... leave as is
CleanUpFiles "win-x64" "win-x64" "net9.0"
CleanUpFiles "win-arm64" "win-x64" "net9.0"
}

if ($mode -eq 0 -or $mode -eq 2) {

# Make sure the publish folder exists as basic check files are actually published before trying to zip
$publishedFilesFolder = "$basePath/main/GarnetServer/bin/Release/net8.0/publish"
if (!(Test-Path $publishedFilesFolder)) {
Write-Error "$publishedFilesFolder does not exist. Run .\CreateBinaries 1 to publish the binaries first."
# Make sure at publish folders are there as basic check files are actually published before trying to zip
$publishedFilesFolderNet8 = "$basePath/main/GarnetServer/bin/Release/net8.0/publish"
$publishedFilesFolderNet9 = "$basePath/main/GarnetServer/bin/Release/net9.0/publish"

if (!(Test-Path $publishedFilesFolderNet8) -or !(Test-Path $publishedFilesFolderNet9)) {
Write-Error "$publishedFilesFolderNet8 or $publishedFilesFolderNet9 does not exist. Run .\CreateBinaries 1 to publish the binaries first."
Set-Location $lastPwd
exit
}

# Create the directories
if (!(Test-Path $basePath/main/GarnetServer/bin/Release/net8.0/publish/output)) {
mkdir $basePath/main/GarnetServer/bin/Release/net8.0/publish/output

# Create the directories - both net80 and net90 will be in the same zip file.
$directories = @("linux-arm64", "linux-x64", "osx-arm64", "osx-x64", "portable", "win-arm64", "win-x64")
$sourceFramework = @("net8.0", "net9.0")
$baseSourcePath = "$basePath/main/GarnetServer/bin/Release"
$destinationPath = "$basePath/main/GarnetServer/bin/Release/publish"
$zipfiledestinationPath = "$destinationPath/output"

# Make the destination path where the compressed files will be
if (!(Test-Path $destinationPath)) {
mkdir $destinationPath
}
if (!(Test-Path $zipfiledestinationPath)) {
mkdir $zipfiledestinationPath
}
Set-Location $zipfiledestinationPath

foreach ($dir in $directories) {
if (!(Test-Path (Join-Path -Path $destinationPath -ChildPath $dir))) {
mkdir (Join-Path -Path $destinationPath -ChildPath $dir)
}
}

foreach ($dir in $directories) {
foreach ($version in $sourceFramework) {
$sourcePath = Join-Path -Path $baseSourcePath -ChildPath "$version\publish\$dir"
$destDirPath = Join-Path -Path $destinationPath -ChildPath $dir
$destVersionPath = Join-Path -Path $destDirPath -ChildPath $version

if (!(Test-Path $destVersionPath)) {
mkdir $destVersionPath
}

Copy-Item -Path "$sourcePath\*" -Destination $destVersionPath -Recurse -Force
}
}
Set-Location $basePath/main/GarnetServer/bin/Release/net8.0/publish/output

# Compress the files
# Compress the files - both net80 and net90 in the same zip file
Write-Host "** Compressing the files ... **"
7z a -mmt20 -mx5 -scsWIN win-x64-based-readytorun.zip ../win-x64/*
7z a -mmt20 -mx5 -scsWIN win-arm64-based-readytorun.zip ../win-arm64/*
7z a -scsUTF-8 linux-x64-based.tar ../linux-x64/*
7z a -scsUTF-8 linux-arm64-based.tar ../linux-arm64/*
7z a -scsUTF-8 osx-x64-based.tar ../osx-x64/*
7z a -scsUTF-8 osx-arm64-based.tar ../osx-arm64/*
7z a -mmt20 -mx5 -scsWIN -r win-x64-based-readytorun.zip ../win-x64/*
7z a -mmt20 -mx5 -scsWIN -r win-arm64-based-readytorun.zip ../win-arm64/*
7z a -scsUTF-8 -r linux-x64-based.tar ../linux-x64/*
7z a -scsUTF-8 -r linux-arm64-based.tar ../linux-arm64/*
7z a -scsUTF-8 -r osx-x64-based.tar ../osx-x64/*
7z a -scsUTF-8 -r osx-arm64-based.tar ../osx-arm64/*
7z a -mmt20 -mx5 -sdel linux-x64-based.tar.xz linux-x64-based.tar
7z a -mmt20 -mx5 -sdel linux-arm64-based.tar.xz linux-arm64-based.tar
7z a -mmt20 -mx5 -sdel osx-x64-based.tar.xz osx-x64-based.tar
Expand Down
3 changes: 2 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,15 @@ dotnet_diagnostic.IDE0303.severity = warning
# Use collection expression for builder
dotnet_diagnostic.IDE0304.severity = warning
# Use collection expression for fluent
dotnet_diagnostic.IDE0305.severity = warning
dotnet_diagnostic.IDE0305.severity = suggestion

# Miscellaneous style rules
dotnet_separate_import_directive_groups = false
file_header_template = Copyright (c) Microsoft Corporation.\nLicensed under the MIT license.
dotnet_sort_system_directives_first = true
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
dotnet_style_predefined_type_for_member_access = true:suggestion
dotnet_style_prefer_collection_expression = true:suggestion

# avoid this. unless absolutely necessary
dotnet_style_qualification_for_field = false:suggestion
Expand Down
32 changes: 26 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,14 @@ jobs:
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Setup .NET
- name: Setup .NET 8.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Setup .NET 9.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
- name: Install dependencies
run: dotnet restore Garnet.sln
- name: Check style format
Expand All @@ -63,10 +67,14 @@ jobs:
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Setup .NET
- name: Setup .NET 8.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Setup .NET 9.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
- name: Install dependencies
run: dotnet restore libs/storage/Tsavorite/cs/Tsavorite.sln
- name: Check style format
Expand All @@ -81,19 +89,27 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest ]
framework: [ 'net8.0' ]
framework: [ 'net8.0' , 'net9.0']
configuration: [ 'Debug', 'Release' ]
test: [ 'Garnet.test', 'Garnet.test.cluster' ]
if: needs.changes.outputs.garnet == 'true'
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Setup .NET
- name: Setup .NET 8.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Setup .NET 9.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
- name: Install dependencies
run: dotnet restore
- name: Set environment variables
if: ${{ matrix.framework == 'net9.0' }}
shell: bash
run: echo "DOTNET_LegacyExceptionHandling=1" >> $GITHUB_ENV
- name: Build Garnet
run: dotnet build --configuration ${{ matrix.configuration }}
- name: Run tests ${{ matrix.test }}
Expand All @@ -115,7 +131,7 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest ]
framework: [ 'net8.0' ]
framework: [ 'net8.0', 'net9.0' ]
configuration: [ 'Debug', 'Release' ]
if: needs.changes.outputs.tsavorite == 'true'
steps:
Expand All @@ -131,10 +147,14 @@ jobs:
- name: Set environment variable for Windows
run: echo ("RunAzureTests=yes") >> $env:GITHUB_ENV
if: ${{ matrix.os == 'windows-latest' }}
- name: Setup .NET
- name: Setup .NET 8.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Setup .NET 9.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
- name: Setup Node.js for Azurite
uses: actions/setup-node@v4
with:
Expand Down
Loading
Loading