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
8 changes: 4 additions & 4 deletions app/components/job/browse/job-list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { QuickListComponent, QuickListItemStatus } from "app/components/base/qui
import { ListOrTableBase } from "app/components/base/selectable-list";
import { TableComponent } from "app/components/base/table";
import { Job, JobState } from "app/models";
import { SchedulingErrorDecorator } from "app/models/decorators";
import { FailureInfoDecorator } from "app/models/decorators";
import { JobService } from "app/services";
import { RxListProxy } from "app/services/core";
import { Filter } from "app/utils/filter-builder";
Expand Down Expand Up @@ -91,7 +91,7 @@ export class JobListComponent extends ListOrTableBase implements OnInit, OnDestr
}

public jobStatus(job: Job): QuickListItemStatus {
if (job.executionInfo && job.executionInfo.schedulingError) {
if (job.executionInfo && job.executionInfo.failureInfo) {
return QuickListItemStatus.warning;
} else {
switch (job.state) {
Expand All @@ -112,8 +112,8 @@ export class JobListComponent extends ListOrTableBase implements OnInit, OnDestr
}

public jobStatusText(job: Job): string {
if (job.executionInfo && job.executionInfo.schedulingError) {
return new SchedulingErrorDecorator(job.executionInfo.schedulingError).summary;
if (job.executionInfo && job.executionInfo.failureInfo) {
return new FailureInfoDecorator(job.executionInfo.failureInfo).summary;
} else {
switch (job.state) {
case JobState.completed:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ export class JobErrorDisplayComponent {
return this.job && this.job.executionInfo;
}

public get schedulingError() {
public get failureInfo() {
const info = this.executionInfo;
return info && info.schedulingError;
return info && info.failureInfo;
}

public get jobFailed() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
<bl-banner *ngIf="jobTimeout" type="warning">
<div message>Job timed out after running for {{jobRunningTime}}.</div>
</bl-banner>
<bl-banner *ngIf="schedulingError" type="warning">
<div message>{{schedulingError.message}}</div>
<div code>{{schedulingError.code}}</div>
<div message>{{schedulingError.message}}</div>
<div details *ngIf="schedulingError.details.size !== 0">
<div *ngFor="let entry of schedulingError.details">
<bl-banner *ngIf="failureInfo" type="warning">
<div message>{{failureInfo.message}}</div>
<div code>{{failureInfo.code}}</div>
<div message>{{failureInfo.message}}</div>
<div details *ngIf="failureInfo.details.size !== 0">
<div *ngFor="let entry of failureInfo.details">
<div>{{entry.name}}: {{entry.value}}</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { ListOrTableBase } from "app/components/base/selectable-list";
import { TableComponent } from "app/components/base/table";
import { DeleteTaskDialogComponent, TerminateTaskDialogComponent } from "app/components/task/action";
import { Task, TaskState } from "app/models";
import { SchedulingErrorDecorator } from "app/models/decorators";
import { FailureInfoDecorator } from "app/models/decorators";
import { TaskService } from "app/services";
import { DateUtils } from "app/utils";

Expand Down Expand Up @@ -46,8 +46,8 @@ export class TaskListDisplayComponent extends ListOrTableBase {
}

public taskStatusText(task: Task): string {
if (task.executionInfo && task.executionInfo.schedulingError) {
return new SchedulingErrorDecorator(task.executionInfo.schedulingError).summary;
if (task.executionInfo && task.executionInfo.failureInfo) {
return new FailureInfoDecorator(task.executionInfo.failureInfo).summary;
} else if (task.executionInfo && task.executionInfo.exitCode !== 0) {
return `Task failed with exitCode: ${task.executionInfo.exitCode}`;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { LoadingStatus } from "app/components/base/loading";
import { QuickListComponent, QuickListItemStatus } from "app/components/base/quick-list";
import { SelectableList } from "app/components/base/selectable-list";
import { SubtaskInformation, TaskState } from "app/models";
import { SchedulingErrorDecorator } from "app/models/decorators";
import { FailureInfoDecorator } from "app/models/decorators";

@Component({
selector: "bl-sub-task-display-list",
Expand Down Expand Up @@ -43,8 +43,8 @@ export class SubTaskDisplayListComponent extends SelectableList {
}

public taskStatusText(task: SubtaskInformation): string {
if (task.schedulingError) {
return new SchedulingErrorDecorator(task.schedulingError).summary;
if (task.failureInfo) {
return new FailureInfoDecorator(task.failureInfo).summary;
} else if (task.exitCode !== 0) {
return `Subtask failed with exitCode: ${task.exitCode}`;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ export class SubTaskPropertiesComponent {
@Input()
public set task(value: SubtaskInformation) {
this.decorator = new SubTaskDecorator(value || {} as any);
this.schedulingError = this.decorator.schedulingError || {};
this.failureInfo = this.decorator.failureInfo || {};
this.nodeInfo = this.decorator.nodeInfo || {};
}

public decorator: SubTaskDecorator;
public schedulingError: any;
public failureInfo: any;
public nodeInfo: any;
}
10 changes: 5 additions & 5 deletions app/components/task/details/sub-tasks/sub-task-properties.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
<bl-text-property label="Task root directory URL" [value]="nodeInfo.taskRootDirectoryUrl"></bl-text-property>
</bl-property-group>

<bl-property-group label="Scheduling Error" class="wide" *ngIf="schedulingError.exists">
<bl-text-property label="Category" [value]="schedulingError.category"></bl-text-property>
<bl-text-property label="Code" [value]="schedulingError.code"></bl-text-property>
<bl-text-property label="Message" [value]="schedulingError.message"></bl-text-property>
<bl-text-property label="Detals" [value]="schedulingError.details"></bl-text-property>
<bl-property-group label="Scheduling Error" class="wide" *ngIf="failureInfo.exists">
<bl-text-property label="Category" [value]="failureInfo.category"></bl-text-property>
<bl-text-property label="Code" [value]="failureInfo.code"></bl-text-property>
<bl-text-property label="Message" [value]="failureInfo.message"></bl-text-property>
<bl-text-property label="Detals" [value]="failureInfo.details"></bl-text-property>
</bl-property-group>
</bl-property-list>
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export class TaskConfigurationComponent {
this.exitConditionData = {
noAction,
terminateJob,
schedulingError: this._jobActionString(this._task.exitConditions.schedulingError),
failureInfo: this._jobActionString(this._task.exitConditions.failureInfo),
default: this._jobActionString(this._task.exitConditions.default),
};
}
Expand Down
2 changes: 1 addition & 1 deletion app/components/task/details/task-configuration.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
<bl-property-group label="Exit conditions" [warningMessage]="exitConditionWarningMessage" [collapsed]="true">
<bl-text-property label="Exit codes that do nothing" [value]="exitConditionData.noAction.join(', ')"></bl-text-property>
<bl-text-property label="Exit codes that terminate the job" [value]="exitConditionData.terminateJob.join(', ')"></bl-text-property>
<bl-text-property label="On scheduling error" [value]="exitConditionData.schedulingError"></bl-text-property>
<bl-text-property label="On scheduling error" [value]="exitConditionData.failureInfo"></bl-text-property>
<bl-text-property *ngIf="exitConditionData.default" label="default" [value]="exitConditionData.default"></bl-text-property>
</bl-property-group>
</bl-property-list>
60 changes: 40 additions & 20 deletions app/components/task/details/task-error-display.component.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { ChangeDetectionStrategy, Component, Input } from "@angular/core";
import { ChangeDetectionStrategy, Component, Input, OnChanges, SimpleChanges } from "@angular/core";
import { autobind } from "core-decorators";

import { SidebarManager } from "app/components/base/sidebar";
import { RerunTaskFormComponent } from "app/components/task/action";
import { Task, TaskState } from "app/models";
import { FailureInfo, Task, TaskState } from "app/models";
import { TaskService } from "app/services";
import { DateUtils, ObservableUtils } from "app/utils";

Expand All @@ -12,36 +12,40 @@ import { DateUtils, ObservableUtils } from "app/utils";
templateUrl: "task-error-display.html",
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class TaskErrorDisplayComponent {
export class TaskErrorDisplayComponent implements OnChanges {
@Input()
public jobId: string;

@Input()
public task: Task;

public hasCompleted: boolean = false;
public failureInfo: FailureInfo;
public code: number;
public hasFailureExitCode: boolean = false;
public errorMessage: string;

constructor(
private taskService: TaskService,
private sidebarManager: SidebarManager) {
}

public get hasCompleted(): boolean {
return Boolean(this.task && this.task.state === TaskState.completed);
}
public ngOnChanges(changes: SimpleChanges) {
if (changes.task) {
if (this.task) {

public get code() {
return this.task && this.task.executionInfo && this.task.executionInfo.exitCode;
}

public get hasFailureExitCode(): boolean {
return this.hasCompleted && this.code !== 0;
}

public get exitCodeMessage(): string {
if (this.task.didTimeout) {
const time: any = this.task.constraints && this.task.constraints.maxWallClockTime;
return `Task timed out after running for ${DateUtils.prettyDuration(time)}`;
} else {
return `Task completed with exit code '${this.code}'`;
const exec = this.task.executionInfo;
this.failureInfo = exec && exec.failureInfo;
this.hasCompleted = Boolean(this.task && this.task.state === TaskState.completed);
this.code = exec && this.task.executionInfo.exitCode;
this.hasFailureExitCode = this.hasCompleted && this.code !== 0;
this._computeExitCodeMessage();
} else {
this.failureInfo = null;
this.code = null;
this.hasFailureExitCode = false;
this.errorMessage = "";
}
}
}

Expand All @@ -59,4 +63,20 @@ export class TaskErrorDisplayComponent {
ref.component.jobId = this.jobId;
ref.component.setValueFromEntity(this.task);
}

private _computeExitCodeMessage() {
if (!this.failureInfo) {
this.errorMessage = "";
return;
}

if (this.task.didTimeout) {
const time: any = this.task.constraints && this.task.constraints.maxWallClockTime;
this.errorMessage = `Task timed out after running for ${DateUtils.prettyDuration(time)}`;
} else if (this.failureInfo.code === "FailureExitCode") {
this.errorMessage = `Task completed with exit code '${this.code}'`;
} else {
this.errorMessage = this.failureInfo.message;
}
}
}
7 changes: 6 additions & 1 deletion app/components/task/details/task-error-display.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<bl-banner [id]="task.id" *ngIf="hasFailureExitCode" fixMessage="Rerun task" [fix]="rerun" type="warning">
<!--<bl-banner [id]="task.id" *ngIf="hasFailureExitCode" fixMessage="Rerun task" [fix]="rerun" type="warning">
<div [other-fix]="rerunDifferent" fixMessage="Rerun with different attributes"></div>
<div message>{{exitCodeMessage}}</div>
</bl-banner>z-->
<bl-banner [id]="task.id" *ngIf="failureInfo" fixMessage="Rerun task" [fix]="rerun" type="warning">
<div code>{{failureInfo.code}}</div>
<div [other-fix]="rerunDifferent" fixMessage="Rerun with different attributes"></div>
<div message>{{errorMessage}}</div>
</bl-banner>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { SchedulingError } from "app/models";
import { FailureInfo } from "app/models";
import { DecoratorBase } from "app/utils/decorators";

export class SchedulingErrorDecorator extends DecoratorBase<SchedulingError> {
export class FailureInfoDecorator extends DecoratorBase<FailureInfo> {
public category: string;
public code: string;
public message: string;
Expand All @@ -17,7 +17,7 @@ export class SchedulingErrorDecorator extends DecoratorBase<SchedulingError> {
*/
public exists: boolean;

constructor(error: SchedulingError) {
constructor(error: FailureInfo) {
super(error);

this.exists = Boolean(error && error.category);
Expand Down
2 changes: 1 addition & 1 deletion app/models/decorators/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export * from "./application-decorator";
export * from "./cloud-service-configuration-decorator";
export * from "./compute-node-info-decorator";
export * from "./failure-info-decorator";
export * from "./image-reference-decorator";
export * from "./job-constraints-decorator";
export * from "./job-decorator";
Expand All @@ -9,7 +10,6 @@ export * from "./job-manager-task-decorator";
export * from "./job-preparation-task-decorator";
export * from "./job-release-task-decorator";
export * from "./pool-decorator";
export * from "./scheduling-error-decorator";
export * from "./start-task.decorator";
export * from "./sub-task-decorator";
export * from "./node-decorator";
Expand Down
6 changes: 3 additions & 3 deletions app/models/decorators/job-execution-info-decorator.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { JobExecutionInformation } from "app/models";
import { DecoratorBase } from "app/utils/decorators";
import { SchedulingErrorDecorator } from "./scheduling-error-decorator";
import { FailureInfoDecorator } from "./failure-info-decorator";

export class JobExecutionInfoDecorator extends DecoratorBase<JobExecutionInformation> {
public startTime: string;
public endTime: string;
public poolId: string;
public schedulingError: SchedulingErrorDecorator;
public failureInfo: FailureInfoDecorator;
public terminateReason: string;

constructor(executionInfo: JobExecutionInformation) {
Expand All @@ -15,7 +15,7 @@ export class JobExecutionInfoDecorator extends DecoratorBase<JobExecutionInforma
this.startTime = this.dateField(executionInfo.startTime);
this.endTime = this.dateField(executionInfo.endTime);
this.poolId = this.stringField(executionInfo.poolId);
this.schedulingError = new SchedulingErrorDecorator(executionInfo.schedulingError || {} as any);
this.failureInfo = new FailureInfoDecorator(executionInfo.failureInfo || {} as any);
this.terminateReason = this.stringField(executionInfo.terminateReason);
}
}
6 changes: 3 additions & 3 deletions app/models/decorators/sub-task-decorator.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { SubtaskInformation, TaskState } from "app/models";
import { DecoratorBase } from "app/utils/decorators";
import { ComputeNodeInfoDecorator } from "./compute-node-info-decorator";
import { SchedulingErrorDecorator } from "./scheduling-error-decorator";
import { FailureInfoDecorator } from "./failure-info-decorator";

export class SubTaskDecorator extends DecoratorBase<SubtaskInformation> {
public startTime: string;
Expand All @@ -14,7 +14,7 @@ export class SubTaskDecorator extends DecoratorBase<SubtaskInformation> {
public previousStateTransitionTime: string;

public nodeInfo: {};
public schedulingError: {};
public failureInfo: {};

constructor(task?: SubtaskInformation) {
super(task);
Expand All @@ -29,7 +29,7 @@ export class SubTaskDecorator extends DecoratorBase<SubtaskInformation> {
this.previousStateTransitionTime = this.dateField(task.previousStateTransitionTime);

this.nodeInfo = new ComputeNodeInfoDecorator(task.nodeInfo || {} as any);
this.schedulingError = new SchedulingErrorDecorator(task.schedulingError || {} as any);
this.failureInfo = new FailureInfoDecorator(task.failureInfo || {} as any);
}

// todo: base class ...
Expand Down
6 changes: 3 additions & 3 deletions app/models/decorators/task-execution-info-decorator.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { TaskExecutionInformation } from "app/models";
import { DecoratorBase } from "app/utils/decorators";
import { SchedulingErrorDecorator } from "./scheduling-error-decorator";
import { FailureInfoDecorator } from "./failure-info-decorator";

export class TaskExecutionInfoDecorator extends DecoratorBase<TaskExecutionInformation> {
public startTime: string;
public endTime: string;
public exitCode: string;
public schedulingError: SchedulingErrorDecorator;
public failureInfo: FailureInfoDecorator;
public retryCount: string;
public lastRetryTime: string;
public requeueCount: string;
Expand All @@ -18,7 +18,7 @@ export class TaskExecutionInfoDecorator extends DecoratorBase<TaskExecutionInfor
this.startTime = this.dateField(executionInfo.startTime);
this.endTime = this.dateField(executionInfo.endTime);
this.exitCode = this.stringField(executionInfo.exitCode);
this.schedulingError = new SchedulingErrorDecorator(executionInfo.schedulingError || {} as any);
this.failureInfo = new FailureInfoDecorator(executionInfo.failureInfo || {} as any);
this.retryCount = this.stringField(executionInfo.retryCount);
this.lastRetryTime = this.dateField(executionInfo.lastRetryTime);
this.requeueCount = this.stringField(executionInfo.requeueCount);
Expand Down
10 changes: 5 additions & 5 deletions app/models/scheduling-error.ts → app/models/failure-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ import { List } from "immutable";
import { ListProp, Model, Prop, Record } from "app/core";
import { NameValuePair, NameValuePairAttributes } from "./name-value-pair";

export interface SchedulingErrorAttributes {
export interface FailureInfoAttributes {
code: string;
category: string;
message: string;
details: NameValuePairAttributes[];
category?: string;
message?: string;
details?: NameValuePairAttributes[];
}

/**
* Job or task scheduling error.
* Possible values are https://msdn.microsoft.com/en-us/library/azure/dn878162.aspx#BKMK_JobTaskError
*/
@Model()
export class SchedulingError extends Record<SchedulingErrorAttributes> {
export class FailureInfo extends Record<FailureInfoAttributes> {
@Prop() public code: string;
@Prop() public category: string;
@Prop() public message: string;
Expand Down
Loading