Skip to content

Commit

Permalink
Update check status API name
Browse files Browse the repository at this point in the history
  • Loading branch information
jinchihe committed Dec 18, 2019
1 parent f448d5f commit 032e8af
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions sdk/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ Class | Method | Description
[TFJobClient](docs/TFJobClient.md) | [wait_for_job](docs/TFJobClient.md#wait_for_job) | Wait for the specified job to finish |
[TFJobClient](docs/TFJobClient.md) | [wait_for_condition](docs/TFJobClient.md#wait_for_condition) | Waits until any of the specified conditions occur |
[TFJobClient](docs/TFJobClient.md) | [get_job_status](docs/TFJobClient.md#get_job_status) | Get the TFJob status|
[TFJobClient](docs/TFJobClient.md) | [if_job_running](docs/TFJobClient.md#if_job_running) | Check if the TFJob running |
[TFJobClient](docs/TFJobClient.md) | [if_job_succeeded](docs/TFJobClient.md#if_job_succeeded) | Check if the TFJob Succeeded |
[TFJobClient](docs/TFJobClient.md) | [is_job_running](docs/TFJobClient.md#is_job_running) | Check if the TFJob status is Running |
[TFJobClient](docs/TFJobClient.md) | [is_job_succeeded](docs/TFJobClient.md#is_job_succeeded) | Check if the TFJob status is Succeeded |

## Documentation For Models

Expand Down
16 changes: 8 additions & 8 deletions sdk/python/docs/TFJobClient.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ TFJobClient | [delete](#delete) | Delete the specified TFJob |
TFJobClient | [wait_for_job](#wait_for_job) | Wait for the specified job to finish |
TFJobClient | [wait_for_condition](#wait_for_condition) | Waits until any of the specified conditions occur |
TFJobClient | [get_job_status](#get_job_status) | Get the TFJob status|
TFJobClient | [if_job_running](#if_job_running) | Check if the TFJob running |
TFJobClient | [if_job_succeeded](#if_job_succeeded) | Check if the TFJob Succeeded |s
TFJobClient | [is_job_running](#is_job_running) | Check if the TFJob status is running |
TFJobClient | [is_job_succeeded](#is_job_succeeded) | Check if the TFJob status is Succeeded |

## create
> create(tfjob, namespace=None)
Expand Down Expand Up @@ -262,8 +262,8 @@ namespace | str | The tfjob's namespace. Defaults to current or default namespac
### Return type
Str

## if_job_running
> if_job_running(name, namespace=None)
## is_job_running
> is_job_running(name, namespace=None)
Returns True if the TFJob running; false otherwise.

Expand All @@ -273,7 +273,7 @@ Returns True if the TFJob running; false otherwise.
from kubeflow.tfjob import TFJobClient

tfjob_client = TFJobClient()
tfjob_client.if_job_running('mnist', namespace='kubeflow')
tfjob_client.is_job_running('mnist', namespace='kubeflow')
```

### Parameters
Expand All @@ -285,8 +285,8 @@ namespace | str | The tfjob's namespace. Defaults to current or default namespac
### Return type
Bool

## if_job_succeeded
> if_job_succeeded(name, namespace=None)
## is_job_succeeded
> is_job_succeeded(name, namespace=None)
Returns True if the TFJob succeeded; false otherwise.

Expand All @@ -296,7 +296,7 @@ Returns True if the TFJob succeeded; false otherwise.
from kubeflow.tfjob import TFJobClient

tfjob_client = TFJobClient()
tfjob_client.if_job_succeeded('mnist', namespace='kubeflow')
tfjob_client.is_job_succeeded('mnist', namespace='kubeflow')
```

### Parameters
Expand Down
2 changes: 1 addition & 1 deletion sdk/python/examples/kubeflow-tfjob-sdk.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@
}
],
"source": [
"tfjob_client.if_job_succeeded('mnist', namespace=namespace)"
"tfjob_client.is_job_succeeded('mnist', namespace=namespace)"
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions sdk/python/kubeflow/tfjob/api/tf_job_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ def get_job_status(self, name, namespace=None):
return last_condition.get("type", "")


def if_job_running(self, name, namespace=None):
def is_job_running(self, name, namespace=None):
"""Returns true if the TFJob running; false otherwise.
Args:
Expand All @@ -278,7 +278,7 @@ def if_job_running(self, name, namespace=None):
return tfjob_status.lower() == "running"


def if_job_succeeded(self, name, namespace=None):
def is_job_succeeded(self, name, namespace=None):
"""Returns true if the TFJob succeeded; false otherwise.
Args:
Expand Down
2 changes: 1 addition & 1 deletion sdk/python/test/test_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def test_sdk_e2e():
TFJOB_CLIENT.create(tfjob, namespace=SDK_TEST_NAMESPACE)

TFJOB_CLIENT.wait_for_job("mnist-ci-test", namespace=SDK_TEST_NAMESPACE)
if not TFJOB_CLIENT.if_job_succeeded("mnist-ci-test", namespace=SDK_TEST_NAMESPACE):
if not TFJOB_CLIENT.is_job_succeeded("mnist-ci-test", namespace=SDK_TEST_NAMESPACE):
raise RuntimeError("The TFJob is not succeeded.")

TFJOB_CLIENT.delete("mnist-ci-test", namespace=SDK_TEST_NAMESPACE)

0 comments on commit 032e8af

Please sign in to comment.