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

WIP: [docker] [ci] fix dockerfiles, test docker builds in CI #6638

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
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
Prev Previous commit
Next Next commit
add CI job
  • Loading branch information
jameslamb committed Sep 3, 2024
commit 0c5581e2b6862b85a9daa2d87525e654ae939305
64 changes: 64 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Docker

on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:

# automatically cancel in-progress builds if another commit is pushed
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: dockerfile-cli
shell:
docker build \
--build-arg LIGHTGBM_GIT_REF=${{ github.ref }} \
- < ./docker/dockerfile-python
- name: dockerfile-r
shell:
docker build \
--build-arg LIGHTGBM_GIT_REF=${{ github.ref }} \
- < ./docker/dockerfile-r
- name: dockerfile-python
shell:
docker build \
--build-arg LIGHTGBM_GIT_REF=${{ github.ref }} \
- < ./docker/dockerfile-python
- name: dockerfile.gpu
shell:
docker build \
--build-arg LIGHTGBM_GIT_REF=${{ github.ref }} \
- < ./docker/gpu/dockerfile.gpu
- name: dockerfile-cli-only.gpu
shell:
docker build \
--build-arg LIGHTGBM_GIT_REF=${{ github.ref }} \
- < ./docker/gpu/dockerfile-cli-only.gpu
- name: dockerfile-cli-only-distroless.gpu
shell:
docker build \
--build-arg LIGHTGBM_GIT_REF=${{ github.ref }} \
- < ./docker/gpu/dockerfile-cli-only-distroless.gpu
all-docker-jobs-successful:
if: always()
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Note that all tests succeeded
uses: re-actors/alls-green@v1.2.2
with:
jobs: ${{ toJSON(needs) }}
3 changes: 2 additions & 1 deletion docker/gpu/dockerfile-cli-only-distroless.gpu
Original file line number Diff line number Diff line change
@@ -17,6 +17,7 @@

FROM nvidia/opencl:devel-ubuntu18.04 AS build
ARG DEBIAN_FRONTEND=noninteractive
ARG LIGHTGBM_GIT_REF=stable
ARG OPENCL_LIBRARIES=/usr/lib/x86_64-linux-gnu
ARG OPENCL_INCLUDE_DIR=/usr/include/CL

@@ -39,7 +40,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \

# LightGBM
WORKDIR /opt
RUN git clone --recursive --branch stable --depth 1 https://github.com/Microsoft/LightGBM && \
RUN git clone --recursive --branch ${LIGHTGBM_GIT_REF} --depth 1 https://github.com/Microsoft/LightGBM && \
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
3 changes: 2 additions & 1 deletion docker/gpu/dockerfile-cli-only.gpu
Original file line number Diff line number Diff line change
@@ -17,6 +17,7 @@

FROM nvidia/opencl:devel AS build
ARG DEBIAN_FRONTEND=noninteractive
ARG LIGHTGBM_GIT_REF=stable
ARG OPENCL_LIBRARIES=/usr/lib/x86_64-linux-gnu
ARG OPENCL_INCLUDE_DIR=/usr/include/CL

@@ -39,7 +40,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \

# LightGBM
WORKDIR /opt
RUN git clone --recursive --branch stable --depth 1 https://github.com/Microsoft/LightGBM && \
RUN git clone --recursive --branch ${LIGHTGBM_GIT_REF} --depth 1 https://github.com/Microsoft/LightGBM && \
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
3 changes: 2 additions & 1 deletion docker/gpu/dockerfile.gpu
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@ FROM nvidia/cuda:8.0-cudnn5-devel

ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
ARG DEBIAN_FRONTEND=noninteractive
ARG LIGHTGBM_GIT_REF=stable

#################################################################################################################
# Global Path Setting
@@ -81,7 +82,7 @@ RUN conda config --set always_yes yes --set changeps1 no && \
#################################################################################################################

RUN cd /usr/local/src && mkdir lightgbm && cd lightgbm && \
git clone --recursive --branch stable --depth 1 https://github.com/microsoft/LightGBM && \
git clone --recursive --branch ${LIGHTGBM_GIT_REF} --depth 1 https://github.com/microsoft/LightGBM && \
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
Loading
Oops, something went wrong.