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

upgrade to python 3.10 #878

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
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
83 changes: 41 additions & 42 deletions Dockerfile-build
Original file line number Diff line number Diff line change
Expand Up @@ -21,64 +21,57 @@ ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH_CUDA:$LD_LIBRARY_PATH_BUILD:$LD_LIBRARY_PAT
ENV OMP_NUM_THREADS=32
ENV MKL_NUM_THREADS=32
ENV VECLIB_MAXIMUM_THREADS=32
ENV GIT_VERSION=2.17.0
ENV AXEL_VERSION=2.17.11

# Disable the error "Unable to read consumer identity"
RUN sed -i 's/enabled=1/enabled=0/' /etc/yum/pluginconf.d/subscription-manager.conf

#
# Install necessary libraries and dependencies
#
RUN yum install -y epel-release
RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm

RUN dnf update -y

RUN yum update -y
# Enable RHSCL repository
# RUN dnf install -y 'dnf-command(config-manager)' && \
# dnf config-manager --set-enabled powertools

RUN yum install centos-release-scl-rh -y

# Setup gcc etc.
RUN yum install -y gcc gcc-c++ libgcc libstdc++ libgomp glibc
RUN dnf install -y gcc gcc-c++ libgcc libstdc++ libgomp glibc

# Git & gcc requirements
RUN yum install -y libcurl-devel zlib-devel asciidoc xmlto wget make autoconf gettext gmp-devel mpfr-devel libmpc-devel
RUN dnf install -y libcurl-devel zlib-devel wget make autoconf gettext gmp-devel mpfr-devel libmpc-devel

RUN yum install -y devtoolset-7

# Compile from source because yum's latest version is 1.8.3
# --depth for submodule update which we use was added in 1.8.4
RUN \
wget https://www.kernel.org/pub/software/scm/git/git-${GIT_VERSION}.tar.xz && \
tar xf git-${GIT_VERSION}.tar.xz && \
cd git-${GIT_VERSION} && \
make configure && \
./configure --prefix=/usr && \
make all && \
make install;
# since we are using devel version, dev tools hould already be installed
# RUN dnf install -y devtoolset-7

# Install git
RUN dnf install -y git

#H2O4GPU requirements
RUN yum install -y \
RUN dnf install -y \
cmake \
ncurses-devel \
bzip2 \
which \
axel \
openssl-devel \
libpng-devel \
freetype-devel \
blas-devel \
epel-release \
zeromq-devel \
openblas-devel \
openblas \
libffi-devel

# Compile from source because ubi8 does not have axel
RUN \
git clone https://github.com/NVIDIA/nccl.git && \
cd nccl && \
git checkout tags/v2.4.7-1 && \
scl enable devtoolset-7 'make CUDA8_GENCODE="-gencode=arch=compute_35,code=sm_35 -gencode=arch=compute_50,code=sm_50 -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_61,code=sm_61" -j src.build';

# cmake 3.17.1 looks incompatible with CUDA
RUN wget https://github.com/Kitware/CMake/releases/download/v3.16.8/cmake-3.16.8.tar.gz && \
tar -zxvf cmake-3.16.8.tar.gz && \
cd cmake-3.16.8 && \
./bootstrap && \
make -j`nproc` && \
make install
wget https://github.com/axel-download-accelerator/axel/releases/download/v${AXEL_VERSION}/axel-${AXEL_VERSION}.tar.gz && \
tar xf axel-${AXEL_VERSION}.tar.gz && \
cd axel-${AXEL_VERSION} && \
./configure --prefix=/usr && \
make && \
make install;

RUN mkdir -p /opt/h2oai/h2o4gpu

Expand All @@ -96,12 +89,12 @@ ENV LLVM_CONFIG=$LLVM4/bin/llvm-config
# Library versions
#
ARG python_version
ENV MINICONDA_VERSION=4.8.3
ENV MINICONDA_VERSION=23.3.1-0
ENV SWIG_VERSION=3.0.12

# conda
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-py38_${MINICONDA_VERSION}-Linux-`arch`.sh && \
bash Miniconda3-py38_${MINICONDA_VERSION}-Linux-`arch`.sh -b -p /opt/h2oai/h2o4gpu/python && \
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-py310_${MINICONDA_VERSION}-Linux-`arch`.sh && \
bash Miniconda3-py310_${MINICONDA_VERSION}-Linux-`arch`.sh -b -p /opt/h2oai/h2o4gpu/python && \
/opt/h2oai/h2o4gpu/python/bin/conda install -y python=${python_version} conda-build pip && \
/opt/h2oai/h2o4gpu/python/bin/conda update conda-build

