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

Adding commit hash as an ARG and simple catboost build #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
21 changes: 6 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ARG CUDA_VERSION
ARG XGB_HASH=6d293020fbfa2c67b532d550fe5d55689662caac
Copy link
Collaborator

Choose a reason for hiding this comment

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

We don't need to hard code this right?

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is necessary so that we can explicitly invalidate the Docker layer and force recompile XGBoost.

FROM nvidia/cuda:$CUDA_VERSION-devel-ubuntu16.04
SHELL ["/bin/bash", "-c"]
# Install conda (and use python 3.7)
Expand Down Expand Up @@ -26,6 +27,7 @@ RUN curl -o /opt/miniconda.sh \
/opt/conda/bin/conda update -n base conda && \
rm /opt/miniconda.sh
ENV PATH /opt/conda/bin:$PATH

RUN conda install -c conda-forge \
bokeh \
h5py \
Expand Down Expand Up @@ -107,33 +109,22 @@ RUN git config --global http.sslVerify false && \
python setup.py install --precompile

# catboost
RUN if ["$CUDA_VERSION" < "11.0"]; then git config --global http.sslVerify false && \
git clone --recursive "https://github.com/catboost/catboost" /opt/catboost && \
cd /opt/catboost && \
cd catboost/python-package/catboost && \
../../../ya make \
-r \
-o ../../.. \
-DUSE_ARCADIA_PYTHON=no \
-DUSE_SYSTEM_PYTHON=3.7\
-DPYTHON_CONFIG=python3-config \
-DCUDA_ROOT=$(dirname $(dirname $(which nvcc))); \
fi
ENV if ["$CUDA_VERSION" < "11.0"]; then PYTHONPATH=$PYTHONPATH:/opt/catboost/catboost/python-package; fi\


RUN pip install catboost

# xgboost
RUN git config --global http.sslVerify false && \
git clone --recursive https://github.com/dmlc/xgboost /opt/xgboost && \
cd /opt/xgboost && \
git checkout $XGB_HASH && \
git submodule update --init --recursive && \
mkdir build && \
cd build && \
RMM_ROOT=/opt/conda cmake .. \
-DUSE_CUDA=ON \
-DUSE_NCCL=ON \
-DPLUGIN_RMM=ON && \
make -j4 && \
git log > xgb_log.txt && \
cd ../python-package && \
pip uninstall -y xgboost && \
python setup.py install