When creating a new model, it is common to set up a recurring pipeline that automatically deploys new versions of the model when they are transitioned in the model registry. This article will show you step-by-step how to do that with MLflow and Kubeflow Pipelines.

Prerequisites

Steps

  1. Navigate to the Kubeflow Central Dashboard

  2. Ensure you are in the correct namespace (e.g. “staging” or “production”)

  3. Go to “Experiments KFP” and click “+ Create Experiment”

  4. Name your experiment after your model, and click “Next”

    screenshot of the Kubeflow Central Dashboard new experiment page

    screenshot of the Kubeflow Central Dashboard new experiment page

  5. At this point, you should see the “Start a run” page. Under Run details fill out the following:

    1. Pipeline: deploy-from-mlflow
    2. Pipeline Version: deploy-from-mlflow_v0.3.0
    3. Run name: deploy-<the name of your model>
    4. Experiment: <the name of your model> (should already be set)

    Untitled

  6. Under Run type, choose “Recurring”. Then, under Run trigger set the following:

    1. Trigger type: Periodic
    2. Maximum concurrent runs: 1
    3. Has start/end date: leave unchecked
    4. Catchup: uncheck
    5. Run every: 5 minutes (or whatever interval you prefer)

    Untitled

  7. Under Run parameters, set the following:

    <aside> ℹ️ To save time, you can copy most of these examples

    </aside>

    1. model_name: <your model name>
    2. endpoint_name: the name of the KServe endpoint (usually the same as model_name)
    3. model_format: lightgbm, mlflow, onnx, paddle, pmml, pytorch, pytorch, sklearn, tensorflow, tensorrt, triton, xgboost
      1. May vary depending on environment
    4. stage: “Staging” or “Production” (case sensitive!)
    5. tracking_server_uri: https://mlflow.<your kubeflow hostname>
      1. If you have more than one environment, ask your K Flow technical rep which hostname should be used
    6. bucket: Depends on your environment
      1. e.g. kflow-eks-dev-kserve
    7. transformer_args: Any additional CLI args for your
      1. You may also include “{run_id}” as a template variable
    8. transformer_git_repo_url: URL for the git repo where your transformer code is stored
    9. transformer_git_secret_namespace: namespace where your git-credentials are stored
      1. Should match the namespace for the recurring run
    10. transformer_git_auth_type: “https” or “ssh”
    11. transformer_subpath: path within the transformer git project to look for transformer code. Leave blank to scan at the root and use the 1st one found.

Untitled

  1. Finally, click “Start”