From 62109526c98b977b8ac855de95834deaa8eb6d1d Mon Sep 17 00:00:00 2001 From: William F Godoy Date: Thu, 8 Feb 2024 17:12:17 -0500 Subject: [PATCH] Refactor GPU CI actions --- .github/workflows/ci-gpu-nvidia-ornl.yaml | 93 ------------------- .../{ci-gpu-amd-ornl.yaml => ci-gpu.yaml} | 91 +++++++++++++++++- 2 files changed, 89 insertions(+), 95 deletions(-) delete mode 100644 .github/workflows/ci-gpu-nvidia-ornl.yaml rename .github/workflows/{ci-gpu-amd-ornl.yaml => ci-gpu.yaml} (50%) diff --git a/.github/workflows/ci-gpu-nvidia-ornl.yaml b/.github/workflows/ci-gpu-nvidia-ornl.yaml deleted file mode 100644 index 9fcedc9..0000000 --- a/.github/workflows/ci-gpu-nvidia-ornl.yaml +++ /dev/null @@ -1,93 +0,0 @@ -name: ci-gpu-nvidia-ornl - -on: - issue_comment: - types: [created] - -jobs: - wfg-RTXA4000: - if: | - github.repository_owner == 'JuliaORNL' && - github.event.issue.pull_request && - startsWith(github.event.comment.body, 'Test this please') - - runs-on: [self-hosted, Linux, X64, ci-wfg-ornl-rtxA4000-1] - - env: - GH_JOBNAME: ${{matrix.jobname}} - GH_OS: Linux - strategy: - fail-fast: false - matrix: - jobname: [CUDA12_3-JULIA1_9_4-CUDAJL5_1_1] - - steps: - # Only trigger CI for certain "actors" (those commenting the PR, not the PR originator) - - name: Verify actor - env: - ACTOR_TOKEN: ${{secrets.TOKENIZER}}${{github.actor}}${{secrets.TOKENIZER}} - SECRET_ACTORS: ${{secrets.CI_GPU_ACTORS}} - if: contains(env.SECRET_ACTORS, env.ACTOR_TOKEN) - id: check - run: | - echo "triggered=true" >> $GITHUB_OUTPUT - - # Request repo info, required since issue_comment doesn't point at PR commit, but main - - name: GitHub API Request - if: steps.check.outputs.triggered == 'true' - id: request - uses: octokit/request-action@v2.1.9 - with: - route: ${{github.event.issue.pull_request.url}} - env: - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - - # Create a separate PR status pointing at GitHub Actions tab URL - # just like any other third-party service - - name: Create PR status - if: steps.check.outputs.triggered == 'true' - uses: guibranco/github-status-action-v2@v1.1.7 - with: - authToken: ${{secrets.GITHUB_TOKEN}} - context: "ci-gpu-nvidia-ornl ${{ matrix.jobname }}" - state: "pending" - sha: ${{fromJson(steps.request.outputs.data).head.sha}} - target_url: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}} - - - name: Get PR information - if: steps.check.outputs.triggered == 'true' - id: pr_data - run: | - echo "branch=${{ fromJson(steps.request.outputs.data).head.ref }}" >> $GITHUB_OUTPUT - echo "repo_name=${{ fromJson(steps.request.outputs.data).head.repo.full_name }}" >> $GITHUB_OUTPUT - echo "repo_clone_url=${{ fromJson(steps.request.outputs.data).head.repo.clone_url }}" >> $GITHUB_OUTPUT - echo "repo_ssh_url=${{ fromJson(steps.request.outputs.data).head.repo.ssh_url }}" >> $GITHUB_OUTPUT - - - name: Checkout PR branch - if: steps.check.outputs.triggered == 'true' - uses: actions/checkout@v4 - with: - token: ${{secrets.GITHUB_TOKEN}} - repository: ${{fromJson(steps.request.outputs.data).head.repo.full_name}} - ref: ${{steps.pr_data.outputs.branch}} - - - name: Instantiate - if: steps.check.outputs.triggered == 'true' - run: julia --project -e 'using Pkg; Pkg.instantiate()' | - julia --project -e 'using Pkg; Pkg.add(name="CUDA", version="v5.1.1")' | - julia --project -e 'using CUDA; CUDA.set_runtime_version!(local_toolkit=true)' | - julia --project -e 'using JACC.JACCPreferences; JACCPreferences.set_backend("CUDA")' - - - name: Test - if: steps.check.outputs.triggered == 'true' - run: julia --project -e 'using Pkg; Pkg.test()' - - - name: Report PR status - if: always() && steps.check.outputs.triggered == 'true' - uses: guibranco/github-status-action-v2@v1.1.7 - with: - authToken: ${{secrets.GITHUB_TOKEN}} - context: "ci-gpu-nvidia-ornl ${{matrix.jobname}}" - state: ${{job.status}} - sha: ${{fromJson(steps.request.outputs.data).head.sha}} - target_url: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}} diff --git a/.github/workflows/ci-gpu-amd-ornl.yaml b/.github/workflows/ci-gpu.yaml similarity index 50% rename from .github/workflows/ci-gpu-amd-ornl.yaml rename to .github/workflows/ci-gpu.yaml index 54411db..423120f 100644 --- a/.github/workflows/ci-gpu-amd-ornl.yaml +++ b/.github/workflows/ci-gpu.yaml @@ -1,11 +1,98 @@ -name: ci-gpu-amd-ornl +name: ci-gpu on: issue_comment: types: [created] jobs: - excl-cousteau-MI100: + wfg-NVIDIA-RTXA4000: + if: | + github.repository_owner == 'JuliaORNL' && + github.event.issue.pull_request && + startsWith(github.event.comment.body, 'Test this please') + + runs-on: [self-hosted, Linux, X64, ci-wfg-ornl-rtxA4000-1] + + env: + GH_JOBNAME: ${{matrix.jobname}} + GH_OS: Linux + strategy: + fail-fast: false + matrix: + jobname: [CUDA12_3-JULIA1_9_4-CUDAJL5_1_1] + + steps: + # Only trigger CI for certain "actors" (those commenting the PR, not the PR originator) + - name: Verify actor + env: + ACTOR_TOKEN: ${{secrets.TOKENIZER}}${{github.actor}}${{secrets.TOKENIZER}} + SECRET_ACTORS: ${{secrets.CI_GPU_ACTORS}} + if: contains(env.SECRET_ACTORS, env.ACTOR_TOKEN) + id: check + run: | + echo "triggered=true" >> $GITHUB_OUTPUT + + # Request repo info, required since issue_comment doesn't point at PR commit, but main + - name: GitHub API Request + if: steps.check.outputs.triggered == 'true' + id: request + uses: octokit/request-action@v2.1.9 + with: + route: ${{github.event.issue.pull_request.url}} + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + + # Create a separate PR status pointing at GitHub Actions tab URL + # just like any other third-party service + - name: Create PR status + if: steps.check.outputs.triggered == 'true' + uses: guibranco/github-status-action-v2@v1.1.7 + with: + authToken: ${{secrets.GITHUB_TOKEN}} + context: "ci-gpu-nvidia-ornl ${{ matrix.jobname }}" + state: "pending" + sha: ${{fromJson(steps.request.outputs.data).head.sha}} + target_url: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}} + + - name: Get PR information + if: steps.check.outputs.triggered == 'true' + id: pr_data + run: | + echo "branch=${{ fromJson(steps.request.outputs.data).head.ref }}" >> $GITHUB_OUTPUT + echo "repo_name=${{ fromJson(steps.request.outputs.data).head.repo.full_name }}" >> $GITHUB_OUTPUT + echo "repo_clone_url=${{ fromJson(steps.request.outputs.data).head.repo.clone_url }}" >> $GITHUB_OUTPUT + echo "repo_ssh_url=${{ fromJson(steps.request.outputs.data).head.repo.ssh_url }}" >> $GITHUB_OUTPUT + + - name: Checkout PR branch + if: steps.check.outputs.triggered == 'true' + uses: actions/checkout@v4 + with: + token: ${{secrets.GITHUB_TOKEN}} + repository: ${{fromJson(steps.request.outputs.data).head.repo.full_name}} + ref: ${{steps.pr_data.outputs.branch}} + + - name: Instantiate + if: steps.check.outputs.triggered == 'true' + run: julia --project -e 'using Pkg; Pkg.instantiate()' | + julia --project -e 'using Pkg; Pkg.add(name="CUDA", version="v5.1.1")' | + julia --project -e 'using CUDA; CUDA.set_runtime_version!(local_toolkit=true)' | + julia --project -e 'using JACC.JACCPreferences; JACCPreferences.set_backend("CUDA")' + + - name: Test + if: steps.check.outputs.triggered == 'true' + run: julia --project -e 'using Pkg; Pkg.test()' + + - name: Report PR status + if: always() && steps.check.outputs.triggered == 'true' + uses: guibranco/github-status-action-v2@v1.1.7 + with: + authToken: ${{secrets.GITHUB_TOKEN}} + context: "ci-gpu-nvidia-ornl ${{matrix.jobname}}" + state: ${{job.status}} + sha: ${{fromJson(steps.request.outputs.data).head.sha}} + target_url: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}} + + excl-cousteau-AMD-MI100: if: | github.repository_owner == 'JuliaORNL' && github.event.issue.pull_request &&