Skip to content
Merged
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
15 changes: 9 additions & 6 deletions Dockerfile-cluster
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
ARG BASE_IMAGE=unset
ARG INSTALL_DIR=/opt/LightGBM

# hadolint ignore=DL3006
FROM ${BASE_IMAGE}

COPY LightGBM/ ${INSTALL_DIR}/
RUN --mount=type=bind,source=LightGBM,target=/tmp/LightGBM \
<<EOF
cd /tmp/LightGBM

RUN cd "${INSTALL_DIR}" && \
sh ./build-python.sh install --precompile && \
cd /opt && \
rm -rf "${INSTALL_DIR}"
# build lightgbm package, install to site-packages/
sh ./build-python.sh install --precompile

# clear pip's cache
rm -rf ~/.cache
EOF
46 changes: 29 additions & 17 deletions Dockerfile-cluster-base
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,31 @@ find \
/usr/local/lib/python${PYTHON_VERSION}/site-packages \
-type f \
\( \
-name '*.c' \
-o -name '*.cc' \
-o -name '*.cpp' \
-o -name '*.h' \
-o -name '*.hpp' \
-o -wholename '*bokeh/sampledata/*' \
-o -wholename '*dask/*tests/*' \
-o -wholename '*joblib/test/*' \
-o -wholename '*llvmlite/tests/*' \
-o -wholename '*numba/*tests/*' \
-o -wholename '*numpy/*tests/*' \
-o -wholename '*pandas/*tests/*' \
-o -wholename '*scikit-learn/tests*' \
-o -wholename '*scikit-learn/*/tests*' \
-o -wholename '*scipy/*/tests*' \
-o -wholename '*tornado/test/*' \
-o -wholename '*/__pycache__/*' \
-name '*.c' \
-o -name '*.cc' \
-o -name '*.cpp' \
-o -name '*.h' \
-o -name '*.hpp' \
-o -wholename '*bokeh/sampledata/*' \
-o -wholename '*dask/*tests/*' \
-o -wholename '*joblib/test/*' \
-o -wholename '*llvmlite/tests/*' \
-o -wholename '*numba/*tests/*' \
-o -wholename '*numpy/*tests/*' \
-o -wholename '*pandas/tests*' \
-o -wholename '*pandas/*/tests/*' \
-o -wholename '*psutil/tests/*' \
-o -wholename 'pyarrow/_pyarrow_cpp_tests*' \
-o -wholename '*scikit-learn/tests*' \
-o -wholename '*scikit-learn/*/tests*' \
-o -wholename '*sklearn/tests*' \
-o -wholename '*sklearn/*/tests*' \
-o -wholename '*scipy/*/tests*' \
-o -wholename '*sparse/*/tests/*' \
-o -wholename '*toolz/tests/*' \
-o -wholename '*tornado/test/*' \
-o -wholename '*zict/tests/*' \
-o -wholename '*/__pycache__/*' \
\) \
-exec rm '{}' '+'

Expand All @@ -67,5 +75,9 @@ find \

# clean apt-get files
apt-get clean
apt-get purge -y --auto-remove
rm -rf /var/lib/apt/lists/*

# clean other files
rm -rf ~/.cache
EOF
16 changes: 10 additions & 6 deletions Dockerfile-notebook
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
ARG BASE_IMAGE=unset
ARG INSTALL_DIR=/root/testing/LightGBM

# hadolint ignore=DL3006
FROM ${BASE_IMAGE}

COPY jupyter_notebook_config.py /root/.jupyter/jupyter_notebook_config.py
COPY LightGBM/ ${INSTALL_DIR}/

RUN cd "${INSTALL_DIR}" && \
sh ./build-python.sh install --precompile && \
cd /root/ && \
rm -rf "${INSTALL_DIR}"
RUN --mount=type=bind,source=LightGBM,target=/tmp/LightGBM \
<<EOF
cd /tmp/LightGBM

# build lightgbm package, install to site-packages/
sh ./build-python.sh install --precompile

# clear pip's cache
rm -rf ~/.cache
EOF

WORKDIR /root/testing/notebooks
46 changes: 29 additions & 17 deletions Dockerfile-notebook-base
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,31 @@ find \
/usr/local/lib/python${PYTHON_VERSION}/site-packages \
-type f \
\( \
-name '*.c' \
-o -name '*.cc' \
-o -name '*.cpp' \
-o -name '*.h' \
-o -name '*.hpp' \
-o -wholename '*bokeh/sampledata/*' \
-o -wholename '*dask/*tests/*' \
-o -wholename '*joblib/test/*' \
-o -wholename '*llvmlite/tests/*' \
-o -wholename '*numba/*tests/*' \
-o -wholename '*numpy/*tests/*' \
-o -wholename '*pandas/*tests/*' \
-o -wholename '*scikit-learn/tests*' \
-o -wholename '*scikit-learn/*/tests*' \
-o -wholename '*scipy/*/tests*' \
-o -wholename '*tornado/test/*' \
-o -wholename '*/__pycache__/*' \
-name '*.c' \
-o -name '*.cc' \
-o -name '*.cpp' \
-o -name '*.h' \
-o -name '*.hpp' \
-o -wholename '*bokeh/sampledata/*' \
-o -wholename '*dask/*tests/*' \
-o -wholename '*joblib/test/*' \
-o -wholename '*llvmlite/tests/*' \
-o -wholename '*numba/*tests/*' \
-o -wholename '*numpy/*tests/*' \
-o -wholename '*pandas/tests*' \
-o -wholename '*pandas/*/tests/*' \
-o -wholename '*psutil/tests/*' \
-o -wholename 'pyarrow/_pyarrow_cpp_tests*' \
-o -wholename '*scikit-learn/tests*' \
-o -wholename '*scikit-learn/*/tests*' \
-o -wholename '*sklearn/tests*' \
-o -wholename '*sklearn/*/tests*' \
-o -wholename '*scipy/*/tests*' \
-o -wholename '*sparse/*/tests/*' \
-o -wholename '*toolz/tests/*' \
-o -wholename '*tornado/test/*' \
-o -wholename '*zict/tests/*' \
-o -wholename '*/__pycache__/*' \
\) \
-exec rm '{}' '+'

Expand All @@ -71,7 +79,11 @@ find \

# clean apt-get files
apt-get clean
apt-get purge -y --auto-remove
rm -rf /var/lib/apt/lists/*

# clean other files
rm -rf ~/.cache
EOF

ENTRYPOINT ["jupyter", "lab", "--ip=0.0.0.0", "--allow-root", "--port=8888"]
8 changes: 6 additions & 2 deletions bin/install-cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@ set -e -u -o pipefail

CMAKE_VERSION=${1}

install_script="cmake-${CMAKE_VERSION}-linux-$(arch).sh"

curl -O -L \
"https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-linux-$(arch).sh"
"https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/${install_script}"

mkdir /opt/cmake
sh "cmake-${CMAKE_VERSION}-linux-$(arch).sh" \
sh "${install_script}" \
--skip-license \
--prefix=/opt/cmake

rm "./${install_script}"

ln -sf /opt/cmake/bin/cmake /usr/local/bin/cmake
Loading