Skip to content

Commit

Permalink
Extent matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
sleeepyjack committed Aug 19, 2023
1 parent 7099dd7 commit d29594b
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 11 deletions.
30 changes: 23 additions & 7 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ defaults:
on:
workflow_call:
inputs:
devcontainer_version: {type: string, required: true}
cuda_version: {type: string, required: true}
compiler: {type: string, required: true}
compiler_exe: {type: string, required: true}
Expand All @@ -33,30 +34,45 @@ on:
build_script: {type: string, required: false}
test_script: {type: string, required: false}
run_tests: {type: boolean, required: false, default: true}
build_image: {type: string, required: false}
test_image: {type: string, required: false}

jobs:
devcontainer_image:
name: Get image ${{ inputs.os }}/${{ inputs.compiler }}${{ inputs.compiler_version }}
runs-on: ubuntu-latest
outputs:
image_name: ${{ steps.compute-devcontainer-image-name.outputs.name }}
steps:
- name: Compute devcontainer image name
id: compute-devcontainer-image-name
run: |
COMPILER_SEGMENT=""
if [ "${{ inputs.compiler }}" != "cc" ] && [ "${{ inputs.compiler_exe }}" != "c++" ]; then
COMPILER_SEGMENT="${{ inputs.compiler }}${{ inputs.compiler_version }}-"
fi
DEVCONTAINER_IMAGE="rapidsai/devcontainers:${{inputs.devcontainer_version}}-cpp-${COMPILER_SEGMENT}cuda${{inputs.cuda_version}}-${{inputs.os}}"
echo "name=$DEVCONTAINER_IMAGE" >> $GITHUB_OUTPUT
build:
if: inputs.build_script != '' && inputs.build_image != ''
needs: devcontainer_image
if: inputs.build_script != '' && needs.devcontainer_image.outputs.image_name != ''
name: Build ${{inputs.compiler}}${{inputs.compiler_version}}/C++${{inputs.std}}
uses: ./.github/workflows/run-as-coder.yml
with:
name: Build ${{inputs.compiler}}${{inputs.compiler_version}}/C++${{inputs.std}}
runner: linux-${{inputs.cpu}}-cpu16
image: ${{inputs.build_image}}
image: ${{ needs.devcontainer_image.outputs.image_name }}
command: |
${{ inputs.build_script }} "${{inputs.compiler_exe}}" "${{inputs.std}}" "${{inputs.gpu_build_archs}}"
test:
needs: build
if: ${{ !cancelled() && ( needs.build.result == 'success' || needs.build.result == 'skipped' ) && inputs.test_script != '' && inputs.test_image != '' && inputs.run_tests}}
needs: [devcontainer_image, build]
if: ${{ !cancelled() && ( needs.build.result == 'success' || needs.build.result == 'skipped' ) && inputs.test_script != '' && needs.devcontainer_image.outputs.image_name != '' && inputs.run_tests}}
name: Test ${{inputs.compiler}}${{inputs.compiler_version}}/C++${{inputs.std}}
uses: ./.github/workflows/run-as-coder.yml
with:
name: Test ${{inputs.compiler}}${{inputs.compiler_version}}/C++${{inputs.std}}
runner: linux-${{inputs.cpu}}-gpu-v100-latest-1
image: ${{inputs.test_image}}
image: ${{ needs.devcontainer_image.outputs.image_name }}
command: |
nvidia-smi
${{ inputs.test_script }} "${{inputs.compiler_exe}}" "${{inputs.std}}" "${{inputs.gpu_build_archs}}"
3 changes: 1 addition & 2 deletions .github/workflows/dispatch-build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
matrix:
include: ${{ fromJSON(inputs.per_cuda_compiler_matrix) }}
with:
devcontainer_version: ${{ inputs.devcontainer_version }}
cuda_version: ${{ matrix.cuda }}
compiler: ${{ matrix.compiler.name }}
compiler_exe: ${{ matrix.compiler.exe }}
Expand All @@ -44,7 +45,5 @@ jobs:
cpu: ${{ matrix.cpu }}
os: ${{ matrix.os }}
build_script: ${{ inputs.build_script }}
build_image: rapidsai/devcontainers:${{inputs.devcontainer_version}}-cpp-${{matrix.compiler.name}}${{matrix.compiler.version}}-cuda${{matrix.cuda}}-${{matrix.os}}
test_script: ${{ inputs.test_script }}
run_tests: ${{ contains(matrix.jobs, 'test') && !contains(github.event.head_commit.message, 'skip-tests') }}
test_image: rapidsai/devcontainers:${{inputs.devcontainer_version}}-cpp-${{matrix.compiler.name}}${{matrix.compiler.version}}-cuda${{matrix.cuda}}-${{matrix.os}}
1 change: 0 additions & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ concurrency:
cancel-in-progress: true

jobs:

get-devcontainer-version:
name: Get devcontainer version
runs-on: ubuntu-latest
Expand Down
7 changes: 6 additions & 1 deletion ci/matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,16 @@ devcontainer_version: '23.08'
# name: The compiler name
# version: The compiler version
# exe: The unverionsed compiler binary name
# To use the system's default compiler set "exe: 'c++'" or "name: 'cc'"
# gpu_build_archs: The GPU architectures to build for using the syntax of CMAKE_CUDA_ARCHITECTURES (semi-colon separated list)
# std: The C++ standards to build for
# This field is unique as it will generate an independent build/test job for each value

# Configurations that will run for every PR
pull_request:
nvcc:
- {cuda: *cuda_newest, os: 'ubuntu22.04', cpu: 'amd64', compiler: {name: 'gcc', version: '12', exe: 'g++'}, gpu_build_archs: '70', std: [17], jobs: ['build', 'test']}
# There is currently only one CUDA 11.8 image available which comes with the system's default C++ compiler
- {cuda: *cuda_oldest, os: 'ubuntu22.04', cpu: 'amd64', compiler: {name: 'cc', version: '', exe: 'c++'}, gpu_build_archs: '60', std: [17], jobs: ['build', 'test']}
- {cuda: *cuda_newest, os: 'ubuntu22.04', cpu: 'amd64', compiler: {name: 'gcc', version: '12', exe: 'g++'}, gpu_build_archs: '70', std: [17], jobs: ['build', 'test']}
- {cuda: *cuda_newest, os: 'ubuntu22.04', cpu: 'amd64', compiler: {name: 'gcc', version: '12', exe: 'g++'}, gpu_build_archs: '80', std: [17], jobs: ['build']}
- {cuda: *cuda_newest, os: 'ubuntu22.04', cpu: 'amd64', compiler: {name: 'gcc', version: '12', exe: 'g++'}, gpu_build_archs: '90', std: [17], jobs: ['build']}

0 comments on commit d29594b

Please sign in to comment.