Add CUDA deps-only base image for BOUT-dev CI#41
Conversation
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add libssl-dev to apt packages (required by libevent/OpenSSL for Spack) - Add ^mpich constraint to netcdf-cxx4 and fftw (prevents building OpenMPI) - Add openssl to spack external find - Add --show-log-on-error to spack install - Add /usr/local/bin/bout-env.bash helper script - Remove bout-build stage (BOUT-dev CI handles cloning/building) - Remove hardcoded password and boutuser creation - Remove unused matrix build-args from CI workflow - Set image tag to boutdev-cuda - Simplify README to reflect deps-only purpose Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
dschwoerer
left a comment
There was a problem hiding this comment.
Thanks, looks good. Just a few small things.
| make -j 2 build-check && \ | ||
| make check && cd ../.. && rm -rf BOUT-dev | ||
| ' > /usr/local/bin/bout-env.bash && \ | ||
| chmod +x /usr/local/bin/bout-env.bash |
There was a problem hiding this comment.
It would be nice to make sure the image is working. This way we can test that regressions are not introduced by building a broken image.
| chmod +x /usr/local/bin/bout-env.bash | |
| chmod +x /usr/local/bin/bout-env.bash | |
| USER boutuser | |
| RUN git clone ${BOUT_URL} BOUT-dev && \ | |
| cd BOUT-dev && \ | |
| git checkout ${BOUT_COMMIT} && \ | |
| . /usr/local/bin/bout-env.bash && \ | |
| git submodule update --init --recursive && \ | |
| cmake -S . \ | |
| -B build \ | |
| -DCMAKE_C_COMPILER=gcc \ | |
| -DCMAKE_CXX_COMPILER=g++ \ | |
| -DBOUT_ENABLE_RAJA=on \ | |
| -DBOUT_ENABLE_UMPIRE=on \ | |
| -DBOUT_ENABLE_CUDA=on \ | |
| -DCMAKE_CUDA_ARCHITECTURES=80 \ | |
| -DCUDA_ARCH=compute_80,code=sm_80 \ | |
| -DBOUT_ENABLE_WARNINGS=off \ | |
| -DBOUT_USE_SYSTEM_FMT=on && \ | |
| cd build && \ | |
| make -j 2 build-check && \ | |
| make check && cd ../.. && rm -rf BOUT-dev |
| spack env activate /spack-env | ||
| spack load cmake fmt raja umpire netcdf-cxx4 fftw | ||
| ``` | ||
| The image is rebuilt monthly by CI and on every push to `ci-cuda`. |
There was a problem hiding this comment.
once this is merged, it will be in the main branch.
|
|
||
| This directory contains a Dockerfile for building BOUT++ with CUDA support. | ||
| Dependencies-only base container for BOUT-dev CUDA CI. Provides a Spack-managed | ||
| toolchain (CUDA 12.6, RAJA, Umpire, fmt, NetCDF, FFTW) on Ubuntu 22.04. |
There was a problem hiding this comment.
Can you remove that, so we do not duplicate that information in the docs and in the code?
| with: | ||
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
| tags: | | ||
| type=raw,value=boutdev-cuda |
There was a problem hiding this comment.
Can we call this ci-cuda, in line with ci-fedora?
| Or simply use the helper script: | ||
| ```bash | ||
| /usr/local/bin/bout-env.sh <your-command> | ||
| docker build -t boutdev-cuda:latest ci-cuda/ |
There was a problem hiding this comment.
Does this also need fixing?
There was a problem hiding this comment.
I will double check and come back to you later today. Thanks for the review.
- Add BOUT++ clone/build/test step to validate the image works - Rename image tag from boutdev-cuda to ci-cuda (consistent with ci-fedora) - Remove duplicated toolchain details from README - Fix local build command in README to use ci-cuda tag Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
This is failing with: Also, it seems no python packages are installed. Would it be possible to install them also into the image? |
|
@dschwoerer Yes, I will make sure the CICD is passing. |
camp/BLT requires CMAKE_CUDA_HOST_COMPILER to be set before ENABLE_LANGUAGE(CUDA). Without it, the cmake configuration fails with: "CUDA language enabled prior to setting CMAKE_CUDA_HOST_COMPILER" Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…lidate stage - Downgrade fmt 11.0.2 -> 10.2.1 for CUDA/nvcc compatibility - Install BOUT++ Python dependencies (numpy, scipy, netcdf4, boutdata, etc.) - Move BOUT++ validation build into a separate 'validate' Docker stage (requires --gpus all; not run in CI since runners lack GPUs) - CI now builds 'setup-spack' target only to avoid GPU-requiring steps - Parameterize CUDA_ARCH in validate stage cmake flags Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
dschwoerer
left a comment
There was a problem hiding this comment.
Thanks, looks goods 👍
|
This is using fmt 10, I'd really like to use the latest version, 12. It looks like the problem is that the compiler, gcc 16, is defaulting to C++20 -- so this needs boutproject/BOUT-dev#3265 to go in first |
Summary
Adds a CUDA dependencies base image (
ci-cuda/) for use by BOUT-dev CI. This supersedes PR #39 with the following improvements:libssl-devto apt packages (required by libevent/OpenSSL for Spack builds)^mpichconstraint tonetcdf-cxx4andfftwspecs (prevents building OpenMPI from source)openssltospack external find--show-log-on-errortospack install/usr/local/bin/bout-env.bashhelper script for activating the Spack envbout-buildstage, hardcoded password, and boutuser creationMPI,TYPE,OPENMP); set image tag toboutdev-cudaPublishes to
ghcr.io/boutproject/bout-container-base:boutdev-cuda.Companion PR: boutproject/BOUT-dev#3272
Fixes boutproject/BOUT-dev#3233
Test plan
🤖 Generated with Claude Code