2020-07-09 20:19:07 +00:00
|
|
|
{{#if this.parseError}}
|
2018-08-21 19:07:45 +00:00
|
|
|
<div data-test-parse-error class="notification is-danger">
|
|
|
|
<h3 class="title is-4" data-test-parse-error-title>Parse Error</h3>
|
2020-07-09 20:19:07 +00:00
|
|
|
<p data-test-parse-error-message>{{this.parseError}}</p>
|
2018-08-21 19:07:45 +00:00
|
|
|
</div>
|
|
|
|
{{/if}}
|
2020-07-09 20:19:07 +00:00
|
|
|
{{#if this.planError}}
|
2018-08-21 19:07:45 +00:00
|
|
|
<div data-test-plan-error class="notification is-danger">
|
|
|
|
<h3 class="title is-4" data-test-plan-error-title>Plan Error</h3>
|
2020-07-09 20:19:07 +00:00
|
|
|
<p data-test-plan-error-message>{{this.planError}}</p>
|
2018-08-21 19:07:45 +00:00
|
|
|
</div>
|
|
|
|
{{/if}}
|
2020-07-09 20:19:07 +00:00
|
|
|
{{#if this.runError}}
|
2018-08-21 19:07:45 +00:00
|
|
|
<div data-test-run-error class="notification is-danger">
|
|
|
|
<h3 class="title is-4" data-test-run-error-title>Run Error</h3>
|
2020-07-09 20:19:07 +00:00
|
|
|
<p data-test-run-error-message>{{this.runError}}</p>
|
2018-08-21 19:07:45 +00:00
|
|
|
</div>
|
|
|
|
{{/if}}
|
|
|
|
|
2020-07-09 20:19:07 +00:00
|
|
|
{{#if (eq this.stage "editor")}}
|
|
|
|
{{#if (and this.showEditorMessage (eq this.context "new"))}}
|
2018-08-21 19:07:45 +00:00
|
|
|
<div class="notification is-info">
|
|
|
|
<div class="columns">
|
|
|
|
<div class="column">
|
|
|
|
<h3 class="title is-4" data-test-editor-help-title>Run a Job</h3>
|
|
|
|
<p data-test-editor-help-message>Paste or author HCL or JSON to submit to your cluster. A plan will be requested before the job is submitted.</p>
|
|
|
|
</div>
|
|
|
|
<div class="column is-centered is-minimum">
|
2020-07-09 17:30:11 +00:00
|
|
|
<button class="button is-info" onclick={{toggle-action "showEditorMessage" this}} data-test-editor-help-dismiss type="button">Okay</button>
|
2018-08-21 19:07:45 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
|
|
|
<div class="boxed-section">
|
|
|
|
<div class="boxed-section-head">
|
|
|
|
Job Definition
|
2020-07-09 20:19:07 +00:00
|
|
|
{{#if this.cancelable}}
|
|
|
|
<button class="button is-light is-compact pull-right" onclick={{action this.onCancel}} data-test-cancel-editing type="button">Cancel</button>
|
2018-08-21 23:45:53 +00:00
|
|
|
{{/if}}
|
2018-08-21 19:07:45 +00:00
|
|
|
</div>
|
|
|
|
<div class="boxed-section-body is-full-bleed">
|
2020-06-01 19:03:56 +00:00
|
|
|
<IvyCodemirror
|
2018-08-21 19:07:45 +00:00
|
|
|
data-test-editor
|
2020-07-28 17:59:14 +00:00
|
|
|
aria-label="Job definition"
|
2020-07-09 20:19:07 +00:00
|
|
|
@value={{or this.job._newDefinition this.jobSpec}}
|
|
|
|
@valueUpdated={{action (mut this.job._newDefinition)}}
|
2020-06-01 19:03:56 +00:00
|
|
|
@options={{hash
|
2018-08-21 19:07:45 +00:00
|
|
|
mode="javascript"
|
|
|
|
theme="hashi"
|
2020-07-28 17:59:14 +00:00
|
|
|
screenReaderLabel="Job definition editor"
|
2018-08-21 19:07:45 +00:00
|
|
|
tabSize=2
|
|
|
|
lineNumbers=true
|
2020-06-01 19:03:56 +00:00
|
|
|
}} />
|
2018-08-21 19:07:45 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="content is-associative">
|
2020-07-09 20:19:07 +00:00
|
|
|
<button class="button is-primary {{if this.plan.isRunning "is-loading"}}" type="button" onclick={{perform this.plan}} disabled={{or this.plan.isRunning (not this.job._newDefinition)}} data-test-plan>Plan</button>
|
2018-08-21 19:07:45 +00:00
|
|
|
</div>
|
|
|
|
{{/if}}
|
|
|
|
|
2020-07-09 20:19:07 +00:00
|
|
|
{{#if (eq this.stage "plan")}}
|
|
|
|
{{#if this.showPlanMessage}}
|
2018-08-21 19:07:45 +00:00
|
|
|
<div class="notification is-info">
|
|
|
|
<div class="columns">
|
|
|
|
<div class="column">
|
|
|
|
<h3 class="title is-4" data-test-plan-help-title>Job Plan</h3>
|
|
|
|
<p data-test-plan-help-message>This is the impact running this job will have on your cluster.</p>
|
|
|
|
</div>
|
|
|
|
<div class="column is-centered is-minimum">
|
2020-07-09 17:30:11 +00:00
|
|
|
<button class="button is-info" onclick={{toggle-action "showPlanMessage" this}} data-test-plan-help-dismiss type="button">Okay</button>
|
2018-08-21 19:07:45 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
|
|
|
<div class="boxed-section">
|
|
|
|
<div class="boxed-section-head">Job Plan</div>
|
|
|
|
<div class="boxed-section-body is-dark">
|
2020-07-09 20:19:07 +00:00
|
|
|
<JobDiff data-test-plan-output @diff={{this.planOutput.diff}} @verbose={{false}} />
|
2018-08-21 19:07:45 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2020-07-09 20:19:07 +00:00
|
|
|
<div class="boxed-section {{if this.planOutput.failedTGAllocs "is-warning" "is-primary"}}" data-test-dry-run-message>
|
2018-08-21 19:07:45 +00:00
|
|
|
<div class="boxed-section-head" data-test-dry-run-title>Scheduler dry-run</div>
|
|
|
|
<div class="boxed-section-body" data-test-dry-run-body>
|
2020-07-09 20:19:07 +00:00
|
|
|
{{#if this.planOutput.failedTGAllocs}}
|
|
|
|
{{#each this.planOutput.failedTGAllocs as |placementFailure|}}
|
2020-06-01 19:03:56 +00:00
|
|
|
<PlacementFailure @failedTGAlloc={{placementFailure}} />
|
2018-08-21 19:07:45 +00:00
|
|
|
{{/each}}
|
|
|
|
{{else}}
|
|
|
|
All tasks successfully allocated.
|
|
|
|
{{/if}}
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-07-09 20:19:07 +00:00
|
|
|
{{#if (and this.planOutput.preemptions.isFulfilled this.planOutput.preemptions.length)}}
|
2019-04-16 19:13:33 +00:00
|
|
|
<div class="boxed-section is-warning" data-test-preemptions>
|
|
|
|
<div class="boxed-section-head" data-test-preemptions-title>
|
|
|
|
Preemptions (if you choose to run this job, these allocations will be stopped)
|
|
|
|
</div>
|
|
|
|
<div class="boxed-section-body" data-test-preemptions-body>
|
2020-06-01 19:03:56 +00:00
|
|
|
<ListTable
|
2020-07-09 20:19:07 +00:00
|
|
|
@source={{this.planOutput.preemptions}}
|
2020-06-01 19:03:56 +00:00
|
|
|
@class="allocations is-isolated" as |t|>
|
|
|
|
<t.head>
|
2019-04-16 19:13:33 +00:00
|
|
|
<th class="is-narrow"></th>
|
|
|
|
<th>ID</th>
|
|
|
|
<th>Task Group</th>
|
|
|
|
<th>Created</th>
|
|
|
|
<th>Modified</th>
|
|
|
|
<th>Status</th>
|
|
|
|
<th>Version</th>
|
|
|
|
<th>Node</th>
|
2020-02-11 04:51:59 +00:00
|
|
|
<th>Volume</th>
|
2019-04-16 19:13:33 +00:00
|
|
|
<th>CPU</th>
|
|
|
|
<th>Memory</th>
|
2020-06-01 19:03:56 +00:00
|
|
|
</t.head>
|
|
|
|
<t.body as |row|>
|
|
|
|
<AllocationRow @allocation={{row.model}} @context="job" />
|
|
|
|
</t.body>
|
|
|
|
</ListTable>
|
2019-04-16 19:13:33 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
2018-08-21 19:07:45 +00:00
|
|
|
<div class="content is-associative">
|
2020-07-09 20:19:07 +00:00
|
|
|
<button class="button is-primary {{if this.submit.isRunning "is-loading"}}" type="button" onclick={{perform this.submit}} disabled={{this.submit.isRunning}} data-test-run>Run</button>
|
|
|
|
<button class="button is-light" type="button" onclick={{action this.reset}} data-test-cancel>Cancel</button>
|
2018-08-21 19:07:45 +00:00
|
|
|
</div>
|
|
|
|
{{/if}}
|