Skip to content

Commit

Permalink
feat(frontend): integrate with TFX 1.2.0 metadata & visualization, no…
Browse files Browse the repository at this point in the history
… longer support previous versions. Part of #6138 (#6388)
  • Loading branch information
Bobgy authored Aug 19, 2021
1 parent 0511983 commit d077e6e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
4 changes: 2 additions & 2 deletions frontend/src/mlmd/MlmdUtils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ V2_CONTEXT.setName(RUN_ID);
V2_CONTEXT.setType('system.PipelineRun');

const TFX_CONTEXT = new Context();
TFX_CONTEXT.setName('run.run-st448');
TFX_CONTEXT.setType('run');
TFX_CONTEXT.setName('run-st448');
TFX_CONTEXT.setType('pipeline_run');

const V1_CONTEXT = new Context();
V1_CONTEXT.setName(WORKFLOW_NAME);
Expand Down
16 changes: 5 additions & 11 deletions frontend/src/mlmd/MlmdUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,9 @@ async function getContext({ type, name }: { type: string; name: string }): Promi
* @throws error when network error, or not found
*/
async function getTfxRunContext(argoWorkflowName: string): Promise<Context> {
// argoPodName has the general form "pipelineName-workflowId-executionId".
// All components of a pipeline within a single run will have the same
// "pipelineName-workflowId" prefix.
const pipelineName = argoWorkflowName
.split('-')
.slice(0, -1)
.join('_');
const runID = argoWorkflowName;
// An example run context name is parameterized_tfx_oss.parameterized-tfx-oss-4rq5v.
const tfxRunContextName = `${pipelineName}.${runID}`;
return await getContext({ name: tfxRunContextName, type: 'run' });
// Context: https://github.com/kubeflow/pipelines/issues/6138
// Require TFX version to be >= 1.2.0.
return await getContext({ name: argoWorkflowName, type: 'pipeline_run' });
}

/**
Expand Down Expand Up @@ -155,6 +147,8 @@ export const ExecutionHelpers = {
getStringProperty(execution, ExecutionProperties.NAME) ||
getStringProperty(execution, ExecutionProperties.COMPONENT_ID) ||
getStringProperty(execution, ExecutionCustomProperties.TASK_ID, true) ||
// TFX 1.2.0 executions do not have any of the above, adding pod name as a fallback name
getStringProperty(execution, KfpExecutionProperties.KFP_POD_NAME, true) ||
'(No name)'}`;
},
getState(execution: Execution): string | number | undefined {
Expand Down

0 comments on commit d077e6e

Please sign in to comment.