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

Add more APIs for TFJob done #1116

Merged
merged 1 commit into from
Dec 18, 2019
Merged

Add more APIs for TFJob done #1116

merged 1 commit into from
Dec 18, 2019

Conversation

jinchihe
Copy link
Member

@jinchihe jinchihe commented Dec 16, 2019

From feedback of the kubeflow-tfjob SDK, add more APIs (some of them are ehanced from py/kubeflow/tf_operator/tf_job_client.py):

  • wait_for_job: Wait for the specified job to finish
  • wait_for_condition: Waits until any of the specified conditions occur
  • get_job_status: Quick way to get the TFJob status
  • if_job_running: Quick way to check if the TFJob running
  • if_job_succeeded: Quick way to check if the TFJob Succeeded

This change is Reviewable

@coveralls
Copy link

coveralls commented Dec 16, 2019

Coverage Status

Coverage remained the same at 96.512% when pulling 4898d49 on jinchihe:add_more_apis into 0267710 on kubeflow:master.

@TravisBuddy
Copy link

Hey @jinchihe,
Your changes look good to me!

View build log

TravisBuddy Request Identifier: f7ebde60-1fea-11ea-ba47-7f442aed9c1e

@TravisBuddy
Copy link

Hey @jinchihe,
Your changes look good to me!

View build log

TravisBuddy Request Identifier: e8a337b0-2098-11ea-830b-038034041c48

@TravisBuddy
Copy link

Hey @jinchihe,
Your changes look good to me!

View build log

TravisBuddy Request Identifier: 67b92220-209a-11ea-830b-038034041c48

@TravisBuddy
Copy link

Hey @jinchihe,
Your changes look good to me!

View build log

TravisBuddy Request Identifier: 25ada500-209e-11ea-830b-038034041c48

@TravisBuddy
Copy link

Hey @jinchihe,
Your changes look good to me!

View build log

TravisBuddy Request Identifier: acedae30-20a2-11ea-830b-038034041c48

@TravisBuddy
Copy link

Hey @jinchihe,
Your changes look good to me!

View build log

TravisBuddy Request Identifier: b4826360-20a8-11ea-830b-038034041c48

@jinchihe
Copy link
Member Author

/retest

@TravisBuddy
Copy link

Hey @jinchihe,
Your changes look good to me!

View build log

TravisBuddy Request Identifier: fc17bd30-213c-11ea-a044-67124c782b74

@jinchihe
Copy link
Member Author

/retest

@jinchihe jinchihe changed the title WIP: add API to wait for TFJob done Add more APIs for TFJob done Dec 18, 2019
@jinchihe
Copy link
Member Author

/cc @gaocegege @johnugeorge
Could you please take a look? Thanks a lot!


Args:
name: The TFJob name.
namespace: defaults to current or default namespace.
Copy link
Member

Choose a reason for hiding this comment

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

current or default?

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks Ce! Yes, will get the current namespace if running in the cluster from /var/run/secrets/kubernetes.io/serviceaccount/namespace, otherwise will get the default namespace. please see below for the logic, thanks.

https://github.com/kubeflow/tf-operator/blob/0267710c69f2f92e4a65db597f7ee0d2e734462f/sdk/python/kubeflow/tfjob/utils/utils.py#L26

Copy link
Member

Choose a reason for hiding this comment

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

SGTM.

@gaocegege
Copy link
Member

@jinchihe
Thanks for your contribution! 🎉 👍

Generally LGTM

@gaocegege
Copy link
Member

/lgtm

@johnugeorge
Copy link
Member

/approve

@k8s-ci-robot
Copy link

[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:

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 f448d5f into kubeflow:master Dec 18, 2019
@jinchihe
Copy link
Member Author

Thanks @gaocegege and @johnugeorge

@jinchihe jinchihe deleted the add_more_apis branch December 18, 2019 05:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants