Skip to content
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

295 download exec files job #305

Merged
merged 1 commit into from
Jun 16, 2016
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
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ define([
options.skipAttributes = {
name: true,
status: true,
execFiles: true,
stdout: true,
debug: true
};
Expand Down
5 changes: 1 addition & 4 deletions src/plugins/ExecutePipeline/ExecutePipeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -429,8 +429,7 @@ define([
this.outputLineCount[jobId] = actualLine + 1;
return executor.getOutput(hash, currentLine, actualLine+1)
.then(outputLines => {
var job = this.nodes[jobId],
stdout = this.core.getAttribute(job, 'stdout'),
var stdout = this.core.getAttribute(job, 'stdout'),
output = outputLines.map(o => o.output).join(''),
jobName = this.core.getAttribute(job, 'name');

Expand Down Expand Up @@ -462,15 +461,13 @@ define([
.then(stdout => {
this.core.setAttribute(job, 'stdout', stdout);
if (info.status !== 'SUCCESS') {
name = this.core.getAttribute(this.nodes[opId], 'name');
// Download all files
this.result.addArtifact(info.resultHashes[name + '-all-files']);
// Set the job to failed! Store the error
this.core.setAttribute(this.nodes[jobId], 'status', 'fail');
this.logger.info(`Setting ${jobId} status to "fail"`);
this.onPipelineComplete(`Operation "${opId}" failed! ${JSON.stringify(info)}`); // Failed
} else {
name = this.core.getAttribute(this.nodes[opId], 'name');
if (this.debug) {
this.result.addArtifact(info.resultHashes[name + '-all-files']);
}
Expand Down
Binary file modified src/seeds/minimal/minimal.webgmex
Binary file not shown.
Binary file modified src/seeds/pipeline/pipeline.webgmex
Binary file not shown.
Binary file modified src/seeds/project/project.webgmex
Binary file not shown.
26 changes: 23 additions & 3 deletions src/visualizers/panels/ForgeActionButton/Actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,24 @@ define([
};
});

////////////// Downloading files //////////////
var downloadAttrs = [
'data',
'execFiles'
],
download = {};

downloadAttrs.forEach(attr => {
download[attr] = function() {
return downloadButton.call(this, attr);
};
});

// Add download model button
var downloadButton = function() {
var downloadButton = function(attr) {
var id = this._currentNodeId,
node = this.client.getNode(id),
hash = node.getAttribute('data');
hash = node.getAttribute(attr);

if (hash) {
return '/rest/blob/download/' + hash;
Expand Down Expand Up @@ -231,7 +244,14 @@ define([
{
name: 'Download',
icon: 'play_for_work',
href: downloadButton // function to create href url
href: download.data // function to create href url
}
],
Job: [
{
name: 'Download Execution Files',
icon: 'play_for_work',
href: download.execFiles
}
],
Pipeline: [
Expand Down