From a0ea23dd1ea69e5bb72441f7f3354bc6e3a328f7 Mon Sep 17 00:00:00 2001 From: saibulusu Date: Tue, 8 Apr 2025 12:53:35 -0700 Subject: [PATCH 1/5] Adding new error 513. --- .../Memtier/MemtierBenchmarkClientExecutor.cs | 2 +- .../VirtualClient.Actions/SPECcpu/SpecCpuExecutor.cs | 2 +- src/VirtualClient/VirtualClient.Contracts/Enumerations.cs | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/VirtualClient/VirtualClient.Actions/Memtier/MemtierBenchmarkClientExecutor.cs b/src/VirtualClient/VirtualClient.Actions/Memtier/MemtierBenchmarkClientExecutor.cs index 1382fa4b3f..c97871f6e5 100644 --- a/src/VirtualClient/VirtualClient.Actions/Memtier/MemtierBenchmarkClientExecutor.cs +++ b/src/VirtualClient/VirtualClient.Actions/Memtier/MemtierBenchmarkClientExecutor.cs @@ -514,7 +514,7 @@ private async Task ExecuteWorkloadAsync(PortDescription serverPort, string comma if (!cancellationToken.IsCancellationRequested) { await this.LogProcessDetailsAsync(process, telemetryContext, "Memtier", logToFile: true); - process.ThrowIfWorkloadFailed(MemcachedExecutor.SuccessExitCodes); + process.ThrowIfWorkloadFailed(MemcachedExecutor.SuccessExitCodes, errorReason: ErrorReason.CompilationFailed); // The Memtier workload for whatever reason emits the following statement in standard error: // 'Writing results to stdout'. We will throw if there is any other information in standard error. Certain diff --git a/src/VirtualClient/VirtualClient.Actions/SPECcpu/SpecCpuExecutor.cs b/src/VirtualClient/VirtualClient.Actions/SPECcpu/SpecCpuExecutor.cs index 975d0ca539..1ded4af4ac 100644 --- a/src/VirtualClient/VirtualClient.Actions/SPECcpu/SpecCpuExecutor.cs +++ b/src/VirtualClient/VirtualClient.Actions/SPECcpu/SpecCpuExecutor.cs @@ -307,7 +307,7 @@ private async Task ExecuteCommandAsync(string command, string commandArg if (process.IsErrored()) { await this.LogProcessDetailsAsync(process, relatedContext, logToFile: true); - process.ThrowIfWorkloadFailed(); + process.ThrowIfWorkloadFailed(errorReason: ErrorReason.CompilationFailed); } } diff --git a/src/VirtualClient/VirtualClient.Contracts/Enumerations.cs b/src/VirtualClient/VirtualClient.Contracts/Enumerations.cs index a4f996ad9c..089889986f 100644 --- a/src/VirtualClient/VirtualClient.Contracts/Enumerations.cs +++ b/src/VirtualClient/VirtualClient.Contracts/Enumerations.cs @@ -192,6 +192,11 @@ public enum ErrorReason : int /// InvalidOrMissingLicense = 512, + /// + /// Compilation of the workload failed. + /// + CompilationFailed = 513, + /// /// Disk format operations failed. /// From 31f1ac081426b7673164643d275ef60e17908701 Mon Sep 17 00:00:00 2001 From: saibulusu Date: Wed, 9 Apr 2025 16:42:25 -0700 Subject: [PATCH 2/5] Throwing 513 for compile commands only. --- .../VirtualClient.Actions/LAPACK/LAPACKExecutor.cs | 13 +++++++++++-- .../LMbench/LMbenchExecutor.cs | 2 +- .../SPECcpu/SpecCpuExecutor.cs | 6 +++--- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/VirtualClient/VirtualClient.Actions/LAPACK/LAPACKExecutor.cs b/src/VirtualClient/VirtualClient.Actions/LAPACK/LAPACKExecutor.cs index c79f373bb3..37c6fb5071 100644 --- a/src/VirtualClient/VirtualClient.Actions/LAPACK/LAPACKExecutor.cs +++ b/src/VirtualClient/VirtualClient.Actions/LAPACK/LAPACKExecutor.cs @@ -85,8 +85,17 @@ protected override async Task ExecuteAsync(EventContext telemetryContext, Cancel if (this.Platform == PlatformID.Unix) { // Run make to generate all object files for fortran subroutines. - await this.ExecuteCommandAsync("make", null, this.packageDirectory, cancellationToken) - .ConfigureAwait(false); + using (IProcessProxy process = await this.ExecuteCommandAsync("make", null, this.packageDirectory, telemetryContext, cancellationToken)) + { + if (!cancellationToken.IsCancellationRequested) + { + if (process.IsErrored()) + { + await this.LogProcessDetailsAsync(process, telemetryContext, "LAPACK", logToFile: true); + process.ThrowIfWorkloadFailed(errorReason: ErrorReason.CompilationFailed); + } + } + } // Delete results file that gets generated. if (this.fileSystem.File.Exists(this.ResultsFilePath)) diff --git a/src/VirtualClient/VirtualClient.Actions/LMbench/LMbenchExecutor.cs b/src/VirtualClient/VirtualClient.Actions/LMbench/LMbenchExecutor.cs index b38d20e8f9..774041d87c 100644 --- a/src/VirtualClient/VirtualClient.Actions/LMbench/LMbenchExecutor.cs +++ b/src/VirtualClient/VirtualClient.Actions/LMbench/LMbenchExecutor.cs @@ -174,7 +174,7 @@ private Task BuildSourceCodeAsync(EventContext telemetryContext, CancellationTok if (!cancellationToken.IsCancellationRequested) { await this.LogProcessDetailsAsync(process, relatedContext, "LMbench_Build"); - process.ThrowIfErrored(errorReason: ErrorReason.WorkloadFailed); + process.ThrowIfErrored(errorReason: ErrorReason.CompilationFailed); } } }); diff --git a/src/VirtualClient/VirtualClient.Actions/SPECcpu/SpecCpuExecutor.cs b/src/VirtualClient/VirtualClient.Actions/SPECcpu/SpecCpuExecutor.cs index 1ded4af4ac..f30ec63998 100644 --- a/src/VirtualClient/VirtualClient.Actions/SPECcpu/SpecCpuExecutor.cs +++ b/src/VirtualClient/VirtualClient.Actions/SPECcpu/SpecCpuExecutor.cs @@ -256,7 +256,7 @@ private async Task SetupSpecCpuAsync(string isoFilePath, EventContext telemetryC if (this.Platform == PlatformID.Unix) { await this.ExecuteCommandAsync("mount", $"-t iso9660 -o ro,exec,loop {isoFilePath} {mountPath}", this.PackageDirectory, telemetryContext, cancellationToken); - await this.ExecuteCommandAsync("./install.sh", $"-f -d {this.PackageDirectory}", mountPath, telemetryContext, cancellationToken); + await this.ExecuteCommandAsync("./install.sh", $"-f -d {this.PackageDirectory}", mountPath, telemetryContext, cancellationToken, ErrorReason.CompilationFailed); await this.WriteSpecCpuConfigAsync(cancellationToken); await this.ExecuteCommandAsync("chmod", $"-R ugo=rwx {this.PackageDirectory}", this.PackageDirectory, telemetryContext, cancellationToken); await this.ExecuteCommandAsync("umount", mountPath, this.PackageDirectory, telemetryContext, cancellationToken); @@ -289,7 +289,7 @@ private async Task SetupSpecCpuAsync(string isoFilePath, EventContext telemetryC await this.stateManager.SaveStateAsync($"{nameof(SpecCpuState)}", state, cancellationToken); } - private async Task ExecuteCommandAsync(string command, string commandArguments, string workingDirectory, EventContext telemetryContext, CancellationToken cancellationToken) + private async Task ExecuteCommandAsync(string command, string commandArguments, string workingDirectory, EventContext telemetryContext, CancellationToken cancellationToken, ErrorReason errorReason = ErrorReason.WorkloadFailed) { EventContext relatedContext = EventContext.Persisted() .AddContext(nameof(command), command) @@ -307,7 +307,7 @@ private async Task ExecuteCommandAsync(string command, string commandArg if (process.IsErrored()) { await this.LogProcessDetailsAsync(process, relatedContext, logToFile: true); - process.ThrowIfWorkloadFailed(errorReason: ErrorReason.CompilationFailed); + process.ThrowIfWorkloadFailed(errorReason: errorReason); } } From f403c8461594ba8623c659698bdbba7258e1c06d Mon Sep 17 00:00:00 2001 From: saibulusu Date: Mon, 28 Apr 2025 09:36:31 -0700 Subject: [PATCH 3/5] reordering. --- src/VirtualClient/VirtualClient.Contracts/Enumerations.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/VirtualClient/VirtualClient.Contracts/Enumerations.cs b/src/VirtualClient/VirtualClient.Contracts/Enumerations.cs index 20f11a0e99..6456a153b0 100644 --- a/src/VirtualClient/VirtualClient.Contracts/Enumerations.cs +++ b/src/VirtualClient/VirtualClient.Contracts/Enumerations.cs @@ -37,14 +37,14 @@ public enum ErrorReason : int DiskFilterNotSupported = 301, /// - /// The workload failed during execution. + /// The workload results/results file was not found. /// - WorkloadFailed = 315, + WorkloadResultsNotFound = 314, /// - /// The workload results/results file was not found. + /// The workload failed during execution. /// - WorkloadResultsNotFound = 314, + WorkloadFailed = 315, /// /// The workload failed during execution. From cc66bcd40dcbff0431f3e7affebe8ab110e97870 Mon Sep 17 00:00:00 2001 From: saibulusu Date: Mon, 28 Apr 2025 13:30:31 -0700 Subject: [PATCH 4/5] Coremark and Lzbench errors. --- .../CoreMark/CoreMarkExecutor.cs | 18 ++++++++++++++++++ .../Lzbench/LzbenchExecutor.cs | 6 +++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/VirtualClient/VirtualClient.Actions/CoreMark/CoreMarkExecutor.cs b/src/VirtualClient/VirtualClient.Actions/CoreMark/CoreMarkExecutor.cs index 67bc74bef4..cd17f61b55 100644 --- a/src/VirtualClient/VirtualClient.Actions/CoreMark/CoreMarkExecutor.cs +++ b/src/VirtualClient/VirtualClient.Actions/CoreMark/CoreMarkExecutor.cs @@ -114,6 +114,15 @@ protected override async Task ExecuteAsync(EventContext telemetryContext, Cancel case PlatformID.Unix: using (IProcessProxy process = await this.ExecuteCommandAsync("make", argument, this.PackagePath, telemetryContext, cancellationToken)) { + if (!cancellationToken.IsCancellationRequested) + { + if (process.IsErrored()) + { + await this.LogProcessDetailsAsync(process, telemetryContext, "CoreMark", logToFile: true); + process.ThrowIfWorkloadFailed(errorReason: ErrorReason.CompilationFailed); + } + } + await this.CaptureMetricsAsync(process, argument, telemetryContext, cancellationToken); } @@ -125,6 +134,15 @@ protected override async Task ExecuteAsync(EventContext telemetryContext, Cancel using (IProcessProxy process = await this.ExecuteCygwinBashAsync($"make {argument}", this.PackagePath, cygwinPackage.Path, telemetryContext, cancellationToken)) { + if (!cancellationToken.IsCancellationRequested) + { + if (process.IsErrored()) + { + await this.LogProcessDetailsAsync(process, telemetryContext, "CoreMark", logToFile: true); + process.ThrowIfWorkloadFailed(errorReason: ErrorReason.CompilationFailed); + } + } + await this.CaptureMetricsAsync(process, argument, telemetryContext, cancellationToken); } diff --git a/src/VirtualClient/VirtualClient.Actions/Lzbench/LzbenchExecutor.cs b/src/VirtualClient/VirtualClient.Actions/Lzbench/LzbenchExecutor.cs index e7461c8573..c8f95a7dc9 100644 --- a/src/VirtualClient/VirtualClient.Actions/Lzbench/LzbenchExecutor.cs +++ b/src/VirtualClient/VirtualClient.Actions/Lzbench/LzbenchExecutor.cs @@ -136,7 +136,7 @@ protected override async Task InitializeAsync(EventContext telemetryContext, Can await this.ExecuteCommandAsync("git", $"clone -b v{this.Version} https://github.com/inikep/lzbench.git", this.PlatformSpecifics.PackagesDirectory, cancellationToken); // Build Lzbench. - await this.ExecuteCommandAsync("make", string.Empty, this.LzbenchDirectory, cancellationToken); + await this.ExecuteCommandAsync("make", string.Empty, this.LzbenchDirectory, cancellationToken, errorReason: ErrorReason.CompilationFailed); // Choose default file for compression and decompression if files/dirs are not provided. if (string.IsNullOrWhiteSpace(this.InputFilesOrDirs)) @@ -196,7 +196,7 @@ private async Task CaptureMetricsAsync(IProcessProxy process, string commandArgu } } - private async Task ExecuteCommandAsync(string pathToExe, string commandLineArguments, string workingDirectory, CancellationToken cancellationToken) + private async Task ExecuteCommandAsync(string pathToExe, string commandLineArguments, string workingDirectory, CancellationToken cancellationToken, ErrorReason errorReason = ErrorReason.WorkloadFailed) { if (!cancellationToken.IsCancellationRequested) { @@ -220,7 +220,7 @@ await process.StartAndWaitAsync(cancellationToken) await this.LogProcessDetailsAsync(process, telemetryContext) .ConfigureAwait(false); - process.ThrowIfErrored(errorReason: ErrorReason.WorkloadFailed); + process.ThrowIfErrored(errorReason: errorReason); } } }).ConfigureAwait(false); From 95974cae8e2cb66a8675f4ad5333b5964e056097 Mon Sep 17 00:00:00 2001 From: saibulusu Date: Mon, 28 Apr 2025 13:38:27 -0700 Subject: [PATCH 5/5] HPLinpack error. --- .../HPLinpack/HPLinpackExecutor.cs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/VirtualClient/VirtualClient.Actions/HPLinpack/HPLinpackExecutor.cs b/src/VirtualClient/VirtualClient.Actions/HPLinpack/HPLinpackExecutor.cs index 7c5a0a38ed..867a81787f 100644 --- a/src/VirtualClient/VirtualClient.Actions/HPLinpack/HPLinpackExecutor.cs +++ b/src/VirtualClient/VirtualClient.Actions/HPLinpack/HPLinpackExecutor.cs @@ -209,15 +209,24 @@ protected override async Task ExecuteAsync(EventContext telemetryContext, Cancel { using (BackgroundOperations profiling = BackgroundOperations.BeginProfiling(this, cancellationToken)) { + IProcessProxy process; + DateTime startTime = DateTime.UtcNow; - await this.ExecuteCommandAsync("make", $"arch=Linux_GCC", this.HPLDirectory, telemetryContext, cancellationToken) - .ConfigureAwait(false); + using (process = await this.ExecuteCommandAsync("make", $"arch=Linux_GCC", this.HPLDirectory, telemetryContext, cancellationToken).ConfigureAwait(false)) + { + if (!cancellationToken.IsCancellationRequested) + { + if (process.IsErrored()) + { + await this.LogProcessDetailsAsync(process, telemetryContext, "HPLinpack", logToFile: true); + process.ThrowIfWorkloadFailed(errorReason: ErrorReason.CompilationFailed); + } + } + } this.SetParameters(); await this.ConfigureDatFileAsync(telemetryContext, cancellationToken).ConfigureAwait(false); - IProcessProxy process; - if (this.cpuInfo.IsHyperthreadingEnabled) { this.commandArguments = $"--use-hwthread-cpus -np {this.NumberOfProcesses} --allow-run-as-root";