From 0a32f51a838080e36249514d3ba8f7daaa73d898 Mon Sep 17 00:00:00 2001 From: Alan Dayton Date: Thu, 25 Jul 2024 11:25:25 -0700 Subject: [PATCH] Update docker images and switch to GitHub Actions --- .github/workflows/build.yml | 60 +++++++++++++++++++++++++++++ Dockerfile | 76 +++++++++---------------------------- azure-pipelines.yml | 45 ---------------------- 3 files changed, 78 insertions(+), 103 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 azure-pipelines.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..9845907d --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,60 @@ +on: push +name: Build +jobs: + build_docker: + strategy: + matrix: + target: [gcc, clang, intel, cuda, hip, sycl] + runs-on: ubuntu-latest + steps: + - run: | + sudo rm -rf /usr/share/dotnet + sudo rm -rf /usr/local/lib/android + sudo rm -rf /opt/ghc + sudo rm -rf /opt/hostedtoolcache/CodeQL + sudo docker image prune --all --force + - uses: actions/checkout@v2 + with: + submodules: recursive + - uses: docker/setup-buildx-action@v3 + - uses: docker/build-push-action@v6 + with: + target: ${{ matrix.target }} + build_mac: + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + - uses: threeal/cmake-action@v1.3.0 + with: + build-dir: build + options: + ENABLE_WARNINGS_AS_ERRORS=Off + CMAKE_BUILD_TYPE=Release + run-build: true + build-args: '--parallel 16' + - uses: threeal/ctest-action@v1.1.0 + build_windows: + strategy: + matrix: + shared: + - args: + BUILD_SHARED_LIBS=On + CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=On + - args: BUILD_SHARED_LIBS=Off + + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + - uses: threeal/cmake-action@v1.3.0 + with: + build-dir: build + options: + ENABLE_WARNINGS_AS_ERRORS=Off + CMAKE_BUILD_TYPE=Release + ${{ matrix.shared.args }} + run-build: true + build-args: '--parallel 16' diff --git a/Dockerfile b/Dockerfile index 42853e19..8636ac3e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,88 +1,48 @@ -FROM ghcr.io/rse-ops/gcc-ubuntu-20.04:gcc-7.3.0 AS gcc7 +FROM ghcr.io/llnl/radiuss:ubuntu-22.04-gcc-13 AS gcc ENV GTEST_COLOR=1 COPY . /home/chai/workspace WORKDIR /home/chai/workspace/build -RUN cmake -DENABLE_COVERAGE=On -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=g++ .. && \ +RUN cmake -DENABLE_COVERAGE=On -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc .. && \ make -j 16 && \ ctest -T test --output-on-failure -FROM ghcr.io/rse-ops/gcc-ubuntu-20.04:gcc-8.1.0 AS gcc8 +FROM ghcr.io/llnl/radiuss:clang-15-ubuntu-22.04 AS clang ENV GTEST_COLOR=1 COPY . /home/chai/workspace WORKDIR /home/chai/workspace/build -RUN cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=g++ .. && \ +RUN cmake -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang .. && \ make -j 16 && \ ctest -T test --output-on-failure -FROM ghcr.io/rse-ops/gcc-ubuntu-18.04:gcc-9.4.0 AS gcc9 +FROM ghcr.io/llnl/radiuss:intel-2024.0-ubuntu-20.04 AS intel ENV GTEST_COLOR=1 COPY . /home/chai/workspace WORKDIR /home/chai/workspace/build -RUN cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=g++ .. && \ +RUN /bin/bash -c "source /opt/intel/oneapi/setvars.sh 2>&1 > /dev/null && \ + cmake -DCMAKE_CXX_COMPILER=icpx -DCMAKE_C_COMPILER=icx -DENABLE_WARNINGS_AS_ERRORS=Off .. && \ make -j 16 && \ - ctest -T test --output-on-failure + ctest -T test --output-on-failure" -FROM ghcr.io/rse-ops/gcc-ubuntu-18.04:gcc-11.2.0 AS gcc11 +FROM ghcr.io/llnl/radiuss:ubuntu-22.04-cuda-12-3 AS cuda ENV GTEST_COLOR=1 COPY . /home/chai/workspace WORKDIR /home/chai/workspace/build -RUN cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=g++ .. && \ - make -j 16 && \ - ctest -T test --output-on-failure - -FROM ghcr.io/rse-ops/clang-ubuntu-20.04:llvm-10.0.0 AS clang10 -ENV GTEST_COLOR=1 -COPY . /home/chai/workspace -WORKDIR /home/chai/workspace/build -RUN cmake -DCMAKE_CXX_COMPILER=clang++ .. && \ - make -j 16 && \ - ctest -T test --output-on-failure - -FROM ghcr.io/rse-ops/clang-ubuntu-22.04:llvm-11.0.0 AS clang11 -ENV GTEST_COLOR=1 -COPY . /home/chai/workspace -WORKDIR /home/chai/workspace/build -RUN cmake -DCMAKE_CXX_COMPILER=clang++ .. && \ - make -j 16 && \ - ctest -T test --output-on-failure - -FROM ghcr.io/rse-ops/clang-ubuntu-22.04:llvm-12.0.0 AS clang12 -ENV GTEST_COLOR=1 -COPY . /home/chai/workspace -WORKDIR /home/chai/workspace/build -RUN cmake -DCMAKE_CXX_COMPILER=clang++ .. && \ - make -j 16 && \ - ctest -T test --output-on-failure - -FROM ghcr.io/rse-ops/clang-ubuntu-22.04:llvm-13.0.0 AS clang13 -ENV GTEST_COLOR=1 -COPY . /home/chai/workspace -WORKDIR /home/chai/workspace/build -RUN cmake -DCMAKE_CXX_COMPILER=clang++ .. && \ - make -j 16 && \ - ctest -T test --output-on-failure - -FROM ghcr.io/rse-ops/cuda:cuda-10.1.243-ubuntu-18.04 AS nvcc10 -ENV GTEST_COLOR=1 -COPY . /home/chai/workspace -WORKDIR /home/chai/workspace/build -RUN . /opt/spack/share/spack/setup-env.sh && spack load cuda && \ - cmake -DCMAKE_CXX_COMPILER=g++ -DENABLE_CUDA=On .. && \ +RUN cmake -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc -DENABLE_CUDA=On -DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc -DCMAKE_CUDA_ARCHITECTURES=70 .. && \ make -j 16 -FROM ghcr.io/rse-ops/cuda-ubuntu-20.04:cuda-11.1.1 AS nvcc11 +# TODO: switch to ROCM 6 +FROM ghcr.io/llnl/radiuss:hip-5.6.1-ubuntu-20.04 AS hip ENV GTEST_COLOR=1 +ENV HCC_AMDGPU_TARGET=gfx900 COPY . /home/chai/workspace WORKDIR /home/chai/workspace/build -RUN . /opt/spack/share/spack/setup-env.sh && spack load cuda && \ - cmake -DCMAKE_CXX_COMPILER=g++ -DENABLE_CUDA=On .. && \ +RUN cmake -DCMAKE_CXX_COMPILER=amdclang++ -DCMAKE_C_COMPILER=amdclang -DENABLE_HIP=On -DENABLE_WARNINGS_AS_ERRORS=Off .. && \ make -j 16 -FROM ghcr.io/rse-ops/hip-ubuntu-22.04:hip-5.1.3 AS hip +FROM ghcr.io/llnl/radiuss:intel-2024.0-ubuntu-20.04 AS sycl ENV GTEST_COLOR=1 -ENV HCC_AMDGPU_TARGET=gfx900 COPY . /home/chai/workspace WORKDIR /home/chai/workspace/build -RUN . /opt/spack/share/spack/setup-env.sh && spack load hip llvm-amdgpu && \ - cmake -DENABLE_WARNINGS_AS_ERRORS=Off -DCHAI_ENABLE_MANAGED_PTR=Off -DCMAKE_CXX_COMPILER=amdclang++ -DCMAKE_C_COMPILER=amdclang -DENABLE_HIP=On .. && \ - make -j 16 VERBOSE=1 +RUN /bin/bash -c "source /opt/intel/oneapi/setvars.sh 2>&1 > /dev/null && \ + cmake -DCMAKE_CXX_COMPILER=dpcpp -DCMAKE_C_COMPILER=icx -DENABLE_WARNINGS_AS_ERRORS=Off .. && \ + make -j 16" diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 781851f3..00000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,45 +0,0 @@ -jobs: -- job: Docker - timeoutInMinutes: 360 - strategy: - matrix: - gcc7: - docker_target: gcc7 - gcc8: - docker_target: gcc8 - gcc9: - docker_target: gcc9 - clang10: - docker_target: clang10 - clang11: - docker_target: clang11 - clang12: - docker_target: clang12 - clang13: - docker_target: clang13 - pool: - vmImage: 'ubuntu-latest' - variables: - DOCKER_BUILDKIT: '1' - steps: - - checkout: self - clean: boolean - submodules: recursive - - task: Docker@1 - inputs: - command: build - dockerFile: 'Dockerfile' - arguments: '--target $(docker_target)' - - script: | - CID=$(docker create llnl/chai:$(Build.BuildId)) - echo ${CID} - docker cp ${CID}:/home/chai/workspace/build local-build - docker rm ${CID} - displayName: 'Copy test artifacts' - condition: ne( variables['docker_target'], 'nvcc') - - task: PublishTestResults@2 - inputs: - testResultsFormat: 'cTest' - testResultsFiles: '**/Test.xml' - testRunTitle: '$(docker_target) Tests' - condition: ne( variables['docker_target'], 'nvcc')