Skip to content
This repository has been archived by the owner on Feb 1, 2022. It is now read-only.

add xgboost job python sdk #102

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions sdk/python/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/
venv/
.python-version

# Translations
*.mo
*.pot

# Django stuff:
*.log

# Sphinx documentation
docs/_build/

# PyBuilder
target/

#Ipython Notebook
.ipynb_checkpoints

# Add more useless files
tox.ini
test-requirements.txt
git_push.sh
.travis.yml
.swagger-codegen
.swagger-codegen-ignore

2 changes: 2 additions & 0 deletions sdk/python/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
approvers:
- jinchihe
59 changes: 59 additions & 0 deletions sdk/python/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Kubeflow XGBJob SDK
Python SDK for XGB-Operator

## Requirements.

Python 2.7 and 3.5+

## Installation & Usage
### pip install

```sh
pip install kubeflow-xgbjob
```

Then import the package:
```python
from kubeflow import xgbjob
```

### Setuptools

Install via [Setuptools](http://pypi.python.org/pypi/setuptools).

```sh
python setup.py install --user
```
(or `sudo python setup.py install` to install the package for all users)


## Getting Started

Please follow the [sample](examples/kubeflow-xgbjob-sdk.ipynb) to create, update and delete XGBJob.

## Documentation for API Endpoints

Class | Method | Description
Copy link
Member

Choose a reason for hiding this comment

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

Where are these markdown files?

------------ | ------------- | -------------
[XGBJobClient](docs/XGBJobClient.md) | [create](docs/XGBJobClient.md#create) | Create XGBJob|
[XGBJobClient](docs/XGBJobClient.md) | [get](docs/XGBJobClient.md#get) | Get or watch the specified XGBJob or all XGBJob in the namespace |
[XGBJobClient](docs/XGBJobClient.md) | [patch](docs/XGBJobClient.md#patch) | Patch the specified XGBJob|
[XGBJobClient](docs/XGBJobClient.md) | [delete](docs/XGBJobClient.md#delete) | Delete the specified XGBJob |
[XGBJobClient](docs/XGBJobClient.md) | [wait_for_job](docs/XGBJobClient.md#wait_for_job) | Wait for the specified job to finish |
[XGBJobClient](docs/XGBJobClient.md) | [wait_for_condition](docs/XGBJobClient.md#wait_for_condition) | Waits until any of the specified conditions occur |
[XGBJobClient](docs/XGBJobClient.md) | [get_job_status](docs/XGBJobClient.md#get_job_status) | Get the XGBJob status|
[XGBJobClient](docs/XGBJobClient.md) | [is_job_running](docs/XGBJobClient.md#is_job_running) | Check if the XGBJob status is Running |
[XGBJobClient](docs/XGBJobClient.md) | [is_job_succeeded](docs/XGBJobClient.md#is_job_succeeded) | Check if the XGBJob status is Succeeded |
[XGBJobClient](docs/XGBJobClient.md) | [get_pod_names](docs/XGBJobClient.md#get_pod_names) | Get pod names of XGBJob |
[XGBJobClient](docs/XGBJobClient.md) | [get_logs](docs/XGBJobClient.md#get_logs) | Get training logs of the XGBJob |

## Documentation For Models

- [V1JobCondition](docs/V1JobCondition.md)
- [V1JobStatus](docs/V1JobStatus.md)
- [V1ReplicaSpec](docs/V1ReplicaSpec.md)
- [V1ReplicaStatus](docs/V1ReplicaStatus.md)
- [V1XGBJob](docs/V1XGBJob.md)
- [V1XGBJobList](docs/V1XGBJobList.md)
- [V1XGBJobSpec](docs/V1XGBJobSpec.md)

1 change: 1 addition & 0 deletions sdk/python/kubeflow/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
34 changes: 34 additions & 0 deletions sdk/python/kubeflow/xgbjob/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# coding: utf-8

# flake8: noqa

"""
xgbjob

Python SDK for XGB-Operator # noqa: E501

OpenAPI spec version: v0.1

Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


from __future__ import absolute_import

# import utils and constants
from kubeflow.xgbjob.utils import utils
from kubeflow.xgbjob.constants import constants

# import ApiClient
from kubeflow.xgbjob.api_client import ApiClient
from kubeflow.xgbjob.configuration import Configuration
from kubeflow.xgbjob.api.xgb_job_client import XGBJobClient

# import models into sdk package
from kubeflow.xgbjob.models.v1_job_condition import V1JobCondition
from kubeflow.xgbjob.models.v1_job_status import V1JobStatus
from kubeflow.xgbjob.models.v1_replica_spec import V1ReplicaSpec
from kubeflow.xgbjob.models.v1_replica_status import V1ReplicaStatus
from kubeflow.xgbjob.models.v1_xgb_job import V1XGBJob
from kubeflow.xgbjob.models.v1_xgb_job_list import V1XGBJobList
from kubeflow.xgbjob.models.v1_xgb_job_spec import V1XGBJobSpec
19 changes: 19 additions & 0 deletions sdk/python/kubeflow/xgbjob/api/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2019 kubeflow.org.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import absolute_import

# flake8: noqa

# import apis into api package
Loading