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.
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.
Advertisement
Answer
You can use {{workflow.annotations.pipelines.kubeflow.org/run_name}}
argo variable to get the run_name
For example,
JavaScript
x
11
11
1
@func_to_container_op
2
def dummy(run_id, run_name) -> str:
3
return run_id, run_name
4
5
@dsl.pipeline(
6
name='test_pipeline',
7
)
8
def test_pipeline():
9
dummy('{{workflow.labels.pipeline/runid}}', '{{workflow.annotations.pipelines.kubeflow.org/run_name}}')
10
11
You will find that the placeholders will be replaced with the correct run_id and run_name.