Skip to content

Commit

Permalink
Update build script
Browse files Browse the repository at this point in the history
  • Loading branch information
theolivenbaum committed Sep 24, 2024
1 parent 7d2534c commit 30e289e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
22 changes: 18 additions & 4 deletions .devops/build-nuget.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
variables:
project: './Src/HNSW.Net/HNSW.Net.csproj'
buildConfiguration: 'Release'
targetVersion: yy.M.$(build.buildId)

trigger:
- master
Expand All @@ -11,11 +12,24 @@ pool:
steps:
- task: NuGetToolInstaller@0


- task: PowerShell@2
displayName: 'Create CalVer Version'
inputs:
targetType: 'inline'
script: |
$dottedDate = (Get-Date).ToString("yy.M")
$buildID = $($env:BUILD_BUILDID)
$newTargetVersion = "$dottedDate.$buildID"
Write-Host "##vso[task.setvariable variable=targetVersion;]$newTargetVersion"
Write-Host "Updated targetVersion to '$newTargetVersion'"
- task: UseDotNet@2
displayName: 'Use .NET 7.0 SDK'
displayName: 'Use .NET 8.0 SDK'
inputs:
packageType: sdk
version: 7.x
version: 8.x
includePreviewVersions: false
installationPath: $(Agent.ToolsDirectory)\dotnet

Expand All @@ -29,15 +43,15 @@ steps:
inputs:
command: 'build'
projects: '$(project)'
arguments: '-c $(buildConfiguration) /p:Version=1.0.$(build.buildId) /p:LangVersion=latest'
arguments: '-c $(buildConfiguration) /p:Version=$(targetVersion) /p:LangVersion=latest'

- task: DotNetCoreCLI@2
inputs:
command: 'pack'
packagesToPack: '$(project)'
versioningScheme: 'off'
configuration: '$(buildConfiguration)'
buildProperties: 'Version="1.0.$(build.buildId)";LangVersion="latest"'
buildProperties: 'Version="$(targetVersion)";LangVersion="latest"'
nobuild: true

- task: NuGetCommand@2
Expand Down
6 changes: 3 additions & 3 deletions Src/HNSW.Net.TestFiltering/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
using MessagePack;
using System.Diagnostics;

int SampleSize = 10_000;
int SampleSize = 100_000;
int SampleIncrSize = 100;
int Dimensions = 8;
int Dimensions = 128;

var world = new SmallWorld<VectorID, float>(VectorID.Distance, DefaultRandomGenerator.Instance, new () { EnableDistanceCacheForConstruction = true, InitialDistanceCacheSize = SampleSize, NeighbourHeuristic = NeighbourSelectionHeuristic.SelectHeuristic, KeepPrunedConnections = true, ExpandBestSelection = true }, threadSafe: false);

Expand Down Expand Up @@ -65,7 +65,7 @@
{
using (var cts = new CancellationTokenSource())
{
//cts.CancelAfter(TimeSpan.FromMilliseconds(1));
cts.CancelAfter(TimeSpan.FromMilliseconds(1));
var results = world.KNNSearch(v, 50, v => v.ID % 100 < (100 - p * 10), cts.Token);
}
}
Expand Down
2 changes: 1 addition & 1 deletion Src/HNSW.Net.sln
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HNSW.Net.Demo", "HNSW.Net.D
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".azuredevops", ".azuredevops", "{07C754D2-86A3-46F1-B78D-9C81F8974996}"
ProjectSection(SolutionItems) = preProject
..\build-nuget.yml = ..\build-nuget.yml
..\.devops\build-nuget.yml = ..\.devops\build-nuget.yml
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HNSW.Net.TestFiltering", "HNSW.Net.TestFiltering\HNSW.Net.TestFiltering.csproj", "{3D3E2F64-B88B-4E53-B9DD-27870B6D98AA}"
Expand Down

0 comments on commit 30e289e

Please sign in to comment.