Skip to content
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Benchmarks.ServerJob/ServerJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public class ServerJob : IIdentifiable
public string AspNetCoreVersion { get; set; } = "";
public string RuntimeVersion { get; set; } = "";
public string SdkVersion { get; set; } = "";
public bool UseMonoRuntime { get; set; } = false;
public string UseMonoRuntime { get; set; } = "";
public bool NoGlobalJson { get; set; }
public Database Database { get; set; } = Database.None;

Expand Down
10 changes: 8 additions & 2 deletions src/BenchmarksDriver/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ public static int Main(string[] args)
CommandOptionType.SingleValue);
var monoOption = app.Option("--mono-runtime",
"Use the mono runtime.", CommandOptionType.NoValue);
var monoOption_LlvmJit = app.Option("--mono-runtime-llvmjit",
"Use the mono runtime with LLVM JIT.", CommandOptionType.NoValue);
var aspnetCoreVersionOption = app.Option("-aspnet|--aspnetCoreVersion",
"ASP.NET Core packages version (Current, Latest, or custom value). Current is the latest public version (2.0.*), Latest is the currently developed one. Default is Latest (2.2-*).", CommandOptionType.SingleValue);
var runtimeVersionOption = app.Option("-dotnet|--runtimeVersion",
Expand Down Expand Up @@ -739,7 +741,7 @@ public static int Main(string[] args)
}
else
{
if (monoOption.HasValue())
if (monoOption.HasValue() || monoOption_LlvmJit.HasValue())
{
serverJob.SelfContained = true;

Expand Down Expand Up @@ -767,7 +769,11 @@ public static int Main(string[] args)
}
if (monoOption.HasValue())
{
serverJob.UseMonoRuntime = true;
serverJob.UseMonoRuntime = "jit";
}
if (monoOption_LlvmJit.HasValue())
{
serverJob.UseMonoRuntime = "llvm-jit";
}
if (kestrelThreadCountOption.HasValue())
{
Expand Down
1 change: 1 addition & 0 deletions src/BenchmarksDriver2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ Options:
--[JOB].buildArguments <argument> An argument to pass to msbuild. Can be used multiple times to define multiple values.
--[JOB].selfContained <true|false> Whether to deploy the app as stand-alone. Default is false. Is is forced to 'true' if either runtimeVersion or aspnetVersion is defined as the SDK versions would be used otherwise.
--[JOB].useMonoRuntime <true|false> Whether to use the Mono runtime.
--[JOB].useMonoRuntime_LlvmJit <true|false> Whether to use the Mono runtime with LLVM JIT.

## Docker options

Expand Down
22 changes: 13 additions & 9 deletions src/BenchmarksServer/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ Based on the target framework

private static readonly string _latestSdkVersionUrl = "https://aka.ms/dotnet/net5/dev/Sdk/productCommit-win-x64.txt";
private static readonly string _aspnetSdkVersionUrl = "https://raw.githubusercontent.com/dotnet/aspnetcore/master/global.json";
private static readonly string _runtimeMonoPackageUrl = "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/flat2/Microsoft.NETCore.App.Runtime.Mono.linux-x64/{0}/Microsoft.NETCore.App.Runtime.Mono.linux-x64.{0}.nupkg";
private static readonly string[] _runtimeFeedUrls = new string[] {
"https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/flat2",
"https://dotnetfeed.blob.core.windows.net/dotnet-core/flatcontainer",
Expand Down Expand Up @@ -2510,14 +2509,14 @@ private static async Task<string> CloneRestoreAndBuild(string path, ServerJob jo
}

// Download mono runtime
if (job.UseMonoRuntime)
if (!string.IsNullOrEmpty(job.UseMonoRuntime))
{
if (!job.SelfContained)
{
throw new Exception("The job is trying to use the mono runtime but was not configured as self-contained.");
}

await UseMonoRuntimeAsync(runtimeVersion, outputFolder);
await UseMonoRuntimeAsync(runtimeVersion, outputFolder, job.UseMonoRuntime);
}

// Copy all output attachments
Expand Down Expand Up @@ -3792,14 +3791,19 @@ private static void StartDotNetTrace(int processId, ServerJob job)
}
}

private static async Task UseMonoRuntimeAsync(string runtimeVersion, string outputFolder)
private static async Task UseMonoRuntimeAsync(string runtimeVersion, string outputFolder, string mode)
{
var monoRuntimeUrl = String.Format(_runtimeMonoPackageUrl, runtimeVersion);

try
{

var packageName = "Microsoft.NETCore.App.Runtime.Mono.linux-x64".ToLowerInvariant();
var packageName = "";
switch (mode) {
case "jit":
packageName = "Microsoft.NETCore.App.Runtime.Mono.linux-x64".ToLowerInvariant();
break;
case "llvm-jit":
packageName = "Microsoft.NETCore.App.Runtime.Mono.LLVM.AOT.linux-x64".ToLowerInvariant();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this right or should we use the LLVM.JIT package ? Seems confusing

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have the LLVM.JIT package. For some reason, they never got generated. The literal only difference between the AOT LLVM and JIT LLVM packages are the AOT packages also contain llc/opt. So it is totally fine to use the AOT LLVM package for JIT LLVM.

break;
}
var runtimePath = Path.Combine(_rootTempDir, "RuntimePackages", $"{packageName}.{runtimeVersion}.nupkg");

// Ensure the folder already exists
Expand Down