Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(sdk): update new image config via env variables #1336

Merged
merged 3 commits into from
Aug 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,13 @@ 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
export CONDITION_IMAGE_NAME=python:3.9.17-alpine3.18 # condition task default image name
```

## Running the Compiled Pipeline on a Tekton Cluster

Expand Down
4 changes: 2 additions & 2 deletions sdk/python/kfp_tekton/compiler/_op_to_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down
5 changes: 3 additions & 2 deletions sdk/python/kfp_tekton/compiler/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down
Loading