Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
58 changes: 53 additions & 5 deletions .azure/pipelines/azure-pipelines-external-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ trigger:
paths:
include:
- Version.props

resources:
repositories:
- repository: self
Expand All @@ -21,9 +22,28 @@ pool:
vmImage: 'windows-latest'

jobs:
- job: BuildNativeLinux
displayName: Build bftree native (Linux)
pool:
vmImage: 'ubuntu-latest'
steps:
- checkout: self
clean: False
- bash: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
source $HOME/.cargo/env
cargo build --release --locked --manifest-path libs/native/bftree-garnet/Cargo.toml
displayName: 'Build bftree for Linux'
- task: PublishPipelineArtifact@1
displayName: 'Upload libbftree_garnet.so'
inputs:
targetPath: libs/native/bftree-garnet/target/release/libbftree_garnet.so
artifactName: bftree-linux-x64

- job: Phase_1
displayName: Assessment
condition: succeeded() # Ensures job execution stops if any step fails - need this step due to "condition" in GitHubRelease task
dependsOn: BuildNativeLinux
condition: succeeded()
cancelTimeoutInMinutes: 1
pool:
name: Azure Pipelines
Expand All @@ -34,12 +54,30 @@ jobs:
submodules: recursive
persistCredentials: True

- task: DownloadPipelineArtifact@2
displayName: 'Download freshly-built Linux bftree binary'
inputs:
artifactName: bftree-linux-x64
targetPath: libs/native/bftree-garnet/runtimes/linux-x64/native

- task: PowerShell@2
displayName: 'Extract version number from Version.props'
inputs:
filePath: .azure/pipelines/extract_version.ps1
workingDirectory: .azure/pipelines

- powershell: |
$isPreRelease = "$(Build.BuildNumber)".Contains('-')
if ($isPreRelease) {
$releaseTitle = "Garnet PREVIEW v$(Build.BuildNumber)"
} else {
$releaseTitle = "Garnet v$(Build.BuildNumber)"
}
Write-Host "Build.BuildNumber=$(Build.BuildNumber); isPreRelease=$isPreRelease; releaseTitle=$releaseTitle"
Write-Host "##vso[task.setvariable variable=isPreRelease]$($isPreRelease.ToString().ToLower())"
Write-Host "##vso[task.setvariable variable=releaseTitle]$releaseTitle"
displayName: 'Derive isPreRelease and releaseTitle from version (PREVIEW prefix iff SemVer prerelease)'

- task: UseDotNet@2
displayName: Use .NET 6 SDK - needed for code signing
inputs:
Expand All @@ -49,6 +87,15 @@ jobs:
inputs:
version: 10.0.x

- task: PowerShell@2
displayName: Install Rust toolchain
inputs:
targetType: inline
script: |
Invoke-WebRequest -Uri https://win.rustup.rs -OutFile rustup-init.exe
.\rustup-init.exe -y --default-toolchain stable
echo "##vso[task.prependpath]$env:USERPROFILE\.cargo\bin"

