Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create minimal usage example for the Pipelines API #1688

Merged
merged 2 commits into from
Feb 21, 2020

Conversation

fediazgon
Copy link
Contributor

@fediazgon fediazgon commented Feb 13, 2020

This fixes #734.

Preview at https://deploy-preview-1688--competent-brattain-de2d6d.netlify.com/docs/pipelines/tutorials/api-pipelines/

The tutorial could be easily expanded by adding a section on "How to associate a run with an experiment". But I think this one is a good start.


This change is Reviewable

@sarahmaddox sarahmaddox added the doc-sprint Issues to work on during the Kubeflow Doc Sprint label Feb 13, 2020
@sarahmaddox sarahmaddox added this to PRs in progress in doc-sprint via automation Feb 13, 2020
@sarahmaddox
Copy link
Contributor

/assign @joeliedtke

Copy link
Member

@joeliedtke joeliedtke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for working on this tutorial! This looks like it will be very helpful for any users who want to get started with the API.

@@ -0,0 +1,69 @@
+++
title = "Experiment with the Pipelines API"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Experiment with the Pipelines API -> Experiment with the Kubeflow Pipelines API

description = "Get started with the Kubeflow Pipelines API"
weight = 1
+++

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: It is a good practice to give readers an overview of what they will learn in a tutorial. Consider adding an overview like the following:

This tutorial demonstrates how to use the Kubeflow Pipelines API to build, run, and manage pipelines. This guide is recommended for users who would like to learn how to manage Kubeflow Pipelines using the REST API.


## Before you start

This tutorial assumes that you have access to the `ml-pipeline` service. If you didn’t configure Kubeflow to integrate with an identity provider, then you can port-forward directly to the service:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested revision: If you didn’t configure Kubeflow to integrate with an identity provider, then you can port-forward directly to the service:

Update to:

If Kubeflow is not configured to use an identity provider, use port-forwarding to directly access the service:

kubectl port-forward -n kubeflow svc/ml-pipeline ${SVC_PORT}:8888
```

For this tutorial, we are going to assume that the service is accessible in localhost.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally it is good to avoid "we" unless providing an opinion on behalf of the Kubeflow project. How about this:

This tutorial assumes that the service is accessible on localhost.


## Building and running a pipeline

In this example, similarly to the [Experiment with the Pipelines Samples](/docs/pipelines/tutorials/build-pipeline/) tutorial, we are going to download and compile the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested revision to avoid "we":

Follow this guide to download, compile, and run the [`sequential.py` sample pipeline](https://github.com/kubeflow/pipelines/blob/master/samples/core/sequential/sequential.py). To learn how to compile and run pipelines using the Kubeflow Pipelines SDK or a Jupyter notebook, follow the [experimenting with Kubeflow Pipelines samples tutorial](/docs/pipelines/tutorials/build-pipeline/).

EOF
) | jq -r .run.id)
```

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Would it be helpful for users to have an example of what a successful return value looks like? For example:

The response should be something like this:

example response

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added the response in the following command since it is the same. It also simplifies the command since otherwise I would need to do something like | jq | tee > dev/tty | jq -r .run.id to both save the output and show the response.

```
curl ${SVC}/apis/v1beta1/runs/${RUN_ID} | jq
```

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Would it be helpful for users to have an example of what a successful return value looks like? For example:

The response should be something like this:

example response

curl ${SVC}/apis/v1beta1/pipelines/${PIPELINE_ID} | jq
```

Then, you can trigger a run using the obtained id.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested revision:

Use the PIPELINE_ID to trigger a run of your pipeline.

) | jq -r .run.id)
```

After a while, the status of your pipeline should change to "Succeeded".
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested revision:

Run the following command occasionally to see how the status of your run changes.  After a while, the status of your pipeline should change to **Succeeded**.

curl ${SVC}/apis/v1beta1/runs/${RUN_ID} | jq
```

Please, take a look at the [Kubeflow Pipelines API Reference](docs/pipelines/reference/api/kubeflow-pipeline-api-spec/) for more information about how to use the API.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested revision(avoiding "please"):

Read the Kubeflow Pipelines API Reference to learn more about how to use the API.

@fediazgon fediazgon force-pushed the 734-pipelines-api-example branch 2 times, most recently from f88bdb5 to dfccf7c Compare February 20, 2020 16:30
@fediazgon
Copy link
Contributor Author

Thanks for the thorough review @joeliedtke. Please, have another look.

@joeliedtke
Copy link
Member

/lgtm
/approve

This is great, thanks for adding this tutorial!

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: joeliedtke

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit d32ecf0 into kubeflow:master Feb 21, 2020
doc-sprint automation moved this from PRs in progress to Done Feb 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved doc-sprint Issues to work on during the Kubeflow Doc Sprint lgtm size/L
Projects
No open projects
doc-sprint
  
Done
Development

Successfully merging this pull request may close these issues.

Create a minimal usage example for the Kubeflow Pipelines API
4 participants