Pathi_rao
Pathi_rao

Reputation: 93

How to dynamically update package versions in kfp components

I am currently building components using the kubeflow python SDK and was wondering if there is a away to dynamically update package versions. For example, the packages are installed based on their latest version like,

from kfp import dsl


@dsl.component(packages_to_install=["google-cloud-secret-manager", "paramiko", "gcsfs"])

One thing that I can do is specify the exact version like,

from kfp import dsl


@dsl.component(packages_to_install=["google-cloud-secret-manager==2.20.0", "paramiko==3.4.0", "gcsfs==2024.3.1"])

But downside is that we have to manage them manually over multiple components.

A workaround I figured is to create a requirements.txt file and pass the packages from this file to the components. This way, either the file has to be updated once or it can be automated using renovate/dependabot.

I would like to know, how I can make this better? Do you have any further improvements or best-practices that I can implement?

Upvotes: 0

Views: 95

Answers (0)

Related Questions