From b1a339044e471d8f76d084addbf3af808c584050 Mon Sep 17 00:00:00 2001 From: Intron7 Date: Thu, 21 Aug 2025 17:17:19 +0200 Subject: [PATCH 1/7] add rsc --- .cirun.yml | 11 ++ .github/workflows/rsc_integration-test.yml | 131 +++++++++++++++++++++ README.md | 1 + 3 files changed, 143 insertions(+) create mode 100644 .cirun.yml create mode 100644 .github/workflows/rsc_integration-test.yml diff --git a/.cirun.yml b/.cirun.yml new file mode 100644 index 0000000..a73db06 --- /dev/null +++ b/.cirun.yml @@ -0,0 +1,11 @@ +runners: + - name: aws-gpu-runner + cloud: aws + instance_type: g4dn.xlarge + machine_image: ami-067a4ba2816407ee9 + region: eu-north-1 + preemptible: + - true + - false + labels: + - rsc-cron-job diff --git a/.github/workflows/rsc_integration-test.yml b/.github/workflows/rsc_integration-test.yml new file mode 100644 index 0000000..43a6256 --- /dev/null +++ b/.github/workflows/rsc_integration-test.yml @@ -0,0 +1,131 @@ +name: GPU-CI + +on: + schedule: + - cron: "0 0 * * *" # Run daily at midnight UTC + push: + branches: [main] + pull_request: + branches: [main] + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + test: + name: GPU Tests + runs-on: "cirun-aws-gpu--${{ github.run_id }}" + timeout-minutes: 30 + outputs: + failure_type: ${{ steps.export_failure.outputs.failure_type }} + + defaults: + run: + shell: bash -el {0} + working-directory: rapids-singlecell + + env: + GH_TOKEN: ${{ secrets.TOKEN_FOR_ISSUE_WRITE }} + + steps: + - name: Checkout this repository (integration-testing) + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Checkout rapids-singlecell + uses: actions/checkout@v4 + with: + repository: scverse/rapids-singlecell + fetch-depth: 0 + path: rapids-singlecell + + - name: Nvidia SMI sanity check + run: nvidia-smi + + - uses: mamba-org/setup-micromamba@v2 + with: + environment-file: rapids-singlecell/ci/environment.yml + init-shell: >- + bash + post-cleanup: 'all' + + - name: Install rapids-singlecell + id: install_pkg + run: >- + pip install -e .[test] + "scanpy @ git+https://github.com/scverse/scanpy.git" + "anndata @ git+https://github.com/scverse/anndata.git" + + - name: Pip list + run: pip list + + - name: Set failure type for install + if: failure() + run: | + echo "Installation failed for rapids-singlecell" + echo "failure_type=install" >> $GITHUB_ENV + + - name: Run test + id: run_tests + run: pytest + + - name: Set failure type for test + if: failure() && env.failure_type != 'install' + run: | + echo "Test failed for rapids-singlecell" + echo "failure_type=test" >> $GITHUB_ENV + + - name: Export failure_type output + if: always() + id: export_failure + run: | + echo "failure_type=${{ env.failure_type }}" >> $GITHUB_OUTPUT + + report-failure: + name: Report GPU CI Failure + needs: test + if: needs.test.result == 'failure' && github.event_name == 'schedule' + runs-on: ubuntu-latest + permissions: + issues: write + contents: read + env: + GH_TOKEN: ${{ secrets.TOKEN_FOR_ISSUE_WRITE }} + steps: + - name: Check for open failure issue + id: find_issue + run: | + FAILURE_TYPE="${{ needs.test.outputs.failure_type }}" + if [ -z "$FAILURE_TYPE" ]; then FAILURE_TYPE="test"; fi + echo "failure_type=$FAILURE_TYPE" >> $GITHUB_ENV + ISSUE_TITLE="GPU CI ${FAILURE_TYPE^} Failure" + echo "Checking for existing issue: $ISSUE_TITLE" + ISSUE_COUNT=$(gh issue list --repo scverse/rapids-singlecell --state open --search "$ISSUE_TITLE" --json number --jq 'length') + if [[ "$ISSUE_COUNT" -gt 0 ]]; then + echo "issue_exists=true" >> $GITHUB_ENV + else + echo "issue_exists=false" >> $GITHUB_ENV + echo "issue_title=$ISSUE_TITLE" >> $GITHUB_ENV + fi + + - name: Report failure issue + if: env.issue_exists == 'false' + run: | + RUN_URL="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + ISSUE_BODY="The GPU CI failed on ${failure_type} for scverse/rapids-singlecell. Please review logs in [integration-testing run](${RUN_URL})." + gh issue create --repo scverse/rapids-singlecell --title "${{ env.issue_title }}" --body "$ISSUE_BODY" + + keepalive-job: + name: Keepalive Workflow + runs-on: ubuntu-latest + permissions: + actions: write + steps: + - name: Re-enable workflow + env: + GITHUB_TOKEN: ${{ github.token }} + shell: sh + run: | + gh api --verbose -X PUT "repos/${GITHUB_REPOSITORY}/actions/workflows/rsc_integration-test.yml/enable" \ No newline at end of file diff --git a/README.md b/README.md index e30ae62..2da886d 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ The following packages are tested: - scvi-tools - pertpy - decoupler +- rapids-singlecell ## How it Works From 08b5d4bf5ff5bd55d3ee2b8ea44e5f0bb2b7a3bc Mon Sep 17 00:00:00 2001 From: Intron7 Date: Thu, 21 Aug 2025 17:20:25 +0200 Subject: [PATCH 2/7] change label --- .cirun.yml | 2 +- .github/workflows/rsc_integration-test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.cirun.yml b/.cirun.yml index a73db06..c5a1f74 100644 --- a/.cirun.yml +++ b/.cirun.yml @@ -8,4 +8,4 @@ runners: - true - false labels: - - rsc-cron-job + - rsc-integration-test diff --git a/.github/workflows/rsc_integration-test.yml b/.github/workflows/rsc_integration-test.yml index 43a6256..da95775 100644 --- a/.github/workflows/rsc_integration-test.yml +++ b/.github/workflows/rsc_integration-test.yml @@ -1,4 +1,4 @@ -name: GPU-CI +name: rsc-integration-test on: schedule: From a7209bafc33eedd87555e1e1dcf96ae6068c2d52 Mon Sep 17 00:00:00 2001 From: Intron7 Date: Thu, 21 Aug 2025 17:23:05 +0200 Subject: [PATCH 3/7] update name --- .github/workflows/rsc_integration-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rsc_integration-test.yml b/.github/workflows/rsc_integration-test.yml index da95775..b22452e 100644 --- a/.github/workflows/rsc_integration-test.yml +++ b/.github/workflows/rsc_integration-test.yml @@ -14,7 +14,7 @@ concurrency: jobs: test: - name: GPU Tests + name: Integration test/ test (3.x rapids-singlecell) runs-on: "cirun-aws-gpu--${{ github.run_id }}" timeout-minutes: 30 outputs: From a82f30a9c22b3ba4e5ffdf7e35e91d2ab8a99d8a Mon Sep 17 00:00:00 2001 From: Intron7 Date: Thu, 21 Aug 2025 17:30:42 +0200 Subject: [PATCH 4/7] update --- .cirun.yml | 2 +- .github/workflows/rsc_integration-test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.cirun.yml b/.cirun.yml index c5a1f74..263d0fa 100644 --- a/.cirun.yml +++ b/.cirun.yml @@ -8,4 +8,4 @@ runners: - true - false labels: - - rsc-integration-test + - cirun-aws-gpu diff --git a/.github/workflows/rsc_integration-test.yml b/.github/workflows/rsc_integration-test.yml index b22452e..ac1d0de 100644 --- a/.github/workflows/rsc_integration-test.yml +++ b/.github/workflows/rsc_integration-test.yml @@ -1,4 +1,4 @@ -name: rsc-integration-test +name: Integration test RSC on: schedule: From 96eb2d023534dee1c6c473989c7a8209b05058c7 Mon Sep 17 00:00:00 2001 From: Intron7 Date: Thu, 21 Aug 2025 17:34:05 +0200 Subject: [PATCH 5/7] fix _ --- .github/workflows/rsc_integration-test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rsc_integration-test.yml b/.github/workflows/rsc_integration-test.yml index ac1d0de..3f61a66 100644 --- a/.github/workflows/rsc_integration-test.yml +++ b/.github/workflows/rsc_integration-test.yml @@ -23,7 +23,7 @@ jobs: defaults: run: shell: bash -el {0} - working-directory: rapids-singlecell + working-directory: rapids_singlecell env: GH_TOKEN: ${{ secrets.TOKEN_FOR_ISSUE_WRITE }} @@ -37,9 +37,9 @@ jobs: - name: Checkout rapids-singlecell uses: actions/checkout@v4 with: - repository: scverse/rapids-singlecell + repository: scverse/rapids_singlecell fetch-depth: 0 - path: rapids-singlecell + path: rapids_singlecell - name: Nvidia SMI sanity check run: nvidia-smi From c4cd8b491f9e3eb763aeaef3c7a2f778861715a8 Mon Sep 17 00:00:00 2001 From: Intron7 Date: Thu, 21 Aug 2025 17:37:13 +0200 Subject: [PATCH 6/7] fix path --- .github/workflows/rsc_integration-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rsc_integration-test.yml b/.github/workflows/rsc_integration-test.yml index 3f61a66..ba7c5b1 100644 --- a/.github/workflows/rsc_integration-test.yml +++ b/.github/workflows/rsc_integration-test.yml @@ -46,7 +46,7 @@ jobs: - uses: mamba-org/setup-micromamba@v2 with: - environment-file: rapids-singlecell/ci/environment.yml + environment-file: rapids_singlecell/ci/environment.yml init-shell: >- bash post-cleanup: 'all' From d97a7583e200306321093351e7725c1bf99b876b Mon Sep 17 00:00:00 2001 From: Intron7 Date: Thu, 21 Aug 2025 18:16:46 +0200 Subject: [PATCH 7/7] fix error --- .github/workflows/rsc_integration-test.yml | 36 ++++++---------------- 1 file changed, 10 insertions(+), 26 deletions(-) diff --git a/.github/workflows/rsc_integration-test.yml b/.github/workflows/rsc_integration-test.yml index ba7c5b1..2740b5c 100644 --- a/.github/workflows/rsc_integration-test.yml +++ b/.github/workflows/rsc_integration-test.yml @@ -76,34 +76,16 @@ jobs: run: | echo "Test failed for rapids-singlecell" echo "failure_type=test" >> $GITHUB_ENV - - - name: Export failure_type output - if: always() - id: export_failure - run: | - echo "failure_type=${{ env.failure_type }}" >> $GITHUB_OUTPUT - - report-failure: - name: Report GPU CI Failure - needs: test - if: needs.test.result == 'failure' && github.event_name == 'schedule' - runs-on: ubuntu-latest - permissions: - issues: write - contents: read - env: - GH_TOKEN: ${{ secrets.TOKEN_FOR_ISSUE_WRITE }} - steps: + - name: Check for open failure issue + if: failure() && github.event_name == 'schedule' id: find_issue run: | - FAILURE_TYPE="${{ needs.test.outputs.failure_type }}" - if [ -z "$FAILURE_TYPE" ]; then FAILURE_TYPE="test"; fi - echo "failure_type=$FAILURE_TYPE" >> $GITHUB_ENV - ISSUE_TITLE="GPU CI ${FAILURE_TYPE^} Failure" + ISSUE_TITLE="Integration Testing CI ${failure_type^} Failure on python rapids_singlecell" echo "Checking for existing issue: $ISSUE_TITLE" - ISSUE_COUNT=$(gh issue list --repo scverse/rapids-singlecell --state open --search "$ISSUE_TITLE" --json number --jq 'length') + ISSUE_COUNT=$(gh issue list --repo scverse/rapids_singlecell --state open --search "${ISSUE_TITLE}" --json number --jq 'length') if [[ "$ISSUE_COUNT" -gt 0 ]]; then + echo "${failure_type^} failure issue already exists for today." echo "issue_exists=true" >> $GITHUB_ENV else echo "issue_exists=false" >> $GITHUB_ENV @@ -111,11 +93,13 @@ jobs: fi - name: Report failure issue - if: env.issue_exists == 'false' + if: failure() && env.issue_exists == 'false' && github.event_name == 'schedule' run: | RUN_URL="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" - ISSUE_BODY="The GPU CI failed on ${failure_type} for scverse/rapids-singlecell. Please review logs in [integration-testing run](${RUN_URL})." - gh issue create --repo scverse/rapids-singlecell --title "${{ env.issue_title }}" --body "$ISSUE_BODY" + ISSUE_BODY="The daily CI failed on ${failure_type} for rapids_singlecell failed. Please go to [the logs of the integration testing repo](${RUN_URL}) to review. @scverse/anndata" + gh issue create --repo scverse/rapids_singlecell --title "${{ env.issue_title }}" --body "${ISSUE_BODY}" + + keepalive-job: name: Keepalive Workflow