Giter Site home page Giter Site logo

microsoft / kubeflow-pipeline-azdo-task Goto Github PK

View Code? Open in Web Editor NEW
2.0 11.0 1.0 799 KB

Kubeflow pipeline tasks to upload pipeline, create an experiment and trigger pipeline runs both in synchronous and asynchronous way.

License: MIT License

TypeScript 100.00%

kubeflow-pipeline-azdo-task's Introduction

Pipeline Status
Code Quality Build Status
Release Build Status

Kubeflow Pipeline Azure DevOps Tasks

image info

Get it free from Azure DevOps Marketplace

Kubeflow pipeline tasks to upload pipeline, create an experiment and invoke pipeline runs both in synchronous and asynchronous way. These task can be used to achive MLOps with Kubeflow and Azure DevOps.

  1. Kubeflow Upload Pipeline
  2. Kubeflow Experiment and Run
  3. Kubeflow Experiment Run Async (Runs on agentless job and handles callback from long running pipeline runs)

1. Kubeflow Upload Pipeline Task

Azure DevOps agent job task to upload a new Kubeflow pipeline or new version of an existing pipeline to KubeFlow workspace.

Inputs

  • Kubeflow Endpoint: Kubeflow API endpoint base URL format http://yourURL/.
  • Bearer Token: Bearer token to of secured Kubeflow API. Read more on how to handle secrets in Azure DevOps pipelines.
  • Kubeflow Pipeline Upload Type: Select either to upload a new pipeline or new version.
  • Pipeline Path: The path compiled pipeline (*.tar.gz).Maximum allowed file size is 32MB.
  • New Pipeline Name: Unique name for the new pipeline.
  • Existing Pipeline Name: Name of existing pipeline when creating new version.
  • Version Name: Unique name for the new pipeline version.

Output Variables

  • kf_pipeline_id: Id for newly created pipeline.
  • kf_pipeline_name: Name of newly created pipeline.
  • kf_pipeline_version_id: Id for newly created pipeline version.
  • kf_pipeline_version_name: Name of newly created pipeline version.

2. Kubeflow Experiment and Run

Azure DevOps agent job task to create new Kubeflow experiment and run(optional) based on the pipeline uploaded in Kubeflow workspace.

Inputs

  • Kubeflow Endpoint: Kubeflow API endpoint base URL format http://yourURL/.
  • Bearer Token: Bearer token to of secured Kubeflow API. Read more on how to handle secrets in Azure DevOps pipelines.
  • Pipeline Name: Unique name of the Kubeflow pipeline to create run.
  • Use Default Version: If checked, this will use the default version of the Kubeflow pipeline provided the pipeline name.
  • Pipeline Version: Unique name of the specific pipeline version to be used for creating run.
  • Create New Pipeline Run: If checked, this will create a new pipeline run from agent job.
  • Run Name: The name of your new run. Does not have to be unique.
  • Pipeline Params: Kubeflow pipeline parameters in JSON key value format, without the square brackets {"name":"n1", "value":"v1"}, {"name":"n2", "value":"v2"}.
  • Description: This input is optional. Provides a description for your run.
  • Wait for run to complete: If checked, will wait for new run to complete. It will update the status every 15 seconds.
  • Experiment: This input allows you to either create a new experiment or use an existing experiment.
  • Experiment Name: The name of the experiment you would like your run to use. If the experiment field is set to create a new experiment, this name will need to be unique.
  • Description: The optional description of a new experiment. Does not apply to existing experiments.

Output Variables

  • kf_pipeline_id: Id of the pipeline being used to create run.
  • kf_pipeline_version_id: Id of the pipeline version being used to create run.
  • kf_experiment_id: Id of the experiment, whether newly created, or pre-existing.
  • kf_run_id: Id of the new run. Only available if you choose to create a new run.
  • kf_run_status: The end status of the run. Only available if you choose to create a new run, and wait for the run to complete.

3.Kubeflow Experiment Run Async

Azure DevOps agentless job task to create new run from without holding build agent. Some Kubeflow pipeline runs can take long time to complete and its not efficient to hold build agents for the entire duration of run. This task can be used for invoking long running pipeline runs without holding build agent. Some of the inputs required by this task are set by output variables of "Kubeflow Experiment and Run". Please refer sample implementation of this task in Azure DevOps pipeline.

Inputs

  • Kubeflow Endpoint: Kubeflow API endpoint base URL format http://yourURL/.
  • Bearer Token: Bearer token to of secured Kubeflow API. Read more on how to handle secrets in Azure DevOps pipelines.
  • Pipeline Version ID: Pipeline version Id being used to create run. Use output variable kf_pipeline_version_id set by "Kubeflow Experiment and Run" task
  • Experiment ID: Experiment Id being used to create run. Use output variable kf_experiment_id set by "Kubeflow Experiment and Run" task
  • Run Name: The name of your new run. Does not have to be unique.
  • Pipeline Params: Kubeflow pipeline parameters in JSON key value format, without the square brackets {"name":"n1", "value":"v1"}, {"name":"n2", "value":"v2"}.
  • Description: This input is optional. Provides a description for your run.
  • Wait For Completion: Waits for run to complete without holding build agent.

Implement callback to report run completion

To implement callback from Kubeflow pipelines to Azure DevOps select Wait For Completion. This will pass Kubeflow pipeline parameter named "azdocallbackinfo" with key value pairs of all required variables to make to POST signal completion to Azure DevOps.

azdocallbackinfo ={
  'JobId':'$(system.jobId)',
  'HubName':'$(system.HostType)',
  'TaskInstanceId':'$(system.TaskInstanceId)',
  'PlanId':'$(system.planId)',
  'ProjectId':'$(system.teamProjectId)',
  'PlanUri':'$(system.CollectionUri)'}

Values from the "azdocallbackinfo" parameter will be used for POST data for signaling completion to Azure DevOps

**Signal Completion POST URL**
{planUri}/{projectId}/_apis/distributedtask/hubs/{hubName}/plans/{planId}/events?api-version=2.0-preview.1
**Request Body**
 { "name": "TaskCompleted", "taskId": "taskInstanceId", "jobId": "jobId", "result": "succeeded" }

Refer sample Kubeflow pipeline implementing this call back with exit handler.

kubeflow-pipeline-azdo-task's People

Contributors

jotaylo avatar sudivate avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.