From 231a6635d5ff537e3aee2c91e6258dbc8e97b6a4 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Mon, 2 Sep 2024 23:12:35 -0500 Subject: [PATCH] allow passing a git sha --- docker/dockerfile-cli | 3 +-- docker/dockerfile-python | 5 ++++- docker/dockerfile-r | 4 ++-- docker/gpu/dockerfile-cli-only-distroless.gpu | 5 ++++- docker/gpu/dockerfile-cli-only.gpu | 5 ++++- docker/gpu/dockerfile.gpu | 5 ++++- 6 files changed, 19 insertions(+), 8 deletions(-) diff --git a/docker/dockerfile-cli b/docker/dockerfile-cli index 55179e1ef7d..a8ef5081167 100644 --- a/docker/dockerfile-cli +++ b/docker/dockerfile-cli @@ -23,9 +23,8 @@ RUN curl -L -o cmake.sh https://github.com/Kitware/CMake/releases/download/v3.29 RUN git clone \ --recursive \ - --branch ${LIGHTGBM_GIT_REF} \ - --depth 1 \ https://github.com/Microsoft/LightGBM && \ + git -C ./LightGBM checkout ${LIGHTGBM_GIT_REF} && \ cd ./LightGBM && \ cmake -B build -S . && \ cmake --build build -j4 && \ diff --git a/docker/dockerfile-python b/docker/dockerfile-python index 231eafc675f..030fd22e50e 100644 --- a/docker/dockerfile-python +++ b/docker/dockerfile-python @@ -23,7 +23,10 @@ RUN apt-get update && \ conda config --set always_yes yes --set changeps1 no && \ # lightgbm conda install -q -y numpy scipy scikit-learn pandas && \ - git clone --recursive --branch ${LIGHTGBM_GIT_REF} --depth 1 https://github.com/Microsoft/LightGBM && \ + git clone \ + --recursive \ + https://github.com/Microsoft/LightGBM && \ + git -C ./LightGBM checkout ${LIGHTGBM_GIT_REF} && \ cd ./LightGBM && \ sh ./build-python.sh install && \ # clean diff --git a/docker/dockerfile-r b/docker/dockerfile-r index 19af3ccffc8..3d6d4bb48a8 100644 --- a/docker/dockerfile-r +++ b/docker/dockerfile-r @@ -9,8 +9,8 @@ RUN apt-get update && \ libomp-dev && \ git clone \ --recursive \ - --branch ${LIGHTGBM_GIT_REF} \ - --depth 1 https://github.com/Microsoft/LightGBM && \ + https://github.com/Microsoft/LightGBM && \ + git -C ./LightGBM checkout ${LIGHTGBM_GIT_REF} && \ cd ./LightGBM && \ sh build-cran-package.sh --no-build-vignettes && \ MAKEFLAGS="-j2" R CMD INSTALL ./lightgbm_*.tar.gz && \ diff --git a/docker/gpu/dockerfile-cli-only-distroless.gpu b/docker/gpu/dockerfile-cli-only-distroless.gpu index 97a9aea87b2..c6b84075123 100644 --- a/docker/gpu/dockerfile-cli-only-distroless.gpu +++ b/docker/gpu/dockerfile-cli-only-distroless.gpu @@ -40,7 +40,10 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ # LightGBM WORKDIR /opt -RUN git clone --recursive --branch ${LIGHTGBM_GIT_REF} --depth 1 https://github.com/Microsoft/LightGBM && \ +RUN git clone \ + --recursive \ + https://github.com/Microsoft/LightGBM && \ + git -C ./LightGBM checkout ${LIGHTGBM_GIT_REF} && \ cd LightGBM && \ cmake -B build -S . -DUSE_GPU=1 -DOpenCL_LIBRARY=${OPENCL_LIBRARIES}/libOpenCL.so.1 -DOpenCL_INCLUDE_DIR=$OPENCL_INCLUDE_DIR && \ OPENCL_HEADERS=$OPENCL_INCLUDE_DIR LIBOPENCL=$OPENCL_LIBRARIES cmake --build build diff --git a/docker/gpu/dockerfile-cli-only.gpu b/docker/gpu/dockerfile-cli-only.gpu index 7333f481090..940d1d2bd46 100644 --- a/docker/gpu/dockerfile-cli-only.gpu +++ b/docker/gpu/dockerfile-cli-only.gpu @@ -40,7 +40,10 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ # LightGBM WORKDIR /opt -RUN git clone --recursive --branch ${LIGHTGBM_GIT_REF} --depth 1 https://github.com/Microsoft/LightGBM && \ +RUN git clone \ + --recursive \ + https://github.com/Microsoft/LightGBM && \ + git -C ./LightGBM checkout ${LIGHTGBM_GIT_REF} && \ cd LightGBM && \ cmake -B build -S . -DUSE_GPU=1 -DOpenCL_LIBRARY=${OPENCL_LIBRARIES}/libOpenCL.so.1 -DOpenCL_INCLUDE_DIR=$OPENCL_INCLUDE_DIR && \ OPENCL_HEADERS=$OPENCL_INCLUDE_DIR LIBOPENCL=$OPENCL_LIBRARIES cmake --build build diff --git a/docker/gpu/dockerfile.gpu b/docker/gpu/dockerfile.gpu index fab9362cf5b..8de7f295fef 100644 --- a/docker/gpu/dockerfile.gpu +++ b/docker/gpu/dockerfile.gpu @@ -82,7 +82,10 @@ RUN conda config --set always_yes yes --set changeps1 no && \ ################################################################################################################# RUN cd /usr/local/src && mkdir lightgbm && cd lightgbm && \ - git clone --recursive --branch ${LIGHTGBM_GIT_REF} --depth 1 https://github.com/microsoft/LightGBM && \ + git clone \ + --recursive \ + https://github.com/Microsoft/LightGBM && \ + git -C ./LightGBM checkout ${LIGHTGBM_GIT_REF} && \ cd LightGBM && \ cmake -B build -S . -DUSE_GPU=1 -DOpenCL_LIBRARY=/usr/local/cuda/lib64/libOpenCL.so -DOpenCL_INCLUDE_DIR=/usr/local/cuda/include/ && \ OPENCL_HEADERS=/usr/local/cuda-8.0/targets/x86_64-linux/include LIBOPENCL=/usr/local/cuda-8.0/targets/x86_64-linux/lib cmake --build build