From d2988c0e8247b8c6f7e6ed9d04cf3b5a5ebb57a3 Mon Sep 17 00:00:00 2001 From: Tommy Li Date: Tue, 29 Aug 2023 13:51:53 -0700 Subject: [PATCH 1/3] update new image config via env variables --- sdk/README.md | 6 ++++++ sdk/python/kfp_tekton/compiler/_op_to_template.py | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/sdk/README.md b/sdk/README.md index 792a55b2e7..1cc31d2eff 100644 --- a/sdk/README.md +++ b/sdk/README.md @@ -159,6 +159,12 @@ To pass big data using cloud provider volumes, it's recommended to use the [volume_based_data_passing_method](/sdk/python/tests/compiler/testdata/artifact_passing_using_volume.py) for both Tekton and Argo runtime. +If you want to change the input and output copy artifact images, please modify the following environment variables: + +```shell +export TEKTON_BASH_STEP_IMAGE=busybox # input and output copy artifact images +export TEKTON_COPY_RESULTS_STEP_IMAGE=library/bash # output copy results images +``` ## Running the Compiled Pipeline on a Tekton Cluster diff --git a/sdk/python/kfp_tekton/compiler/_op_to_template.py b/sdk/python/kfp_tekton/compiler/_op_to_template.py index d3671c7ff0..685b86d924 100644 --- a/sdk/python/kfp_tekton/compiler/_op_to_template.py +++ b/sdk/python/kfp_tekton/compiler/_op_to_template.py @@ -34,8 +34,8 @@ TEKTON_HOME_RESULT_PATH = "/tekton/home/tep-results/" # The image to use in basic bash steps such as copying results in multi-step. -TEKTON_BASH_STEP_IMAGE = 'busybox' -TEKTON_COPY_RESULTS_STEP_IMAGE = 'library/bash' +TEKTON_BASH_STEP_IMAGE = env.get('TEKTON_BASH_STEP_IMAGE', 'busybox') +TEKTON_COPY_RESULTS_STEP_IMAGE = env.get('TEKTON_COPY_RESULTS_STEP_IMAGE', 'library/bash') GENERATE_COMPONENT_SPEC_ANNOTATIONS = env.get('GENERATE_COMPONENT_SPEC_ANNOTATIONS', True) From 34f2611ac5c8ae42722ea94c2e1b265338ce31a7 Mon Sep 17 00:00:00 2001 From: Tommy Li Date: Thu, 31 Aug 2023 13:46:46 -0700 Subject: [PATCH 2/3] add env var for condition task image --- sdk/python/kfp_tekton/compiler/compiler.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sdk/python/kfp_tekton/compiler/compiler.py b/sdk/python/kfp_tekton/compiler/compiler.py index 3853f20399..a8a39a9084 100644 --- a/sdk/python/kfp_tekton/compiler/compiler.py +++ b/sdk/python/kfp_tekton/compiler/compiler.py @@ -52,13 +52,14 @@ DEFAULT_ARTIFACT_BUCKET = env.get('DEFAULT_ARTIFACT_BUCKET', 'mlpipeline') DEFAULT_ARTIFACT_ENDPOINT = env.get('DEFAULT_ARTIFACT_ENDPOINT', 'minio-service.kubeflow:9000') DEFAULT_ARTIFACT_ENDPOINT_SCHEME = env.get('DEFAULT_ARTIFACT_ENDPOINT_SCHEME', 'http://') +CONDITION_IMAGE_NAME = env.get('CONDITION_IMAGE_NAME', 'python:3.9.17-alpine3.18') # DISABLE_CEL_CONDITION should be True until CEL is officially merged into Tekton main API. DISABLE_CEL_CONDITION = True # Default finally extension is 5 minutes DEFAULT_FINALLY_SECONDS = 300 -def _get_super_condition_template(image_name="python:3.9.17-alpine3.18"): +def _get_super_condition_template(image_name=CONDITION_IMAGE_NAME): python_script = textwrap.dedent('''\ import sys @@ -151,7 +152,7 @@ def __init__(self, **kwargs): self.pipeline_workspaces = {} self.task_workspaces = {} self.generate_component_spec_annotations = True - self.condition_image_name = "python:3.9.17-alpine3.18" + self.condition_image_name = CONDITION_IMAGE_NAME self.bash_image_name = TEKTON_BASH_STEP_IMAGE super().__init__(**kwargs) From 112e8350ad90ddcff8bef290264828bc0363164a Mon Sep 17 00:00:00 2001 From: Tommy Li Date: Thu, 31 Aug 2023 14:03:32 -0700 Subject: [PATCH 3/3] update readme --- sdk/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/README.md b/sdk/README.md index 1cc31d2eff..fd00293226 100644 --- a/sdk/README.md +++ b/sdk/README.md @@ -164,6 +164,7 @@ If you want to change the input and output copy artifact images, please modify t ```shell export TEKTON_BASH_STEP_IMAGE=busybox # input and output copy artifact images export TEKTON_COPY_RESULTS_STEP_IMAGE=library/bash # output copy results images +export CONDITION_IMAGE_NAME=python:3.9.17-alpine3.18 # condition task default image name ``` ## Running the Compiled Pipeline on a Tekton Cluster