Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: add gpu tag test job #478

Open
wants to merge 78 commits into
base: fasta-align-dedup-bwameth
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 68 commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
596a697
CI: add gpu tag test job
sateeshperi Dec 2, 2024
e03286f
CI: add gpu tag test job
sateeshperi Dec 2, 2024
31af189
CI: add gpu tag test job
sateeshperi Dec 2, 2024
af77e4a
CI: add gpu tag test job
sateeshperi Dec 2, 2024
0712cf0
CI: add gpu tag test job
sateeshperi Dec 2, 2024
4990bf4
CI: add gpu tag test job
sateeshperi Dec 2, 2024
9e6b1a9
CI: add gpu tag test job
sateeshperi Dec 2, 2024
63c856f
CI: add gpu tag test job
sateeshperi Dec 2, 2024
10521aa
CI: add gpu tag test job
sateeshperi Dec 2, 2024
4c00080
CI: add gpu tag test job
sateeshperi Dec 2, 2024
2d482c7
CI: add gpu tag test job
sateeshperi Dec 2, 2024
d571e3c
CI: add gpu tag test job
sateeshperi Dec 2, 2024
231cbc3
add bwameth_gpu test
sateeshperi Dec 2, 2024
0b2f069
add gpu profile to config
sateeshperi Dec 2, 2024
b26a4aa
add bwameth gpu test + snap
sateeshperi Dec 2, 2024
24e35a6
update bwameth default test formatting
sateeshperi Dec 2, 2024
9b43b3e
update bwameth use_gpu test with index name
sateeshperi Dec 2, 2024
5ebc7e2
minor formatting fix
sateeshperi Dec 2, 2024
210199e
add fq2bammeth config + test + snap, ci: nf-test job filter by tag cpu
sateeshperi Dec 2, 2024
c4d81d4
ci: nf-test job filter by tag cpu
sateeshperi Dec 2, 2024
67c8708
add cpu/gpu tags to tests
sateeshperi Dec 2, 2024
d6917c3
touch cpu and gpu test for debug
sateeshperi Dec 2, 2024
754065d
add bwameth run_qualimap test
sateeshperi Dec 2, 2024
4ff6c9e
add setup python step
sateeshperi Dec 2, 2024
4162387
restrict num shards for cpu/gpu to 2
sateeshperi Dec 3, 2024
b2fd76f
add nf-test-shard and nf-test actions
sateeshperi Dec 3, 2024
89cfb48
add ci triggers
sateeshperi Dec 3, 2024
36deedc
lint: ignore ci.yml
sateeshperi Dec 3, 2024
c7a32b4
update nf-test-shard action
sateeshperi Dec 3, 2024
a9f4ee0
update nf-test-shard action
sateeshperi Dec 3, 2024
3c81b89
add tags input for nf-test action
sateeshperi Dec 3, 2024
b278548
Update .github/actions/nf-test-shard/action.yml
sateeshperi Dec 3, 2024
be8dbdd
install pdiff
sateeshperi Dec 3, 2024
d004b5b
nf-test-shard output checkout
sateeshperi Dec 3, 2024
7233ca2
nf-test-shard output checkout
sateeshperi Dec 3, 2024
4febb47
fix job outputs
sateeshperi Dec 3, 2024
7009314
fix job outputs
sateeshperi Dec 3, 2024
804e70e
fix nf-test-shard action
sateeshperi Dec 3, 2024
6a58c88
fix nf-test-shard action
sateeshperi Dec 3, 2024
258449b
fix nf-test-shard action
sateeshperi Dec 3, 2024
f6454d1
fix nf-test-shard action
sateeshperi Dec 3, 2024
001b63f
get-shards matrix json parse
sateeshperi Dec 3, 2024
118b817
get-shards matrix json parse
sateeshperi Dec 3, 2024
e2f7679
get-shards matrix json parse
sateeshperi Dec 3, 2024
d6a1aab
fix sharding
sateeshperi Dec 3, 2024
46637d4
Now filtering nf-test dry-run by --tag, picking up Executed instead o…
GallVp Dec 3, 2024
c3c1592
Fixed gpu typo, removed docker_self_hosted and bumped default resources
GallVp Dec 3, 2024
60947ab
Reduced resources
GallVp Dec 3, 2024
7edb069
add back docker_self_hosted profile + remove disk cleanup step
sateeshperi Dec 4, 2024
c381d9c
test latest-everything also for cpu tests
sateeshperi Dec 4, 2024
4f78c3f
update bwameth cpu tests snaps
sateeshperi Dec 4, 2024
0066282
update bwameth gpu test snap
sateeshperi Dec 5, 2024
07ae4e2
setup-nextflow use v2.0.0
sateeshperi Dec 5, 2024
c1b68ab
Update .github/workflows/linting.yml
sateeshperi Dec 5, 2024
50f0f35
Update .github/workflows/linting.yml
mashehu Dec 5, 2024
67024a7
going back to uriginal setup-nextflow version
mashehu Dec 5, 2024
4f5132a
try v2.1.1
mashehu Dec 5, 2024
c4caa1e
try 2.1.2
mashehu Dec 5, 2024
b883c89
try 2.1.3
mashehu Dec 5, 2024
91e04d6
reset to broader v2 now that it is working again
mashehu Dec 5, 2024
1134404
try again 2.1.3 explicitly
mashehu Dec 5, 2024
0f58839
try 2.1.4
mashehu Dec 5, 2024
aaa58d1
and now reset back to v2
mashehu Dec 5, 2024
ddb99ae
increase max_shards to 15
sateeshperi Dec 5, 2024
ef2cdcb
Corrected test labels, GPU tests with latest-everything, corrected en…
GallVp Dec 9, 2024
05cb5c9
Disabled latest-everything for now
GallVp Dec 9, 2024
5d8cc4b
Bumped nxf min version to 24.10.2
GallVp Dec 9, 2024
1e77463
update qualimap paths in nftignore
sateeshperi Dec 9, 2024
336d466
remove test folder contents only
sateeshperi Dec 10, 2024
18b389c
use ubuntu-latest as default runner
sateeshperi Dec 10, 2024
e98c5de
use ubuntu-latest as default runner
sateeshperi Dec 10, 2024
231d9d1
use ubuntu-latest as default runner
sateeshperi Dec 10, 2024
f8787df
use ubuntu-latest as default runner
sateeshperi Dec 10, 2024
57f5756
add latest-everything to matrix
sateeshperi Dec 10, 2024
c23d1cc
correct NXF VER for nf-test
sateeshperi Dec 10, 2024
18119ab
rm latest-everything from matrix
sateeshperi Dec 10, 2024
099fd57
use gpu profile in tests config
sateeshperi Dec 11, 2024
e6cd57b
update test gpu configs
sateeshperi Dec 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/actions/nf-test-shard/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: "Get number of shards"
description: "Get the number of nf-test shards for the current CI job"
inputs:
tags:
description: "Tags to pass as argument for nf-test --tag parameter"
required: true
max_shards:
description: "Maximum number of shards allowed"
required: true
outputs:
shard:
description: "Array of shard numbers"
value: ${{ steps.shards.outputs.shard }}
total_shards:
description: "Total number of shards"
value: ${{ steps.shards.outputs.total_shards }}

