1

I'm working with Kubeflow pipelines. I would like to access the "Run name" from inside the a task component. For example in the below image the run name is "My first XGBoost run" - as seen in the title.

enter image description here

I know for example it's possible to obtain the workflow ID by passing the parameter {{workflow.uid}} as a command line argument. I have also tried the Argo variable {{ workflow.name }} but this doesn't give the correct string.

joshlk
  • 1,499
  • 3
  • 20
  • 33

2 Answers2

2

You can use {{workflow.annotations.pipelines.kubeflow.org/run_name}} argo variable to get the run_name

For example,

@func_to_container_op
def dummy(run_id, run_name) -> str:
    return run_id, run_name

@dsl.pipeline(
    name='test_pipeline',
)
def test_pipeline():
  dummy('{{workflow.labels.pipeline/runid}}', '{{workflow.annotations.pipelines.kubeflow.org/run_name}}')

You will find that the placeholders will be replaced with the correct run_id and run_name.

Jack Lin
  • 56
  • 4
0

Currently KFP does not support this kind of introspection.

Can you please describe a scenario where this is needed?

Ark-kun
  • 6,358
  • 2
  • 34
  • 70
  • In the task I want to log information to an external DB. Having the "run name" would allows the user to more easily know which run produced which bit of data. Currently this is done using uid. Also the run name usual has information in it which identifies the type of run and what data is run on ect. – joshlk Sep 17 '20 at 12:53