Skip to content

Commit beb7b29

Browse files
merlintanghcho3
authored andcommitted
Add tutorial for distributed training and batch prediction with Kubernetes (dmlc#4621)
* provide the readme * update for format * reformat * reformat -2 * update again * update format * update w.r.t yinlou's comments * Add kubernetes tutorial to Table of Contents * Style edit
1 parent 3e339d9 commit beb7b29

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

doc/tutorials/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ See `Awesome XGBoost <https://github.com/dmlc/xgboost/tree/master/demo>`_ for mo
1111

1212
model
1313
Distributed XGBoost with AWS YARN <aws_yarn>
14+
kubernetes
1415
Distributed XGBoost with XGBoost4J-Spark <https://xgboost.readthedocs.io/en/latest/jvm/xgboost4j_spark_tutorial.html>
1516
dart
1617
monotonic

doc/tutorials/kubernetes.rst

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
###################################
2+
Distributed XGBoost with Kubernetes
3+
###################################
4+
5+
Kubeflow community provides `XGBoost Operator <https://github.com/kubeflow/xgboost-operator>`_ to support distributed XGBoost training and batch prediction in a Kubernetes cluster. It provides an easy and efficient XGBoost model training and batch prediction in distributed fashion.
6+
7+
**********
8+
How to use
9+
**********
10+
In order to run a XGBoost job in a Kubernetes cluster, carry out the following steps:
11+
12+
1. Install XGBoost Operator in Kubernetes.
13+
14+
a. XGBoost Operator is designed to manage XGBoost jobs, including job scheduling, monitoring, pods and services recovery etc. Follow the `installation guide <https://github.com/kubeflow/xgboost-operator#installing-xgboost-operator>`_ to install XGBoost Operator.
15+
16+
2. Write application code to interface with the XGBoost operator.
17+
18+
a. You'll need to furnish a few scripts to inteface with the XGBoost operator. Refer to the `Iris classification example <https://github.com/kubeflow/xgboost-operator/tree/master/config/samples/xgboost-dist>`_.
19+
b. Data reader/writer: you need to have your data source reader and writer based on the requirement. For example, if your data is stored in a Hive Table, you have to write your own code to read/write Hive table based on the ID of worker.
20+
c. Model persistence: in this example, model is stored in the OSS storage. If you want to store your model into Amazon S3, Google NFS or other storage, you'll need to specify the model reader and writer based on the requirement of storage system.
21+
22+
3. Configure the XGBoost job using a YAML file.
23+
24+
a. YAML file is used to configure the computation resource and environment for your XGBoost job to run, e.g. the number of workers and masters. The template `YAML template <https://github.com/kubeflow/xgboost-operator/blob/master/config/samples/xgboost-dist/xgboostjob_v1alpha1_iris_train.yaml>`_ is provided for reference.
25+
26+
4. Submit XGBoost job to Kubernetes cluster.
27+
28+
a. `Kubectl command <https://github.com/kubeflow/xgboost-operator#creating-a-xgboost-trainingprediction-job>`_ is used to submit a XGBoost job, and then you can monitor the job status.
29+
30+
****************
31+
Work in progress
32+
****************
33+
34+
- XGBoost Model serving
35+
- Distributed data reader/writer from/to HDFS, HBase, Hive etc.
36+
- Model persistence on Amazon S3, Google NFS etc.

0 commit comments

Comments
 (0)