diff --git a/.github/workflows/build-and-publish-images.yaml b/.github/workflows/build-and-publish-images.yaml index eee8fc52d7..e44314c06f 100644 --- a/.github/workflows/build-and-publish-images.yaml +++ b/.github/workflows/build-and-publish-images.yaml @@ -13,6 +13,10 @@ on: dockerfile: required: true type: string + context: + required: false + type: string + default: . secrets: DOCKERHUB_USERNAME: required: false @@ -48,6 +52,7 @@ jobs: image: docker.io/kubeflow/${{ inputs.component-name }} dockerfile: ${{ inputs.dockerfile }} platforms: ${{ inputs.platforms }} + context: ${{ inputs.context }} push: true - name: Test Build For Component ${{ inputs.component-name }} @@ -57,4 +62,5 @@ jobs: image: docker.io/kubeflow/${{ inputs.component-name }} dockerfile: ${{ inputs.dockerfile }} platforms: ${{ inputs.platforms }} + context: ${{ inputs.context }} push: false diff --git a/.github/workflows/publish-example-images.yaml b/.github/workflows/publish-example-images.yaml index d6d59da339..3248ec19b9 100644 --- a/.github/workflows/publish-example-images.yaml +++ b/.github/workflows/publish-example-images.yaml @@ -13,6 +13,7 @@ jobs: # TODO (tenzen-y): Support linux/arm64 platform platforms: linux/amd64 dockerfile: ${{ matrix.dockerfile }} + context: ${{ matrix.context }} secrets: DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} @@ -37,14 +38,17 @@ jobs: dockerfile: examples/pytorch/elastic/imagenet/Dockerfile - component-name: pytorch-elastic-example-echo dockerfile: examples/pytorch/elastic/echo/Dockerfile + - component-name: xgboost-dist-iris + dockerfile: examples/xgboost/xgboost-dist/Dockerfile + context: examples/xgboost/xgboost-dist + - component-name: lightgbm-dist-py-test + dockerfile: examples/xgboost/lightgbm-dist/Dockerfile + context: examples/xgboost/lightgbm-dist + - component-name: xgboost-dist-rabit-test + dockerfile: examples/xgboost/smoke-dist/Dockerfile + context: examples/xgboost/smoke-dist # TODO (tenzen-y): Fix the below broken Dockerfiles -# - component-name: lightgbm-dist-py-test -# dockerfile: examples/xgboost/lightgbm-dist/Dockerfile -# - component-name: xgboost-dist-rabit-test -# dockerfile: examples/xgboost/smoke-dist/Dockerfile -# - component-name: xgboost-dist-iris -# dockerfile: examples/xgboost/xgboost-dist # - component-name: mxnet-gpu # dockerfile: examples/mxnet/train/Dockerfile # - component-name: mxnet-auto-tuning diff --git a/.github/workflows/template-publish-image/action.yaml b/.github/workflows/template-publish-image/action.yaml index 693d386c75..3f44d70d7a 100644 --- a/.github/workflows/template-publish-image/action.yaml +++ b/.github/workflows/template-publish-image/action.yaml @@ -12,6 +12,10 @@ inputs: platforms: required: true description: e.g, linux/amd64 + context: + required: false + default: . + description: e.g, examples/xgboost/xgboost-dist push: required: true description: whether to push container images or not @@ -40,7 +44,7 @@ runs: uses: docker/build-push-action@v3 with: platforms: ${{ inputs.platforms }} - context: . + context: ${{ inputs.context }} file: ${{ inputs.dockerfile }} push: ${{ inputs.push }} tags: ${{ steps.meta.outputs.tags }} diff --git a/examples/xgboost/lightgbm-dist/Dockerfile b/examples/xgboost/lightgbm-dist/Dockerfile index cd8a36bb93..b05c4020fb 100644 --- a/examples/xgboost/lightgbm-dist/Dockerfile +++ b/examples/xgboost/lightgbm-dist/Dockerfile @@ -1,37 +1,40 @@ -FROM ubuntu:16.04 +# inspired from https://github.com/microsoft/LightGBM/blob/v4.1.0/docker/dockerfile-cli +FROM ubuntu:20.04 as builder -ARG CONDA_DIR=/opt/conda -ENV PATH $CONDA_DIR/bin:$PATH +ENV \ + DEBIAN_FRONTEND=noninteractive \ + LANG=C.UTF-8 \ + LC_ALL=C.UTF-8 -RUN apt-get update && \ +RUN apt-get update -y && \ apt-get install -y --no-install-recommends \ - ca-certificates \ - cmake \ - build-essential \ - gcc \ - g++ \ - git \ - curl && \ - # python environment - curl -sL https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -o conda.sh && \ - /bin/bash conda.sh -f -b -p $CONDA_DIR && \ - export PATH="$CONDA_DIR/bin:$PATH" && \ - conda config --set always_yes yes --set changeps1 no && \ - # lightgbm - conda install -q -y numpy==1.20.3 scipy==1.6.2 scikit-learn==0.24.2 pandas==1.3.0 && \ - git clone --recursive --branch stable --depth 1 https://github.com/Microsoft/LightGBM && \ + ca-certificates \ + cmake \ + build-essential \ + gcc \ + g++ \ + git \ + libomp-dev && \ + rm -rf /var/lib/apt/lists/* + +RUN git clone \ + --recursive \ + --branch v4.1.0 \ + --depth 1 \ + https://github.com/Microsoft/LightGBM && \ mkdir LightGBM/build && \ cd LightGBM/build && \ cmake .. && \ make -j4 && \ make install && \ - cd ../python-package && \ - python setup.py install_lib && \ - # clean - apt-get autoremove -y && apt-get clean && \ - conda clean -a -y && \ - rm -rf /usr/local/src/* && \ - rm -rf /LightGBM + cd "${HOME}" && \ + rm -rf LightGBM + +FROM python:3.7 + +COPY requirements.txt . +RUN pip install -r requirements.txt +COPY --from=builder /usr/local/bin/lightgbm /usr/local/bin/lightgbm WORKDIR /app @@ -41,4 +44,4 @@ ADD https://raw.githubusercontent.com/microsoft/LightGBM/stable/examples/paralle ADD https://raw.githubusercontent.com/microsoft/LightGBM/stable/examples/parallel_learning/binary.test data/. COPY *.py ./ -ENTRYPOINT [ "python", "/app/main.py" ] \ No newline at end of file +ENTRYPOINT [ "python", "/app/main.py" ] diff --git a/examples/xgboost/lightgbm-dist/README.md b/examples/xgboost/lightgbm-dist/README.md index f8511447e1..79d9334f16 100644 --- a/examples/xgboost/lightgbm-dist/README.md +++ b/examples/xgboost/lightgbm-dist/README.md @@ -4,13 +4,6 @@ This folder containers Dockerfile and Python scripts to run a distributed Lightg The code is based in this [example](https://github.com/microsoft/LightGBM/tree/master/examples/parallel_learning) in the official github repository of the library. -**Build image** -The default image name and tag is `kubeflow/lightgbm-dist-py-test:1.0` respectiveily. - -```shell -docker build -f Dockerfile -t kubeflow/lightgbm-dist-py-test:1.0 ./ -``` - **Start the training** ``` @@ -24,7 +17,7 @@ kubectl create -f xgboostjob_v1_lightgbm_dist_training.yaml Here is sample output when the job is running. The output result like this ``` -apiVersion: xgboostjob.kubeflow.org/v1 +apiVersion: kubeflow.org/v1 kind: XGBoostJob metadata: annotations: diff --git a/examples/xgboost/lightgbm-dist/requirements.txt b/examples/xgboost/lightgbm-dist/requirements.txt new file mode 100644 index 0000000000..a42102686c --- /dev/null +++ b/examples/xgboost/lightgbm-dist/requirements.txt @@ -0,0 +1,4 @@ +numpy==1.20.3 +scipy==1.6.2 +scikit-learn==0.24.2 +pandas==1.3.0 diff --git a/examples/xgboost/smoke-dist/Dockerfile b/examples/xgboost/smoke-dist/Dockerfile index 74ed8717fa..ab373d7f1b 100644 --- a/examples/xgboost/smoke-dist/Dockerfile +++ b/examples/xgboost/smoke-dist/Dockerfile @@ -1,26 +1,14 @@ # Install python 3.6 FROM python:3.6 -RUN apt-get update -RUN apt-get install -y git make g++ cmake - RUN mkdir -p /opt/mlkube # Download the rabit tracker and xgboost code. - COPY tracker.py /opt/mlkube/ +COPY xgboost_smoke_test.py /opt/mlkube/ COPY requirements.txt /opt/mlkube/ # Install requirements - RUN pip install -r /opt/mlkube/requirements.txt -# Build XGBoost. -RUN git clone --recursive https://github.com/dmlc/xgboost && \ - cd xgboost && \ - make -j$(nproc) && \ - cd python-package; python setup.py install - -COPY xgboost_smoke_test.py /opt/mlkube/ - ENTRYPOINT ["python", "/opt/mlkube/xgboost_smoke_test.py"] diff --git a/examples/xgboost/smoke-dist/README.md b/examples/xgboost/smoke-dist/README.md index 8ac8cc3dd8..e04afb5a5c 100644 --- a/examples/xgboost/smoke-dist/README.md +++ b/examples/xgboost/smoke-dist/README.md @@ -2,14 +2,6 @@ This folder containers Dockerfile and distributed send/recv test. -**Build Image** - -The default image name and tag is `kubeflow/xgboost-dist-rabit-test:1.2`. -You can build the image based on your requirement. - -```shell -docker build -f Dockerfile -t kubeflow/xgboost-dist-rabit-test:1.2 ./ -``` **Start and test XGBoost Rabit tracker** @@ -23,7 +15,7 @@ kubectl create -f xgboostjob_v1alpha1_rabit_test.yaml ``` Here is sample output when the job is running. The output result like this ``` -apiVersion: xgboostjob.kubeflow.org/v1alpha1 +apiVersion: kubeflow.org/v1 kind: XGBoostJob metadata: creationTimestamp: "2019-06-21T03:32:57Z" @@ -31,7 +23,6 @@ metadata: name: xgboost-dist-test namespace: default resourceVersion: "258466" - selfLink: /apis/xgboostjob.kubeflow.org/v1alpha1/namespaces/default/xgboostjobs/xgboost-dist-test uid: 431dc182-93d5-11e9-bbab-080027dfbfe2 spec: RunPolicy: @@ -45,7 +36,7 @@ spec: creationTimestamp: null spec: containers: - - image: docker.io/merlintang/xgboost-dist-rabit-test:1.2 + - image: docker.io/kubeflow/xgboost-dist-rabit-test:latest imagePullPolicy: Always name: xgboostjob ports: @@ -60,7 +51,7 @@ spec: creationTimestamp: null spec: containers: - - image: docker.io/merlintang/xgboost-dist-rabit-test:1.2 + - image: docker.io/kubeflow/xgboost-dist-rabit-test:latest imagePullPolicy: Always name: xgboostjob ports: diff --git a/examples/xgboost/smoke-dist/requirements.txt b/examples/xgboost/smoke-dist/requirements.txt index 2df5bac4f2..524b87ab12 100644 --- a/examples/xgboost/smoke-dist/requirements.txt +++ b/examples/xgboost/smoke-dist/requirements.txt @@ -3,3 +3,4 @@ Cython>=0.29.4 requests>=2.21.0 urllib3>=1.21.1 scipy>=1.4.1 +xgboost==1.5.2 diff --git a/examples/xgboost/smoke-dist/xgboostjob_v1_rabit_test.yaml b/examples/xgboost/smoke-dist/xgboostjob_v1_rabit_test.yaml index ba9ae99928..15f55a01b1 100644 --- a/examples/xgboost/smoke-dist/xgboostjob_v1_rabit_test.yaml +++ b/examples/xgboost/smoke-dist/xgboostjob_v1_rabit_test.yaml @@ -11,7 +11,7 @@ spec: spec: containers: - name: xgboost - image: docker.io/merlintang/xgboost-dist-rabit-test:1.2 + image: docker.io/kubeflow/xgboost-dist-rabit-test:latest ports: - containerPort: 9991 name: xgboostjob-port @@ -23,7 +23,7 @@ spec: spec: containers: - name: xgboost - image: docker.io/merlintang/xgboost-dist-rabit-test:1.2 + image: docker.io/kubeflow/xgboost-dist-rabit-test:latest ports: - containerPort: 9991 name: xgboostjob-port diff --git a/examples/xgboost/smoke-dist/xgboostjob_v1alpha1_rabit_test.yaml b/examples/xgboost/smoke-dist/xgboostjob_v1alpha1_rabit_test.yaml index 066f8a9733..24fe7526fc 100644 --- a/examples/xgboost/smoke-dist/xgboostjob_v1alpha1_rabit_test.yaml +++ b/examples/xgboost/smoke-dist/xgboostjob_v1alpha1_rabit_test.yaml @@ -13,7 +13,7 @@ spec: spec: containers: - name: xgboost - image: docker.io/merlintang/xgboost-dist-rabit-test:1.2 + image: docker.io/kubeflow/xgboost-dist-rabit-test:latest ports: - containerPort: 9991 name: xgboostjob-port @@ -27,7 +27,7 @@ spec: spec: containers: - name: xgboost - image: docker.io/merlintang/xgboost-dist-rabit-test:1.2 + image: docker.io/kubeflow/xgboost-dist-rabit-test:latest ports: - containerPort: 9991 name: xgboostjob-port diff --git a/examples/xgboost/xgboost-dist/Dockerfile b/examples/xgboost/xgboost-dist/Dockerfile index e72032e9c2..16ea8051df 100644 --- a/examples/xgboost/xgboost-dist/Dockerfile +++ b/examples/xgboost/xgboost-dist/Dockerfile @@ -1,25 +1,12 @@ -# Install python 3。6. +# Install python 3.6. FROM python:3.6 -RUN apt-get update -RUN apt-get install -y git make g++ cmake - RUN mkdir -p /opt/mlkube -# Download the rabit tracker and xgboost code. - -COPY requirements.txt /opt/mlkube/ - # Install requirements - +COPY requirements.txt /opt/mlkube/ RUN pip install -r /opt/mlkube/requirements.txt -# Build XGBoost. -RUN git clone --recursive https://github.com/dmlc/xgboost && \ - cd xgboost && \ - make -j$(nproc) && \ - cd python-package; python setup.py install - COPY *.py /opt/mlkube/ ENTRYPOINT ["python", "/opt/mlkube/main.py"] diff --git a/examples/xgboost/xgboost-dist/README.md b/examples/xgboost/xgboost-dist/README.md index 0756a92022..506f6230ec 100644 --- a/examples/xgboost/xgboost-dist/README.md +++ b/examples/xgboost/xgboost-dist/README.md @@ -6,45 +6,32 @@ Thus, in this demo, distributed XGBoost job is able to do multi-class classifica User can extend provided data reader to read data from distributed data storage like HDFS, HBase or Hive etc. -**Build image** - -The default image name and tag is `kubeflow/xgboost-dist-iris-test:1.1` respectiveily. - -```shell -docker build -f Dockerfile -t kubeflow/xgboost-dist-iris-test:1.0 ./ -``` - -Then you can push the docker image into repository -```shell -docker push kubeflow/xgboost-dist-iris-test:1.0 ./ -``` - **Configure the job runtime via Yaml file** The following files are available to setup distributed XGBoost computation runtime To store the model in OSS: -* xgboostjob_v1alpha1_iris_train.yaml -* xgboostjob_v1alpha1_iris_predict.yaml +* xgboostjob_v1_iris_train.yaml +* xgboostjob_v1_iris_predict.yaml To store the model in local path: -* xgboostjob_v1alpha1_iris_train_local.yaml -* xgboostjob_v1alpha1_iris_predict_local.yaml +* xgboostjob_v1_iris_train_local.yaml +* xgboostjob_v1_iris_predict_local.yaml -For training jobs in OSS , you could configure xgboostjob_v1alpha1_iris_train.yaml and xgboostjob_v1alpha1_iris_predict.yaml +For training jobs in OSS , you could configure xgboostjob_v1_iris_train.yaml and xgboostjob_v1_iris_predict.yaml Note, we use [OSS](https://www.alibabacloud.com/product/oss) to store the trained model, -thus, you need to specify the OSS parameter in the yaml file. Therefore, remember to fill the OSS parameter in xgboostjob_v1alpha1_iris_train.yaml and xgboostjob_v1alpha1_iris_predict.yaml file. +thus, you need to specify the OSS parameter in the yaml file. Therefore, remember to fill the OSS parameter in xgboostjob_v1_iris_train.yaml and xgboostjob_v1_iris_predict.yaml file. The oss parameter includes the account information such as access_id, access_key, access_bucket and endpoint. For Eg: --oss_param=endpoint:http://oss-ap-south-1.aliyuncs.com,access_id:XXXXXXXXXXX,access_key:XXXXXXXXXXXXXXXXXXX,access_bucket:XXXXXX -Similarly, xgboostjob_v1alpha1_iris_predict.yaml is used to configure XGBoost job batch prediction. +Similarly, xgboostjob_v1_iris_predict.yaml is used to configure XGBoost job batch prediction. **Start the distributed XGBoost train to store the model in OSS** ``` -kubectl create -f xgboostjob_v1alpha1_iris_train.yaml +kubectl create -f xgboostjob_v1_iris_train.yaml ``` **Look at the train job status** @@ -57,13 +44,12 @@ Name: xgboost-dist-iris-test Namespace: default Labels: Annotations: -API Version: xgboostjob.kubeflow.org/v1alpha1 +API Version: kubeflow.org/v1 Kind: XGBoostJob Metadata: Creation Timestamp: 2019-06-27T01:16:09Z Generation: 9 Resource Version: 385834 - Self Link: /apis/xgboostjob.kubeflow.org/v1alpha1/namespaces/default/xgboostjobs/xgboost-dist-iris-test UID: 2565e99a-9879-11e9-bbab-080027dfbfe2 Spec: Run Policy: @@ -85,7 +71,7 @@ Spec: --model_path=autoAI/xgb-opt/2 --model_storage_type=oss --oss_param=unknown - Image: docker.io/merlintang/xgboost-dist-iris:1.1 + Image: docker.io/kubeflow/xgboost-dist-iris:latest Image Pull Policy: Always Name: xgboostjob Ports: @@ -107,7 +93,7 @@ Spec: --learning_rate=0.1 --model_path="/tmp/xgboost_model" --model_storage_type=oss - Image: docker.io/merlintang/xgboost-dist-iris:1.1 + Image: docker.io/kubeflow/xgboost-dist-iris:latest Image Pull Policy: Always Name: xgboostjob Ports: @@ -156,7 +142,7 @@ Events: **Start the distributed XGBoost job predict** ```shell -kubectl create -f xgboostjob_v1alpha1_iris_predict.yaml +kubectl create -f xgboostjob_v1_iris_predict.yaml ``` **Look at the batch predict job status** @@ -169,13 +155,12 @@ Name: xgboost-dist-iris-test-predict Namespace: default Labels: Annotations: -API Version: xgboostjob.kubeflow.org/v1alpha1 +API Version: kubeflow.org/v1 Kind: XGBoostJob Metadata: Creation Timestamp: 2019-06-27T06:06:53Z Generation: 8 - Resource Version: 394523 - Self Link: /apis/xgboostjob.kubeflow.org/v1alpha1/namespaces/default/xgboostjobs/xgboost-dist-iris-test-predict + Resource Version: 394523 UID: c2a04cbc-98a1-11e9-bbab-080027dfbfe2 Spec: Run Policy: @@ -194,7 +179,7 @@ Spec: --model_path=autoAI/xgb-opt/3 --model_storage_type=oss --oss_param=unkown - Image: docker.io/merlintang/xgboost-dist-iris:1.1 + Image: docker.io/kubeflow/xgboost-dist-iris:latest Image Pull Policy: Always Name: xgboostjob Ports: @@ -214,7 +199,7 @@ Spec: --model_path=autoAI/xgb-opt/3 --model_storage_type=oss --oss_param=unkown - Image: docker.io/merlintang/xgboost-dist-iris:1.1 + Image: docker.io/kubeflow/xgboost-dist-iris:latest Image Pull Policy: Always Name: xgboostjob Ports: @@ -287,11 +272,11 @@ Note: * Please use the storage class which supports ReadWriteMany. The example yaml above uses glusterfs -* Mention model_storage_type=local and model_path accordingly( In the example /tmp/xgboost_model/2 is used ) in xgboostjob_v1alpha1_iris_train_local.yaml and xgboostjob_v1alpha1_iris_predict_local.yaml" +* Mention model_storage_type=local and model_path accordingly( In the example /tmp/xgboost_model/2 is used ) in xgboostjob_v1_iris_train_local.yaml and xgboostjob_v1_iris_predict_local.yaml" Now start the distributed XGBoost train. ``` -kubectl create -f xgboostjob_v1alpha1_iris_train_local.yaml +kubectl create -f xgboostjob_v1_iris_train_local.yaml ``` **Look at the train job status** @@ -301,7 +286,7 @@ kubectl create -f xgboostjob_v1alpha1_iris_train_local.yaml Here is a sample output when the job is finished. The output log like this ``` -apiVersion: xgboostjob.kubeflow.org/v1alpha1 +apiVersion: kubeflow.org/v1 kind: XGBoostJob metadata: creationTimestamp: "2019-09-17T05:36:01Z" @@ -309,7 +294,6 @@ metadata: name: xgboost-dist-iris-test-train_local namespace: default resourceVersion: "8919366" - selfLink: /apis/xgboostjob.kubeflow.org/v1alpha1/namespaces/default/xgboostjobs/xgboost-dist-iris-test-train_local uid: 08f85fad-d90d-11e9-aca1-fa163ea13108 spec: RunPolicy: @@ -330,7 +314,7 @@ spec: - --learning_rate=0.1 - --model_path=/tmp/xgboost_model/2 - --model_storage_type=local - image: docker.io/merlintang/xgboost-dist-iris:1.1 + image: docker.io/kubeflow/xgboost-dist-iris:latest imagePullPolicy: Always name: xgboostjob ports: @@ -402,7 +386,7 @@ status: ``` **Start the distributed XGBoost job predict** ``` -kubectl create -f xgboostjob_v1alpha1_iris_predict_local.yaml +kubectl create -f xgboostjob_v1_iris_predict_local.yaml ``` **Look at the batch predict job status** @@ -411,7 +395,7 @@ kubectl create -f xgboostjob_v1alpha1_iris_predict_local.yaml ``` Here is a sample output when the job is finished. The output log like this ``` -apiVersion: xgboostjob.kubeflow.org/v1alpha1 +apiVersion: kubeflow.org/v1 kind: XGBoostJob metadata: creationTimestamp: "2019-09-17T06:33:38Z" @@ -419,7 +403,6 @@ metadata: name: xgboost-dist-iris-test-predict_local namespace: default resourceVersion: "8976054" - selfLink: /apis/xgboostjob.kubeflow.org/v1alpha1/namespaces/default/xgboostjobs/xgboost-dist-iris-test-predict_local uid: 151655b0-d915-11e9-aca1-fa163ea13108 spec: RunPolicy: @@ -437,7 +420,7 @@ spec: - --job_type=Predict - --model_path=/tmp/xgboost_model/2 - --model_storage_type=local - image: docker.io/merlintang/xgboost-dist-iris:1.1 + image: docker.io/kubeflow/xgboost-dist-iris:latest imagePullPolicy: Always name: xgboostjob ports: @@ -463,7 +446,7 @@ spec: - --job_type=Predict - --model_path=/tmp/xgboost_model/2 - --model_storage_type=local - image: docker.io/merlintang/xgboost-dist-iris:1.1 + image: docker.io/kubeflow/xgboost-dist-iris:latest imagePullPolicy: Always name: xgboostjob ports: diff --git a/examples/xgboost/xgboost-dist/build.sh b/examples/xgboost/xgboost-dist/build.sh deleted file mode 100644 index b837f07341..0000000000 --- a/examples/xgboost/xgboost-dist/build.sh +++ /dev/null @@ -1,11 +0,0 @@ -## build the docker file -docker build -f Dockerfile -t merlintang/xgboost-dist-iris:1.0 ./ - -## push the docker image into docker.io -docker push merlintang/xgboost-dist-iris:1.0 - -## run the train job -kubectl create -f xgboostjob_v1alpha1_iris_train.yaml - -## run the predict job -kubectl create -f xgboostjob_v1alpha1_iris_predict.yaml diff --git a/examples/xgboost/xgboost-dist/requirements.txt b/examples/xgboost/xgboost-dist/requirements.txt index 60841a31a5..d2cdbf6095 100644 --- a/examples/xgboost/xgboost-dist/requirements.txt +++ b/examples/xgboost/xgboost-dist/requirements.txt @@ -6,4 +6,5 @@ scipy>=1.1.0 joblib>=0.13.2 scikit-learn>=0.20 oss2>=2.7.0 -pandas>=0.24.2 \ No newline at end of file +pandas>=0.24.2 +xgboost==1.5.2 diff --git a/examples/xgboost/xgboost-dist/xgboostjob_v1_iris_predict.yaml b/examples/xgboost/xgboost-dist/xgboostjob_v1_iris_predict.yaml index c6afff09da..218219c818 100644 --- a/examples/xgboost/xgboost-dist/xgboostjob_v1_iris_predict.yaml +++ b/examples/xgboost/xgboost-dist/xgboostjob_v1_iris_predict.yaml @@ -11,7 +11,7 @@ spec: spec: containers: - name: xgboost - image: docker.io/merlintang/xgboost-dist-iris:1.1 + image: docker.io/kubeflow/xgboost-dist-iris:latest ports: - containerPort: 9991 name: xgboostjob-port @@ -28,7 +28,7 @@ spec: spec: containers: - name: xgboost - image: docker.io/merlintang/xgboost-dist-iris:1.1 + image: docker.io/kubeflow/xgboost-dist-iris:latest ports: - containerPort: 9991 name: xgboostjob-port diff --git a/examples/xgboost/xgboost-dist/xgboostjob_v1alpha1_iris_predict_local.yaml b/examples/xgboost/xgboost-dist/xgboostjob_v1_iris_predict_local.yaml similarity index 87% rename from examples/xgboost/xgboost-dist/xgboostjob_v1alpha1_iris_predict_local.yaml rename to examples/xgboost/xgboost-dist/xgboostjob_v1_iris_predict_local.yaml index f8759b602d..168de9971d 100644 --- a/examples/xgboost/xgboost-dist/xgboostjob_v1alpha1_iris_predict_local.yaml +++ b/examples/xgboost/xgboost-dist/xgboostjob_v1_iris_predict_local.yaml @@ -8,8 +8,6 @@ spec: replicas: 1 restartPolicy: Never template: - apiVersion: v1 - kind: Pod spec: volumes: - name: task-pv-storage @@ -17,7 +15,7 @@ spec: claimName: xgboostlocal containers: - name: xgboost - image: docker.io/merlintang/xgboost-dist-iris:1.1 + image: docker.io/kubeflow/xgboost-dist-iris:latest volumeMounts: - name: task-pv-storage mountPath: /tmp/xgboost_model @@ -33,8 +31,6 @@ spec: replicas: 2 restartPolicy: ExitCode template: - apiVersion: v1 - kind: Pod spec: volumes: - name: task-pv-storage @@ -42,7 +38,7 @@ spec: claimName: xgboostlocal containers: - name: xgboost - image: docker.io/merlintang/xgboost-dist-iris:1.1 + image: docker.io/kubeflow/xgboost-dist-iris:latest volumeMounts: - name: task-pv-storage mountPath: /tmp/xgboost_model diff --git a/examples/xgboost/xgboost-dist/xgboostjob_v1_iris_train.yaml b/examples/xgboost/xgboost-dist/xgboostjob_v1_iris_train.yaml index f3923b1d2e..3600a0a7f2 100644 --- a/examples/xgboost/xgboost-dist/xgboostjob_v1_iris_train.yaml +++ b/examples/xgboost/xgboost-dist/xgboostjob_v1_iris_train.yaml @@ -11,7 +11,7 @@ spec: spec: containers: - name: xgboost - image: docker.io/merlintang/xgboost-dist-iris:1.1 + image: docker.io/kubeflow/xgboost-dist-iris:latest ports: - containerPort: 9991 name: xgboostjob-port @@ -30,7 +30,7 @@ spec: spec: containers: - name: xgboost - image: docker.io/merlintang/xgboost-dist-iris:1.1 + image: docker.io/kubeflow/xgboost-dist-iris:latest ports: - containerPort: 9991 name: xgboostjob-port diff --git a/examples/xgboost/xgboost-dist/xgboostjob_v1alpha1_iris_train_local.yaml b/examples/xgboost/xgboost-dist/xgboostjob_v1_iris_train_local.yaml similarity index 89% rename from examples/xgboost/xgboost-dist/xgboostjob_v1alpha1_iris_train_local.yaml rename to examples/xgboost/xgboost-dist/xgboostjob_v1_iris_train_local.yaml index f0282e6dfe..2798587bb2 100644 --- a/examples/xgboost/xgboost-dist/xgboostjob_v1alpha1_iris_train_local.yaml +++ b/examples/xgboost/xgboost-dist/xgboostjob_v1_iris_train_local.yaml @@ -8,8 +8,6 @@ spec: replicas: 1 restartPolicy: Never template: - apiVersion: v1 - kind: Pod spec: volumes: - name: task-pv-storage @@ -17,7 +15,7 @@ spec: claimName: xgboostlocal containers: - name: xgboost - image: docker.io/merlintang/xgboost-dist-iris:1.1 + image: docker.io/kubeflow/xgboost-dist-iris:latest volumeMounts: - name: task-pv-storage mountPath: /tmp/xgboost_model @@ -36,8 +34,6 @@ spec: replicas: 2 restartPolicy: ExitCode template: - apiVersion: v1 - kind: Pod spec: volumes: - name: task-pv-storage @@ -45,7 +41,7 @@ spec: claimName: xgboostlocal containers: - name: xgboost - image: docker.io/merlintang/xgboost-dist-iris:1.1 + image: docker.io/kubeflow/xgboost-dist-iris:latest volumeMounts: - name: task-pv-storage mountPath: /tmp/xgboost_model diff --git a/examples/xgboost/xgboost-dist/xgboostjob_v1alpha1_iris_predict.yaml b/examples/xgboost/xgboost-dist/xgboostjob_v1alpha1_iris_predict.yaml deleted file mode 100644 index 74e6bc972e..0000000000 --- a/examples/xgboost/xgboost-dist/xgboostjob_v1alpha1_iris_predict.yaml +++ /dev/null @@ -1,46 +0,0 @@ -apiVersion: kubeflow.org/v1 -kind: XGBoostJob -metadata: - name: xgboost-dist-iris-test-predict -spec: - xgbReplicaSpecs: - Master: - replicas: 1 - restartPolicy: Never - template: - apiVersion: v1 - kind: Pod - spec: - containers: - - name: xgboost - image: docker.io/merlintang/xgboost-dist-iris:1.1 - ports: - - containerPort: 9991 - name: xgboostjob-port - imagePullPolicy: Always - args: - - --job_type=Predict - - --model_path=autoAI/xgb-opt/2 - - --model_storage_type=oss - - --oss_param=unknown - Worker: - replicas: 2 - restartPolicy: ExitCode - template: - apiVersion: v1 - kind: Pod - spec: - containers: - - name: xgboost - image: docker.io/merlintang/xgboost-dist-iris:1.1 - ports: - - containerPort: 9991 - name: xgboostjob-port - imagePullPolicy: Always - args: - - --job_type=Predict - - --model_path=autoAI/xgb-opt/2 - - --model_storage_type=oss - - --oss_param=unknown - - diff --git a/examples/xgboost/xgboost-dist/xgboostjob_v1alpha1_iris_train.yaml b/examples/xgboost/xgboost-dist/xgboostjob_v1alpha1_iris_train.yaml deleted file mode 100644 index 997dc0ce49..0000000000 --- a/examples/xgboost/xgboost-dist/xgboostjob_v1alpha1_iris_train.yaml +++ /dev/null @@ -1,49 +0,0 @@ -apiVersion: kubeflow.org/v1 -kind: XGBoostJob -metadata: - name: xgboost-dist-iris-test-train -spec: - xgbReplicaSpecs: - Master: - replicas: 1 - restartPolicy: Never - template: - apiVersion: v1 - kind: Pod - spec: - containers: - - name: xgboost - image: docker.io/merlintang/xgboost-dist-iris:1.1 - ports: - - containerPort: 9991 - name: xgboostjob-port - imagePullPolicy: Always - args: - - --job_type=Train - - --xgboost_parameter=objective:multi:softprob,num_class:3 - - --n_estimators=10 - - --learning_rate=0.1 - - --model_path=autoAI/xgb-opt/2 - - --model_storage_type=oss - - --oss_param=unknown - Worker: - replicas: 2 - restartPolicy: ExitCode - template: - apiVersion: v1 - kind: Pod - spec: - containers: - - name: xgboost - image: docker.io/merlintang/xgboost-dist-iris:1.1 - ports: - - containerPort: 9991 - name: xgboostjob-port - imagePullPolicy: Always - args: - - --job_type=Train - - --xgboost_parameter="objective:multi:softprob,num_class:3" - - --n_estimators=10 - - --learning_rate=0.1 - - diff --git a/examples/xgboost/xgboostjob.yaml b/examples/xgboost/xgboostjob.yaml index 8eb11b9a77..5824ec056d 100644 --- a/examples/xgboost/xgboostjob.yaml +++ b/examples/xgboost/xgboostjob.yaml @@ -11,7 +11,7 @@ spec: spec: containers: - name: xgboost - image: docker.io/merlintang/xgboost-dist-iris:1.1 + image: docker.io/kubeflow/xgboost-dist-iris:latest ports: - containerPort: 9991 name: xgboostjob-port @@ -30,7 +30,7 @@ spec: spec: containers: - name: xgboost - image: docker.io/merlintang/xgboost-dist-iris:1.1 + image: docker.io/kubeflow/xgboost-dist-iris:latest ports: - containerPort: 9991 name: xgboostjob-port diff --git a/pkg/apis/kubeflow.org/v1/xgboost_validation_test.go b/pkg/apis/kubeflow.org/v1/xgboost_validation_test.go index 3f5ba2a2d2..c64e70fdd1 100644 --- a/pkg/apis/kubeflow.org/v1/xgboost_validation_test.go +++ b/pkg/apis/kubeflow.org/v1/xgboost_validation_test.go @@ -31,7 +31,7 @@ func TestValidateV1XGBoostJob(t *testing.T) { Spec: corev1.PodSpec{ Containers: []corev1.Container{{ Name: "xgboost", - Image: "docker.io/merlintang/xgboost-dist-iris:1.1", + Image: "docker.io/kubeflow/xgboost-dist-iris:latest", Ports: []corev1.ContainerPort{{ Name: "xgboostjob-port", ContainerPort: 9991, @@ -56,7 +56,7 @@ func TestValidateV1XGBoostJob(t *testing.T) { Spec: corev1.PodSpec{ Containers: []corev1.Container{{ Name: "xgboost", - Image: "docker.io/merlintang/xgboost-dist-iris:1.", + Image: "docker.io/kubeflow/xgboost-dist-iris:latest", Ports: []corev1.ContainerPort{{ Name: "xgboostjob-port", ContainerPort: 9991,