Skip to content

Commit

Permalink
Merge pull request #915 from revit13/ipsecrets
Browse files Browse the repository at this point in the history
Add image_pull_secrets paameter to add_settings_to_comp for kfp v2
  • Loading branch information
roytman authored Jan 6, 2025
2 parents f7f5fb2 + e4c7af6 commit 80e0374
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,15 @@ def add_settings_to_component(
task: dsl.PipelineTask,
timeout: int,
image_pull_policy: str = "IfNotPresent",
image_pull_secrets: list = [],
cache_strategy: bool = False,
) -> None:
"""
Add settings to kfp task
:param task: kfp task
:param timeout: timeout to set to the component in seconds
:param image_pull_policy: pull policy to set to the component
:param image_pull_secrets: list of secrets containing the credentials to pull the task image.
:param cache_strategy: cache strategy
"""

Expand Down Expand Up @@ -92,6 +94,10 @@ def _add_node_selector() -> None:
task.set_caching_options(enable_caching=cache_strategy)
# image pull policy
kubernetes.set_image_pull_policy(task, image_pull_policy)
# image pull secret can only be set at the component level in kfp v2
# see: https://github.com/kubeflow/pipelines/issues/11498
if len(image_pull_secrets) != 0:
kubernetes.set_image_pull_secrets(task, image_pull_secrets)
# Set the timeout for the task to one day (in seconds)
kubernetes.set_timeout(task, seconds=timeout)
# Add tolerations if specified
Expand Down

0 comments on commit 80e0374

Please sign in to comment.