Expand Down Expand Up @@ -135,7 +128,7 @@ RUN \
# Builds from source due to too old versions in yum
#
WORKDIR $HOME

RUN dnf install -y pcre-devel
# SWIG
RUN \
wget https://0xdata-public.s3.amazonaws.com/swig/swig-${SWIG_VERSION}.tar.gz && \
Expand All @@ -158,7 +151,7 @@ RUN bash -c 'if [ `arch` = "ppc64le" ]; then \
cd $HOME/arrow/cpp && \
git checkout tags/apache-arrow-0.17.1 && \
yum install -y boost-devel && \
CFLAGS=-std=c99 pip install numpy==1.19.2 cython==0.29.14 scipy==1.5.2 && \
CFLAGS=-std=c99 pip install numpy==1.22.0 cython==3.0.8 scipy==1.10.0 && \
cmake -DARROW_CXXFLAGS="-lutil" -DARROW_PYTHON=on && make -j && make install && \
cd $HOME/arrow/python && \
ARROW_HOME=/usr/local python setup.py install && \
Expand All @@ -171,9 +164,11 @@ RUN bash -c 'if [ `arch` = "ppc64le" ]; then \
#
RUN echo ${python_version}

RUN pip install -U pip==20.1.1
RUN pip install -U pip==23.0.1

RUN pip install numpy==1.19.2 scipy==1.5.2 setuptools==49.2.0
RUN pip install Cython==3.0.8

RUN pip install numpy==1.22.0 scipy==1.10.0 setuptools==49.6.0

COPY src/interface_py/requirements_buildonly.txt requirements_buildonly.txt

Expand All @@ -187,13 +182,15 @@ RUN (localedef -v -c -i en_US -f UTF-8 en_US.UTF-8 || true)
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en

# RUN dnf install -y --enablerepo=epel boost169-devel

RUN conda install -y conda-forge::icu conda-forge::python-devtools conda-forge::cuda-opencl-dev

# See https://github.com/Microsoft/LightGBM/wiki/Installation-Guide#with-gpu-support for details
# https://github.com/Microsoft/LightGBM/pull/929/files
# Could compile with these as well: -DBOOST_COMPUTE_USE_OFFLINE_CACHE=OFF -DBOOST_COMPUTE_THREAD_SAFE=ON
RUN \
export CUDA_HOME=/usr/local/cuda/ && \
yum install -y opencl-headers icu libicu-devel bzip2 bzip2-devel zlib-devel python-devel && \
wget https://s3.amazonaws.com/0xdata-public/boost/boost_1_72_0.tar.bz2 && \
tar xjf boost_1_72_0.tar.bz2 && \
cd boost_1_72_0 && \
Expand All @@ -220,6 +217,8 @@ RUN bash -c 'if [ `arch` == "ppc64le" ]; then \
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib64/nvidia
ENV CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda

RUN git config --global --add safe.directory /root/repo

WORKDIR $HOME

ENV GIT_AUTHOR_NAME="anonymous"
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile-runtime-multi-gpu
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ENV PATH=/usr/local/cuda/bin:$PATH
ENV CUDADIR=/usr/local/cuda/include/
ENV LD_LIBRARY_PATH=/usr/lib64:/usr/local/lib:$LD_LIBRARY_PATH

ENV MINICONDA_VERSION=4.8.3
ENV MINICONDA_VERSION=23.3.1-0

# Setup gcc etc.
RUN yum install -y epel-release
Expand Down Expand Up @@ -53,8 +53,8 @@ ENV LLVM_CONFIG=$LLVM4/bin/llvm-config
ARG python_version