runs:
using: "composite"
steps:
- name: Install nf-test
uses: nf-core/setup-nf-test@v1
with:
version: ${{ env.NFT_VER }}
install-pdiff: true

- name: Get number of shards
id: shards
shell: bash
run: |
# Run nf-test to get the number of related tests
nftest_output=$(nf-test test --dry-run --changed-since HEAD^ --filter pipeline --tag ${{ inputs.tags }})
echo "nf-test dry-run output: $nftest_output"

# Default values for shard and total_shards
shard="[]"
total_shards=0

# Check if there are related tests
if echo "$nftest_output" | grep -q 'Nothing to do'; then
echo "No related tests found."
else
# Extract the number of related tests
number_of_shards=$(echo "$nftest_output" | sed -n 's|.*Executed \([0-9]*\) tests.*|\1|p')
sateeshperi marked this conversation as resolved.
Show resolved Hide resolved
if [[ -n "$number_of_shards" && "$number_of_shards" -gt 0 ]]; then
shards_to_run=$(( $number_of_shards < ${{ inputs.max_shards }} ? $number_of_shards : ${{ inputs.max_shards }} ))
shard=$(seq 1 "$shards_to_run" | jq -R . | jq -c -s .)
total_shards="$shards_to_run"
else
echo "Unexpected output format. Falling back to default values."
fi
fi

# Write to GitHub Actions outputs
echo "shard=$shard" >> $GITHUB_OUTPUT
echo "total_shards=$total_shards" >> $GITHUB_OUTPUT

# Debugging output
echo "Final shard array: $shard"
echo "Total number of shards: $total_shards"
88 changes: 88 additions & 0 deletions .github/actions/nf-test/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: "nf-test Action"
description: "Runs nf-test with common setup steps"
inputs:
profile:
description: "Profile to use"
required: true
shard:
description: "Shard number for this CI job"
required: true
total_shards:
description: "Total number of test shards(NOT the total number of matrix jobs)"
required: true
filters:
description: "Filter test cases by specified types (e.g., module, pipeline, workflow or function)"
required: true
tags:
description: "Tags to pass as argument for nf-test --tag parameter"
required: true

runs:
using: "composite"
steps:
- uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4
with:
distribution: "temurin"
java-version: "17"

- name: Setup Nextflow
uses: nf-core/setup-nextflow@v2
sateeshperi marked this conversation as resolved.
Show resolved Hide resolved
with:
version: "${{ env.NXF_VER }}"

- name: Set up Python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5
with:
python-version: "3.11"

