canonical / charmed-kubeflow-uats

Automated UATs for Charmed Kubeflow
Apache License 2.0
6 stars 2 forks source link

Update `e2e-wine` UAT for Kubeflow 1.9 #85

Closed misohu closed 2 weeks ago

misohu commented 1 month ago

Context

For the Kubeflow 1.9 we must update e2e-wine UAT because it uses Seldon to deploy the trained model. With Kubeflow 1.9 seldon wont be part of the bundle.

While we are working on this we should also use kfp v2 SDK in the test rather then the older v1.

What needs to get done

  1. Use Kserve for serving model in e2e-wine UAT for Kubeflow 1.9
  2. Use kfp v2 SDK in e2e-wine UAT for Kubeflow 1.9

Definition of Done

  1. UAT is updated
  2. Tests are passing (manual, AKS, EKS)
syncronize-issues-to-jira[bot] commented 1 month ago

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/KF-5995.

This message was autogenerated

misohu commented 2 weeks ago

Closed with https://github.com/canonical/charmed-kubeflow-uats/pull/104

Key things I have learned:

Example:

@component(
    base_image="python:3.11",  # Use Python 3.11 base image
    packages_to_install=["requests==2.32.3", "pandas==2.2.2"]
)
def download_dataset(url: str, dataset_path: OutputPath('Dataset')) -> None:
    # Import necessary packages within the function
    import requests
    import pandas as pd

    # Download the dataset from the provided URL
    response = requests.get(url)
    response.raise_for_status()

Passing Data Between Steps:

Example:

@pipeline(name='download-preprocess-train-deploy-pipeline')
def download_preprocess_train_deploy_pipeline(url: str):
    # Step 1: Download the dataset from the URL
    download_task = download_dataset(url=url)

    # Step 2: Preprocess the downloaded dataset
    preprocess_task = preprocess_dataset(
        dataset=download_task.outputs['dataset_path']
    )

Note: Most online resources focus on KFP v1, so I highly recommend consulting the official documentation for KFP v2.5.0, which is compatible with our kserve 0.13.1 SDK due to the protobuf requirement conflict. You can find the relevant documentation here.