Skip to content

Commit

Permalink
Show all run outputs in dedicated tab (kubeflow#496)
Browse files Browse the repository at this point in the history
* wip, showing outputs with no labels

* showing outputs with step labels

* wip fixing tests

* fix tests

* test new functionality

* global tree

* add empty message

* pr comments
  • Loading branch information
yebrahim authored and neuromage committed Dec 13, 2018
1 parent dafbcbf commit 07a010f
Show file tree
Hide file tree
Showing 4 changed files with 294 additions and 126 deletions.
23 changes: 15 additions & 8 deletions frontend/src/lib/WorkflowParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,17 @@ export default class WorkflowParser {
// Returns a list of output paths for the entire workflow, by searching all nodes in
// the workflow, and parsing outputs for each.
public static loadAllOutputPaths(workflow: Workflow): StoragePath[] {
let outputPaths: StoragePath[] = [];
return this.loadAllOutputPathsWithStepNames(workflow).map(entry => entry.path);
}

// Returns a list of object mapping a step name to output path for the entire workflow,
// by searching all nodes in the workflow, and parsing outputs for each.
public static loadAllOutputPathsWithStepNames(workflow: Workflow): Array<{ stepName: string, path: StoragePath }> {
const outputPaths: Array<{ stepName: string, path: StoragePath }> = [];
if (workflow && workflow.status && workflow.status.nodes) {
Object.keys(workflow.status.nodes).forEach(n =>
outputPaths = outputPaths.concat(this.loadNodeOutputPaths(workflow.status.nodes[n])));
this.loadNodeOutputPaths(workflow.status.nodes[n]).map(path =>
outputPaths.push({ stepName: workflow.status.nodes[n].displayName, path })));
}

return outputPaths;
Expand All @@ -183,12 +190,12 @@ export default class WorkflowParser {
source: StorageService.GCS,
};
} else if (strPath.startsWith('minio://')) {
const pathParts = strPath.substr('minio://'.length).split('/');
return {
bucket: pathParts[0],
key: pathParts.slice(1).join('/'),
source: StorageService.MINIO,
};
const pathParts = strPath.substr('minio://'.length).split('/');
return {
bucket: pathParts[0],
key: pathParts.slice(1).join('/'),
source: StorageService.MINIO,
};
} else {
throw new Error('Unsupported storage path: ' + strPath);
}
Expand Down
Loading

0 comments on commit 07a010f

Please sign in to comment.