Skip to content

Commit 470c153

Browse files
committed
Use different dotnet install path for performance runs
1 parent 36ff58a commit 470c153

2 files changed

Lines changed: 16 additions & 10 deletions

File tree

Runner/Helpers/RuntimeHelpers.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,21 +200,23 @@ string GetMergeScript(string name)
200200
}
201201
}
202202

203-
public static async Task InstallRuntimeDotnetSdkAsync(JobBase job)
203+
public static async Task InstallRuntimeDotnetSdkAsync(JobBase job, string? installDir = null)
204204
{
205-
await InstallDotnetSdkAsync(job, "runtime/global.json");
205+
await InstallDotnetSdkAsync(job, "runtime/global.json", installDir);
206206
}
207207

208-
public static async Task InstallDotnetSdkAsync(JobBase job, string globalJsonPath)
208+
public static async Task InstallDotnetSdkAsync(JobBase job, string globalJsonPath, string? installDir = null)
209209
{
210210
AssertIsLinux();
211211

212+
installDir ??= "/usr/lib/dotnet";
213+
212214
if (!File.Exists("dotnet-install.sh"))
213215
{
214216
await job.RunProcessAsync("wget", "https://dot.net/v1/dotnet-install.sh");
215217
}
216218

217-
await job.RunProcessAsync("bash", $"dotnet-install.sh --jsonfile {globalJsonPath} --install-dir /usr/lib/dotnet");
219+
await job.RunProcessAsync("bash", $"dotnet-install.sh --jsonfile {globalJsonPath} --install-dir {installDir}");
218220
}
219221

220222
public static async Task CopyReleaseArtifactsAsync(JobBase job, string logPrefix, string destination, string runtimeConfig = "Release")

Runner/Jobs/BenchmarkLibrariesJob.cs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ namespace Runner.Jobs;
44

55
internal sealed partial class BenchmarkLibrariesJob : JobBase
66
{
7+
private const string DotnetInstallDir = "dotnet-performance";
8+
79
public BenchmarkLibrariesJob(HttpClient client, Dictionary<string, string> metadata) : base(client, metadata) { }
810

911
protected override async Task RunJobCoreAsync()
@@ -30,7 +32,7 @@ protected override async Task RunJobCoreAsync()
3032
{
3133
await clonePerformanceTask;
3234

33-
PendingTasks.Enqueue(RuntimeHelpers.InstallDotnetSdkAsync(this, "performance/global.json"));
35+
PendingTasks.Enqueue(RuntimeHelpers.InstallDotnetSdkAsync(this, "performance/global.json", DotnetInstallDir));
3436

3537
coreRuns = await DownloadCoreRootsAsync(entries);
3638
}
@@ -63,9 +65,9 @@ protected override async Task RunJobCoreAsync()
6365
await JitDiffJob.BuildAndCopyRuntimeBranchBitsAsync(this, "pr", uploadArtifacts: false, buildChecked: false, canSkipRebuild: false);
6466
}
6567

66-
await RuntimeHelpers.InstallRuntimeDotnetSdkAsync(this);
68+
await RuntimeHelpers.InstallRuntimeDotnetSdkAsync(this, DotnetInstallDir);
6769

68-
await RuntimeHelpers.InstallDotnetSdkAsync(this, "performance/global.json");
70+
await RuntimeHelpers.InstallDotnetSdkAsync(this, "performance/global.json", DotnetInstallDir);
6971

7072
coreRuns = ["artifacts-main/corerun", "artifacts-pr/corerun"];
7173
}
@@ -229,7 +231,7 @@ private async Task RunBenchmarksAsync(string[] coreRunPaths)
229231

230232
int dotnetVersion = RuntimeHelpers.GetDotnetVersion("performance");
231233

232-
string coreRuns = string.Join(' ', coreRunPaths.Select(Path.GetFullPath));
234+
string coreRuns = string.Join(' ', coreRunPaths.Select(p => $"\"{Path.GetFullPath(p)}\""));
233235

234236
int coreCount = (int)(HardwareInfo?.CpuList.First().NumberOfCores ?? 0);
235237
if (coreCount > Environment.ProcessorCount)
@@ -242,8 +244,10 @@ private async Task RunBenchmarksAsync(string[] coreRunPaths)
242244

243245
string? artifactsDir = null;
244246

245-
await RunProcessAsync("/usr/lib/dotnet/dotnet",
246-
$"run -c Release --framework net{dotnetVersion}.0 -- --filter {filter} -h {HiddenColumns} --corerun {coreRuns} {parallelSuffix}",
247+
string dotnetPath = Path.GetFullPath($"{DotnetInstallDir}/dotnet");
248+
249+
await RunProcessAsync(dotnetPath,
250+
$"run -c Release --framework net{dotnetVersion}.0 -- --cli \"{dotnetPath}\" --filter {filter} -h {HiddenColumns} --corerun {coreRuns} {parallelSuffix}",
247251
workDir: "performance/src/benchmarks/micro",
248252
processLogs: line =>
249253
{

0 commit comments

Comments
 (0)