# ln -sf /usr/bin/python36 /usr/bin/python breaks yum
RUN if [ "$use_miniconda" = "1" ] ; then wget https://repo.anaconda.com/miniconda/Miniconda3-py38_${MINICONDA_VERSION}-Linux-`arch`.sh && \
bash Miniconda3-py38_${MINICONDA_VERSION}-Linux-`arch`.sh -b -p /opt/h2oai/h2o4gpu/python && \
RUN if [ "$use_miniconda" = "1" ] ; then wget https://repo.anaconda.com/miniconda/Miniconda3-py310_${MINICONDA_VERSION}-Linux-`arch`.sh && \
bash Miniconda3-py310_${MINICONDA_VERSION}-Linux-`arch`.sh -b -p /opt/h2oai/h2o4gpu/python && \
/opt/h2oai/h2o4gpu/python/bin/conda install -y python=${python_version} pip; else \
yum install -y python36 python36-devel python36-pip && \
ln -sf /usr/bin/python36 /usr/bin/python && ln -s /usr/bin/pip3 /usr/bin/pip; \
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile-runtime-single-gpu
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ENV PATH=/usr/local/cuda/bin:$PATH
ENV CUDADIR=/usr/local/cuda/include/
ENV LD_LIBRARY_PATH=/usr/lib64:/usr/local/lib:$LD_LIBRARY_PATH

ENV MINICONDA_VERSION=4.8.3
ENV MINICONDA_VERSION=23.3.1-0

# Setup gcc etc.
RUN yum install -y epel-release
Expand Down Expand Up @@ -42,8 +42,8 @@ RUN mkdir -p /opt/h2oai/h2o4gpu
ARG python_version

# ln -sf /usr/bin/python36 /usr/bin/python breaks yum
RUN if [ "$use_miniconda" = "1" ] ; then wget https://repo.anaconda.com/miniconda/Miniconda3-py38_${MINICONDA_VERSION}-Linux-`arch`.sh && \
bash Miniconda3-py38_${MINICONDA_VERSION}-Linux-`arch`.sh -b -p /opt/h2oai/h2o4gpu/python && \
RUN if [ "$use_miniconda" = "1" ] ; then wget https://repo.anaconda.com/miniconda/Miniconda3-py310_${MINICONDA_VERSION}-Linux-`arch`.sh && \
bash Miniconda3-py310_${MINICONDA_VERSION}-Linux-`arch`.sh -b -p /opt/h2oai/h2o4gpu/python && \
/opt/h2oai/h2o4gpu/python/bin/conda install -y python=${python_version} pip; else \
yum install -y python36 python36-devel python36-pip && \
ln -sf /usr/bin/python36 /usr/bin/python && ln -s /usr/bin/pip3 /usr/bin/pip; \
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ docker-build:
export CONTAINER_NAME="local-make-build-cuda$(DOCKER_CUDA_VERSION)" ;\
export versionTag=$(BASE_VERSION) ;\
export extratag="-cuda$(DOCKER_CUDA_VERSION)" ;\
export dockerimage="nvidia/cuda${DOCKER_ARCH}:$(DOCKER_CUDA_VERSION)-cudnn$(DOCKER_CUDNN_VERSION)-devel-centos7" ;\
export dockerimage="nvidia/cuda:11.2.2-devel-ubi8" ;\
bash scripts/make-docker-devel.sh

docker-runtime:
Expand All @@ -337,7 +337,7 @@ docker-runtime:
export versionTag=$(BASE_VERSION) ;\
export extratag="-cuda$(DOCKER_CUDA_VERSION)" ;\
export fullVersionTag=$(BASE_VERSION) ;\
export dockerimage="nvidia/cuda${DOCKER_ARCH}:$(DOCKER_CUDA_VERSION)-cudnn$(DOCKER_CUDNN_VERSION)-runtime-centos7" ;\
export dockerimage="nvidia/cuda:11.2.2-devel-ubi8" ;\
bash scripts/make-docker-runtime.sh

docker-runtime-run:
Expand All @@ -349,7 +349,7 @@ docker-runtests:
@echo "+-- Run tests in docker (-nccl-cuda9) --+"
export CONTAINER_NAME="localmake-runtests" ;\
export extratag="-cuda$(DOCKER_CUDA_VERSION)" ;\
export dockerimage="nvidia/cuda${DOCKER_ARCH}:$(DOCKER_CUDA_VERSION)-cudnn$(DOCKER_CUDNN_VERSION)-devel-centos7" ;\
export dockerimage="nvidia/cuda:11.2.2-devel-ubi8" ;\
export target="dotest" ;\
bash scripts/make-docker-runtests.sh

Expand Down
Loading