- name: Install nf-test
uses: nf-core/setup-nf-test@v1
with:
version: "${{ env.NFT_VER }}"
install-pdiff: true

- name: Setup apptainer
if: contains(inputs.profile, 'singularity')
uses: eWaterCycle/setup-apptainer@main

- name: Set up Singularity
if: contains(inputs.profile, 'singularity')
shell: bash
run: |
mkdir -p $NXF_SINGULARITY_CACHEDIR
mkdir -p $NXF_SINGULARITY_LIBRARYDIR

- name: Conda setup
if: ${{inputs.profile == 'conda'}}
uses: conda-incubator/setup-miniconda@d2e6a045a86077fb6cad6f5adf368e9076ddaa8d # v3
with:
auto-update-conda: true
conda-solver: libmamba
conda-remove-defaults: true

- name: Run nf-test
shell: bash
run: |
NFT_WORKDIR=~ \
nf-test test \
--ci \
--shard ${{ inputs.shard }}/${{ inputs.total_shards }} \
--changed-since HEAD^ \
mashehu marked this conversation as resolved.
Show resolved Hide resolved
--profile=${{ inputs.profile }} \
--filter ${{ inputs.filters }} \
--tap=test.tap \
--verbose \
--tag ${{ inputs.tags }}

# TODO If no test.tap, then make one to spoof?
- uses: pcolby/tap-summary@0959cbe1d4422e62afc65778cdaea6716c41d936 # v1
if: ${{ inputs.path != '' }}
with:
path: >-
test.tap

- name: Clean up
if: always()
shell: bash
run: |
sudo rm -rf /home/ubuntu/tests/
sateeshperi marked this conversation as resolved.
Show resolved Hide resolved
119 changes: 0 additions & 119 deletions .github/workflows/ci.yml

This file was deleted.

111 changes: 111 additions & 0 deletions .github/workflows/nf-test-gpu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: Run GPU nf-tests
on:
push:
branches:
- dev
pull_request:
release:
types: [published]
workflow_dispatch:
inputs:
runners:
description: "Runners to test on"
type: string
default: "gpu"

# Cancel if a newer run is started
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# renovate: datasource=github-releases depName=askimed/nf-test versioning=semver
NFT_VER: "0.9.2"
NXF_ANSI_LOG: false
NXF_SINGULARITY_CACHEDIR: ${{ github.workspace }}/.singularity
NXF_SINGULARITY_LIBRARYDIR: ${{ github.workspace }}/.singularity

jobs:
get-shards:
runs-on: ubuntu-latest
name: "Get Shards"
outputs:
shard: ${{ steps.set-shards.outputs.shard }}
total_shards: ${{ steps.set-shards.outputs.total_shards }}
steps:
- name: Check out pipeline code
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
with:
fetch-depth: 0

- name: run nf-test-shard action
id: set-shards
uses: ./.github/actions/nf-test-shard
env:
NFT_VER: ${{ env.NFT_VER }}
with:
tags: "gpu"
max_shards: 2

- name: Set outputs
id: set-outputs
run: |
echo "shard=${{ steps.set-shards.outputs.shard }}" >> $GITHUB_ENV
echo "total_shards=${{ steps.set-shards.outputs.total_shards }}" >> $GITHUB_ENV

nf-test-gpu:
needs: [get-shards]
runs-on: "gpu"
name: "GPU Test | ${{ matrix.profile }} | ${{ matrix.shard }} | ${{ matrix.NXF_VER }} | ${{ matrix.filters }}"
env:
NXF_VER: ${{ matrix.NXF_VER }}

# Only run on push if this is the nf-core dev branch (merged PRs)
if: "${{ github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'nf-core/methylseq') }}"
strategy:
fail-fast: false
matrix:
profile: [docker_self_hosted, singularity]
shard: ${{ fromJson(needs.get-shards.outputs.shard) }}
NXF_VER:
- "24.10.2"
filters: [pipeline]

steps:
- name: Check out pipeline code
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
with:
fetch-depth: 0

- name: Run nf-test Action
uses: ./.github/actions/nf-test
with:
profile: ${{ matrix.profile }},gpu
shard: ${{ matrix.shard }}
total_shards: ${{ needs.get-shards.outputs.total_shards }}
filters: ${{ matrix.filters }}
tags: "gpu"

confirm-pass:
runs-on: ubuntu-latest
needs: [nf-test-gpu]
if: always()
steps:
- name: One or more tests failed
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1

- name: One or more tests cancelled
if: ${{ contains(needs.*.result, 'cancelled') }}
run: exit 1

- name: All tests ok
if: ${{ contains(needs.*.result, 'success') }}
run: exit 0

- name: debug-print
if: always()
run: |
echo "toJSON(needs) = ${{ toJSON(needs) }}"
echo "toJSON(needs.*.result) = ${{ toJSON(needs.*.result) }}"
Loading
Loading