How to get the id of the run from within a component?

7/15/2019

I'm doing some experimentation with Kubeflow Pipelines and I'm interested in retrieving the run id to save along with some metadata about the pipeline execution. Is there any way I can do so from a component like a ContainerOp?

-- DSF
kubeflow
kubeflow-pipelines
kubernetes

2 Answers

7/15/2019

I tried to do this using the Python's DSL but seems that isn't possible right now.

The only option that I found is to use the method that they used in this sample code. You basically declare a string containing {{workflow.uid}}. It will be replaced with the actual value during execution time.

You can also do this in order to get the pod name, it would be {{pod.name}}.

-- Gabriel Bessa
Source: StackOverflow

1/9/2020

You can use kfp.dsl.EXECUTION_ID_PLACEHOLDER and kfp.dsl.RUN_ID_PLACEHOLDER as arguments for your component. At runtime they will be replaced with the actual values.

-- Ark-kun
Source: StackOverflow