Skip to main content

The toolbox for kfp (Kubeflow Pipelines SDK)

Project description

kfp-toolbox

kfp-toolbox is a Python library that provides useful tools for kfp (Kubeflow Pipelines SDK).

PyPI PyPI - Python Version Python Tests codecov

Installation

pip install kfp-toolbox

Usage

spec

from kfp_toolbox import spec

The spec decorator specifies the computing resources to be used by the component.

To apply this to a Python function-based component, it must be added outside of the component decorator.

@spec(cpu="2", memory="16G")
@dsl.component
def component_function():
    ...

For other components, wrap the component as a function.

component = kfp.components.load_component_from_file("path/to/component.yaml")
component = spec(cpu="2", memory="16G")(component)

If multiple spec decorators are stacked, the one placed further out will take precedence. For example, suppose you have created an alias default_spec. If you want to overwrite part of it, place a new spec decorator outside of the default_spec decorator to overwrite it.

default_spec = spec(cpu="2", memory="16G")

@spec(cpu="1")
@default_spec
@dsl.component
def component_function():
    ...

See all available options here:

option type description examples
name str Display name "Component NAME"
cpu str CPU limit "1", "500m", ... ("m" means 1/1000)
memory str Memory limit "512K", "16G", ...
gpu str GPU limit "1", "2", ...
accelerator str Accelerator type "NVIDIA_TESLA_K80", "TPU_V3", ...
caching bool Enable caching True or False

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kfp-toolbox-0.1.0.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

kfp_toolbox-0.1.0-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file kfp-toolbox-0.1.0.tar.gz.

File metadata

  • Download URL: kfp-toolbox-0.1.0.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.10.4 Linux/5.13.0-1021-azure

File hashes

Hashes for kfp-toolbox-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5fed8648ebe8f9b874b17aeb95a9743187279d979787359d4d17abc8590daf0d
MD5 9529fd2cbc0f1fd61ca0e92e8a8ad6ec
BLAKE2b-256 a3ee92cdcd98420ed022ef0231b6309abdeebb4d565b1a0edd9800b8b4746852

See more details on using hashes here.

File details

Details for the file kfp_toolbox-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: kfp_toolbox-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.10.4 Linux/5.13.0-1021-azure

File hashes

Hashes for kfp_toolbox-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6c808ad541a6bd6a12f9a8ebda3152b05106717b7cef79522789c42e29f4631d
MD5 737d3c3a1750c6e250aa0694709a28b3
BLAKE2b-256 9482d838ee423c9a6abad0df12567c2eec75c91f7d26f9a0b71ecc8a022685de

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page