Skip to content

Commit

Permalink
Merge branch 'master' into 481-stop-running-jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
brollb committed Aug 3, 2016
2 parents c6d4bc2 + a8e5876 commit a20b81c
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/plugins/ExecuteJob/ExecuteJob.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ define([
}

this._callback = callback;
this.currentForkName = null;
this.prepare()
.then(() => this.executeJob(this.activeNode));
};
Expand Down Expand Up @@ -112,6 +113,7 @@ define([
var msg;
if (result.status === STORAGE_CONSTANTS.FORKED) {
msg = `"${name}" execution has forked to "${result.forkName}"`;
this.currentForkName = result.forkName;
this.sendNotification(msg);
}
});
Expand Down Expand Up @@ -247,6 +249,10 @@ define([
this.logger.info(`Setting ${name} (${jobId}) status to ${status}`);
this.clearOldMetadata(job);

if (this.currentForkName) {
// notify client that the job has completed
this.sendNotification(`"${name}" execution completed on branch "${this.currentForkName}"`);
}
if (err) {
this.core.setAttribute(exec, 'status', 'failed');
} else if (this.canceled) {
Expand Down
7 changes: 7 additions & 0 deletions src/plugins/ExecutePipeline/ExecutePipeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ define([
}

this._callback = callback;
this.currentForkName = null;

startPromise
.then(() => this.core.loadSubTree(this.activeNode))
Expand Down Expand Up @@ -140,6 +141,7 @@ define([
.then(result => {
var msg;
if (result.status === STORAGE_CONSTANTS.FORKED) {
this.currentForkName = result.forkName;
msg = `"${this.pipelineName}" execution has forked to "${result.forkName}"`;
this.sendNotification(msg);
}
Expand Down Expand Up @@ -307,6 +309,11 @@ define([
msg += 'finished!';
}

if (this.currentForkName) {
// notify client that the job has completed
this.sendNotification(`"${this.pipelineName}" execution completed on branch "${this.currentForkName}"`);
}

this.logger.debug(`Pipeline "${name}" complete!`);
this.core.setAttribute(this.activeNode, 'status',
(this.pipelineError ? 'failed' : (this.canceled ? 'canceled' : 'success')));
Expand Down
3 changes: 3 additions & 0 deletions src/visualizers/panels/ForgeActionButton/Actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ define([
name: `Return to ${fromType}`,
icon: 'input',
priority: 2,
color: 'teal',
filter: () => {
return DeepForge.last[fromType];
},
Expand All @@ -112,6 +113,7 @@ define([
name: `Delete ${type} Definition`,
icon: 'delete',
priority: 1,
color: 'red',
action: function() {
// Delete and go to the last pipeline?
var node = this.client.getNode(this._currentNodeId),
Expand Down Expand Up @@ -139,6 +141,7 @@ define([
name: 'Restart ' + name,
icon: 'replay',
priority: 1000,
color: 'green',
action: function(event) {
this.runExecutionPlugin(pluginId, event.shiftKey);
}
Expand Down
1 change: 1 addition & 0 deletions src/visualizers/panels/ForgeActionButton/PluginConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
},
"ExecutePipeline": {
"icon": "play_arrow",
"color": "green",
"priority": 1
},
"ImportTorch": {
Expand Down

0 comments on commit a20b81c

Please sign in to comment.