From abe2f866ae9696c239627b66dbcd1ab4c35c5edb Mon Sep 17 00:00:00 2001 From: rkpattnaik780 Date: Thu, 14 Sep 2023 18:08:30 +0530 Subject: [PATCH] feat: allow users to use version suffix pipeline runs Signed-off-by: rkpattnaik780 --- elyra/pipeline/kfp/processor_kfp.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/elyra/pipeline/kfp/processor_kfp.py b/elyra/pipeline/kfp/processor_kfp.py index 7277e770a..df3e9b4c5 100644 --- a/elyra/pipeline/kfp/processor_kfp.py +++ b/elyra/pipeline/kfp/processor_kfp.py @@ -309,7 +309,15 @@ def process(self, pipeline): # Create an instance id that will be used to store # the pipelines' dependencies, if applicable - pipeline_instance_id = f"{pipeline_name}-{timestamp}" + pipeline_instance_id = "" + + # Use environment variable to set version as suffix instead of timestamp + if os.environ.get("KFP_SUFFIX_USE_VERSION") == "true": + # Version is determined by the count of existing pipeline versions + version = client.list_pipeline_versions(pipeline_id=pipeline_id).total_size + pipeline_instance_id = f"{pipeline_name}-v{version}" + else: + pipeline_instance_id = f"{pipeline_name}-{timestamp}" # Generate Python DSL from workflow pipeline_dsl = self._generate_pipeline_dsl(