Skip to content

Compilation failed error message #497

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Copy link
Contributor

Choose a reason for hiding this comment

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

the logProcessDetails should be outside of the process.IsErrored, also someworkloads should already be logging process details, see if there are duplications

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";
Expand Down
13 changes: 11 additions & 2 deletions src/VirtualClient/VirtualClient.Actions/LAPACK/LAPACKExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ private Task BuildSourceCodeAsync(EventContext telemetryContext, CancellationTok
if (!cancellationToken.IsCancellationRequested)
{
await this.LogProcessDetailsAsync(process, relatedContext, "LMbench_Build");
process.ThrowIfErrored<WorkloadException>(errorReason: ErrorReason.WorkloadFailed);
process.ThrowIfErrored<WorkloadException>(errorReason: ErrorReason.CompilationFailed);
}
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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)
{
Expand All @@ -220,7 +220,7 @@ await process.StartAndWaitAsync(cancellationToken)
await this.LogProcessDetailsAsync(process, telemetryContext)
.ConfigureAwait(false);

process.ThrowIfErrored<WorkloadException>(errorReason: ErrorReason.WorkloadFailed);
process.ThrowIfErrored<WorkloadException>(errorReason: errorReason);
}
}
}).ConfigureAwait(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -289,7 +289,7 @@ private async Task SetupSpecCpuAsync(string isoFilePath, EventContext telemetryC
await this.stateManager.SaveStateAsync<SpecCpuState>($"{nameof(SpecCpuState)}", state, cancellationToken);
}

private async Task<string> ExecuteCommandAsync(string command, string commandArguments, string workingDirectory, EventContext telemetryContext, CancellationToken cancellationToken)
private async Task<string> ExecuteCommandAsync(string command, string commandArguments, string workingDirectory, EventContext telemetryContext, CancellationToken cancellationToken, ErrorReason errorReason = ErrorReason.WorkloadFailed)
{
EventContext relatedContext = EventContext.Persisted()
.AddContext(nameof(command), command)
Expand All @@ -307,7 +307,7 @@ private async Task<string> ExecuteCommandAsync(string command, string commandArg
if (process.IsErrored())
{
await this.LogProcessDetailsAsync(process, relatedContext, logToFile: true);
process.ThrowIfWorkloadFailed();
process.ThrowIfWorkloadFailed(errorReason: errorReason);
}
}

Expand Down
13 changes: 9 additions & 4 deletions src/VirtualClient/VirtualClient.Contracts/Enumerations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ public enum ErrorReason : int
DiskFilterNotSupported = 301,

/// <summary>
/// The workload failed during execution.
/// The workload results/results file was not found.
/// </summary>
WorkloadFailed = 315,
WorkloadResultsNotFound = 314,

/// <summary>
/// The workload results/results file was not found.
/// The workload failed during execution.
/// </summary>
WorkloadResultsNotFound = 314,
WorkloadFailed = 315,

/// <summary>
/// The workload failed during execution.
Expand Down Expand Up @@ -192,6 +192,11 @@ public enum ErrorReason : int
/// </summary>
InvalidOrMissingLicense = 512,

/// <summary>
/// Compilation of the workload failed.
/// </summary>
CompilationFailed = 513,

/// <summary>
/// Disk format operations failed.
/// </summary>
Expand Down
Loading