kubeflow / pytorch-operator

PyTorch on Kubernetes
Apache License 2.0
306 stars 143 forks source link

Add watch function for PyTorchJob python Client API #246

Closed jinchihe closed 4 years ago

jinchihe commented 4 years ago

Add watch function for the PyTorchJob python API to watch key info, such as status, like kubeflow get pytorchjob. The PR is going to add watch function (added one more option watch=Flase) for PyTorchJob python Client get() and waiting_for_job() API, as below:

pytorch_client = PyTorchJobClient()
pytorch_client.wait_for_job('pytorch-dist-mnist-gloo', watch=True)
NAME                           STATE                TIME                          
pytorch-dist-mnist-gloo        Created              2020-01-02T09:37:48Z          
pytorch-dist-mnist-gloo        Running              2020-01-02T09:37:58Z          
pytorch-dist-mnist-gloo        Running              2020-01-02T09:37:58Z          
pytorch-dist-mnist-gloo        Running              2020-01-02T09:37:58Z          
pytorch-dist-mnist-gloo        Running              2020-01-02T09:37:58Z          
pytorch-dist-mnist-gloo        Running              2020-01-02T09:37:58Z          
pytorch-dist-mnist-gloo        Running              2020-01-02T09:37:58Z          
pytorch-dist-mnist-gloo        Succeeded            2020-01-02T09:42:47Z          

Due to CI tests failed while verifying code-gen, I also updated related files. Thanks.

review-notebook-app[bot] commented 4 years ago

Check out this pull request on  ReviewNB

You'll be able to see Jupyter notebook diff and discuss changes. Powered by ReviewNB.

coveralls commented 4 years ago

Coverage Status

Coverage remained the same at 22.97% when pulling d5394950b37ad77383c07f8f599623a36a8894ba on jinchihe:add_watch_api into f117363c81dc51d5407ea40a3affe1c6eadd2477 on kubeflow:master.

johnugeorge commented 4 years ago

Can you make similar changes that you added for tf operator?

jinchihe commented 4 years ago

Can you make similar changes that you added for tf operator?

Yes, I'm going to do similar functions as for TFJob Python API. Thanks @johnugeorge

johnugeorge commented 4 years ago

Once you remove WIP status, I can review. Thanks for your contribution

jinchihe commented 4 years ago

Once you remove WIP status, I can review.

@johnugeorge Great thanks! That's ready for reviewing now.

johnugeorge commented 4 years ago

Thanks /lgtm

johnugeorge commented 4 years ago

/approve

k8s-ci-robot commented 4 years ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: johnugeorge

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: - ~~[OWNERS](https://github.com/kubeflow/pytorch-operator/blob/master/OWNERS)~~ [johnugeorge] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment