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

build: Add Docker images for CUDA development #12413

Closed
wants to merge 12 commits into from
2 changes: 1 addition & 1 deletion .github/workflows/linux-build-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
simdjson_SOURCE: BUNDLED
xsimd_SOURCE: BUNDLED
geos_SOURCE: BUNDLED
CUDA_VERSION: "12.4"
CUDA_VERSION: "12.8"
USE_CLANG: "${{ inputs.use-clang && 'true' || 'false' }}"
steps:
- uses: actions/checkout@v4
Expand Down
37 changes: 36 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,48 @@ services:
environment:
NUM_THREADS: 8 # default value for NUM_THREADS
CCACHE_DIR: "/velox/.ccache"
EXTRA_CMAKE_FLAGS: -DVELOX_ENABLE_PARQUET=ON
EXTRA_CMAKE_FLAGS: -DVELOX_ENABLE_PARQUET=ON
-DVELOX_ENABLE_S3=ON
volumes:
- .:/velox:delegated
working_dir: /velox
command: /velox/scripts/docker-command.sh

adapters-cuda:
# Usage:
# docker-compose pull adapters-cuda or docker-compose build adapters-cuda
# or
# docker-compose run --rm adapters-cuda
# or
# docker-compose run -e NUM_THREADS=<NUMBER_OF_THREADS_TO_USE> --rm adapters-cuda
# to set the number of threads used during compilation
# scripts/adapters.dockerfile uses SHELL which is not supported for OCI image format.
# podman users must specify "--podman-build-args='--format docker'" argument.
image: ghcr.io/facebookincubator/velox-dev:adapters
build:
context: .
dockerfile: scripts/adapters.dockerfile
args:
image: ghcr.io/facebookincubator/velox-dev:centos9
environment:
NUM_THREADS: 8 # default value for NUM_THREADS
CCACHE_DIR: "/velox/.ccache"
EXTRA_CMAKE_FLAGS: -DVELOX_ENABLE_PARQUET=ON
-DVELOX_ENABLE_S3=ON
privileged: true
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
volumes:
- .:/velox:delegated
working_dir: /velox
command: /velox/scripts/docker-command.sh


centos-cpp:
# Usage:
# docker-compose pull centos-cpp or docker-compose build centos-cpp
Expand Down
19 changes: 17 additions & 2 deletions scripts/adapters.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,23 @@

COPY scripts/setup-helper-functions.sh /
COPY scripts/setup-adapters.sh /
RUN mkdir build && ( cd build && source /opt/rh/gcc-toolset-12/enable && \
bash /setup-adapters.sh ) && rm -rf build && dnf remove -y conda && dnf clean all
COPY scripts/setup-centos9.sh /
RUN mkdir build && \
( \
cd build && \
source /opt/rh/gcc-toolset-12/enable && \
bash /setup-adapters.sh && \
source /setup-centos9.sh && \
install_cuda 12.8 \
) && \
rm -rf build && dnf remove -y conda && dnf clean all

# put CUDA binaries on the PATH
ENV PATH /usr/local/cuda/bin:${PATH}

Check warning on line 32 in scripts/adapters.dockerfile

View workflow job for this annotation

GitHub Actions / Build and Push Adapters

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/

# configuration for nvidia-container-toolkit
ENV NVIDIA_VISIBLE_DEVICES all

Check warning on line 35 in scripts/adapters.dockerfile

View workflow job for this annotation

GitHub Actions / Build and Push Adapters

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility

Check warning on line 36 in scripts/adapters.dockerfile

View workflow job for this annotation

GitHub Actions / Build and Push Adapters

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/

# install miniforge
RUN curl -L -o /tmp/miniforge.sh https://github.com/conda-forge/miniforge/releases/download/23.11.0-0/Mambaforge-23.11.0-0-Linux-x86_64.sh && \
Expand Down
6 changes: 5 additions & 1 deletion scripts/setup-centos9.sh
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,11 @@ function install_cuda {
# See https://developer.nvidia.com/cuda-downloads
dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel9/x86_64/cuda-rhel9.repo
local dashed="$(echo $1 | tr '.' '-')"
dnf install -y cuda-nvcc-$dashed cuda-cudart-devel-$dashed cuda-nvrtc-devel-$dashed cuda-driver-devel-$dashed
dnf install -y \
cuda-compat-$dashed \
cuda-driver-devel-$dashed \
cuda-minimal-build-$dashed \
cuda-nvrtc-devel-$dashed
}

function install_geos {
Expand Down
6 changes: 5 additions & 1 deletion scripts/setup-ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,11 @@ function install_cuda {
$SUDO apt update
fi
local dashed="$(echo $1 | tr '.' '-')"
$SUDO apt install -y cuda-nvcc-$dashed cuda-cudart-dev-$dashed cuda-nvrtc-dev-$dashed cuda-driver-dev-$dashed
$SUDO apt install -y \
cuda-compat-$dashed \
cuda-driver-dev-$dashed \
cuda-minimal-build-$dashed \
cuda-nvrtc-dev-$dashed
}

function install_geos {
Expand Down