- task: DotNetCoreCLI@2
displayName: dotnet build
inputs:
Expand All @@ -74,7 +121,7 @@ jobs:
AuthCertName: 'garnet-codesign-auth-cert'
ServiceEndpointUrl: 'https://api.esrp.microsoft.com/api/v2'
FolderPath: .
Pattern: Garnet*.dll,Tsavorite*.dll,Garnet*.exe,HdrHistogram.dll,native_device.dll
Pattern: Garnet*.dll,Tsavorite*.dll,Garnet*.exe,HdrHistogram.dll,native_device.dll,bftree_garnet.dll,*Lua.dll
signConfigType: inlineSignParams
inlineOperation: >-
[
Expand Down Expand Up @@ -174,13 +221,13 @@ jobs:

- task: GitHubRelease@1
displayName: 'Create the GitHub release'
condition: eq(variables['Build.SourceBranchName'], 'main')
condition: eq(variables['Build.SourceBranch'], 'refs/heads/main')
inputs:
action: 'create'
gitHubConnection: ADO_to_Github_ServiceConnection
tagSource: userSpecifiedTag
tag: 'v$(Build.BuildNumber)'
title: 'Garnet v$(Build.BuildNumber)'
title: '$(releaseTitle)'
releaseNotesSource: inline
releaseNotesInline: |
Get NuGet binaries at:
Expand All @@ -197,10 +244,11 @@ jobs:
$(Build.ArtifactStagingDirectory)/*.zip
$(Build.ArtifactStagingDirectory)/*.tar.xz
$(Build.ArtifactStagingDirectory)/*.7z
isPreRelease: $(isPreRelease)

- task: NuGetCommand@2
displayName: 'Push both packages to NuGet.org'
condition: eq(variables['Build.SourceBranchName'], 'main')
condition: eq(variables['Build.SourceBranch'], 'refs/heads/main')
inputs:
command: push
packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg'
Expand Down
34 changes: 33 additions & 1 deletion .azure/pipelines/azure-pipelines-internal-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,27 @@ resources:
type: git
ref: refs/heads/main
jobs:
- job: BuildNativeLinux
displayName: Build bftree native (Linux)
pool:
vmImage: 'ubuntu-latest'
steps:
- checkout: self
clean: False
- bash: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
source $HOME/.cargo/env
cargo build --release --locked --manifest-path libs/native/bftree-garnet/Cargo.toml
displayName: 'Build bftree for Linux'
- task: PublishPipelineArtifact@1
displayName: 'Upload libbftree_garnet.so'
inputs:
targetPath: libs/native/bftree-garnet/target/release/libbftree_garnet.so
artifactName: bftree-linux-x64

- job: Phase_1
displayName: Assessment
dependsOn: BuildNativeLinux
cancelTimeoutInMinutes: 1
pool:
name: Azure Pipelines
Expand All @@ -21,6 +40,11 @@ jobs:
clean: False
submodules: recursive
persistCredentials: True
- task: DownloadPipelineArtifact@2
displayName: 'Download freshly-built Linux bftree binary'
inputs:
artifactName: bftree-linux-x64
targetPath: libs/native/bftree-garnet/runtimes/linux-x64/native
- task: UseDotNet@2
displayName: Use .NET 10 SDK
inputs:
Expand All @@ -34,6 +58,14 @@ jobs:
displayName: NuGet Authenticate
- task: NuGetAuthenticate@1
displayName: 'NuGet Authenticate'
- task: PowerShell@2
displayName: Install Rust toolchain
inputs:
targetType: inline
script: |
Invoke-WebRequest -Uri https://win.rustup.rs -OutFile rustup-init.exe
.\rustup-init.exe -y --default-toolchain stable
echo "##vso[task.prependpath]$env:USERPROFILE\.cargo\bin"
- task: DotNetCoreCLI@2
displayName: dotnet build
inputs:
Expand All @@ -45,7 +77,7 @@ jobs:
inputs:
ConnectedServiceName: Garnet Code Signing
FolderPath: .
Pattern: Garnet.server.dll,Garnet.client.dll,Garnet.common.dll,Garnet.cluster.dll,Garnet.host.dll,HdrHistogram.dll,Tsavorite.core.dll,Tsavorite.devices.AzureStorageDevice.dll,native_device.dll
Pattern: Garnet.server.dll,Garnet.client.dll,Garnet.common.dll,Garnet.cluster.dll,Garnet.host.dll,HdrHistogram.dll,Tsavorite.core.dll,Tsavorite.devices.AzureStorageDevice.dll,native_device.dll,bftree_garnet.dll,BfTreeInterop.dll
signConfigType: inlineSignParams
inlineOperation: >-
[
Expand Down
14 changes: 14 additions & 0 deletions .azure/pipelines/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@ jobs:
packageType: 'sdk'
version: '10.0.x'

- task: PowerShell@2
displayName: Install Rust toolchain
inputs:
targetType: inline
script: |
Invoke-WebRequest -Uri https://win.rustup.rs -OutFile rustup-init.exe
.\rustup-init.exe -y --default-toolchain stable
echo "##vso[task.prependpath]$env:USERPROFILE\.cargo\bin"

- task: NodeTool@0
displayName: Node Tool
inputs:
Expand Down Expand Up @@ -164,6 +173,11 @@ jobs:
packageType: 'sdk'
version: '10.0.x'

- bash: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
echo "##vso[task.prependpath]$HOME/.cargo/bin"
displayName: 'Install Rust toolchain'

- bash: |
sudo npm install -g azurite
sudo mkdir azurite
Expand Down
8 changes: 7 additions & 1 deletion .azure/pipelines/createbinaries.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,17 @@ function CleanUpFiles {
$publishPath = "$basePath/main/GarnetServer/bin/Release/$framework/publish/$publishFolder"
$excludeGarnetServerPDB = 'GarnetServer.pdb'

# Native binary is different based on OS by default
# Native binaries are different based on OS by default
$nativeFile = "libnative_device.so"
$bftreeFile = "libbftree_garnet.so"

if ($platform -match "win-x64") {
$nativeFile = "native_device.dll"
$bftreeFile = "bftree_garnet.dll"
}

$nativeRuntimePathFile = "$publishPath/runtimes/$platform/native/$nativeFile"
$bftreeRuntimePathFile = "$publishPath/runtimes/$platform/native/$bftreeFile"

if (Test-Path -Path $publishPath) {
Get-ChildItem -Path $publishPath -Filter '*.pfx' | Remove-Item -Force
Expand All @@ -56,6 +59,9 @@ function CleanUpFiles {

# Copy proper native run time to publish directory
Copy-Item -Path $nativeRuntimePathFile -Destination $publishPath
if (Test-Path -Path $bftreeRuntimePathFile) {
Copy-Item -Path $bftreeRuntimePathFile -Destination $publishPath
}
} else {
Write-Host "Publish Path not found: $publishPath"
}
Expand Down
Loading