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

[DO NOT MERGE] Test gpu runners #7521

Draft
wants to merge 63 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
943affa
add cram support to fq2bam
famosab Feb 19, 2025
488d592
gpu
famosab Feb 19, 2025
5913394
correct module args
famosab Feb 19, 2025
ee7a5cb
update config
famosab Feb 19, 2025
a825dd7
update config
famosab Feb 19, 2025
6468d50
update config
famosab Feb 19, 2025
b5f7b77
update conf
famosab Feb 19, 2025
fdd5277
update snap
famosab Feb 19, 2025
e8dc35c
change stub
famosab Feb 19, 2025
95a28e5
update meta
famosab Feb 19, 2025
c3c6be5
Merge branch 'master' into pb-cram
famosab Feb 19, 2025
2fa57bf
update snap
famosab Feb 20, 2025
f9a968f
Merge branch 'master' into pb-cram
famosab Feb 20, 2025
961396d
swap cram test to se
famosab Feb 20, 2025
2f8a296
expand stub
famosab Feb 20, 2025
16abf35
fix linting
famosab Feb 20, 2025
94a878e
correct flag
famosab Feb 20, 2025
2ec044e
remove args
famosab Feb 20, 2025
744f66b
update snapshoz
famosab Feb 20, 2025
3a5c9b2
swap cram to PE data
famosab Feb 20, 2025
35ed688
swap cram to PE data
famosab Feb 20, 2025
1c4e08b
new setup for cram test
famosab Feb 20, 2025
7f07482
swap sbwf to cram
famosab Feb 20, 2025
f04bdd6
update snap
famosab Feb 20, 2025
83ccfce
temp remove tag
famosab Feb 20, 2025
4bf4b8d
update snap
famosab Feb 20, 2025
9a0081e
add back cram access
famosab Feb 20, 2025
9f98ad5
try different assertion
famosab Feb 20, 2025
017bcc5
add fasta to cram eval
famosab Feb 20, 2025
bbeab30
add fasta to cram eval
famosab Feb 20, 2025
af28757
add fasta to cram eval
famosab Feb 20, 2025
7dcdee2
update snaps
famosab Feb 20, 2025
9438577
modify nf-test
famosab Feb 20, 2025
97e3ab6
modify nf-test
famosab Feb 20, 2025
aa464c5
update snaps
famosab Feb 20, 2025
d75da76
add bam output to sbwf
famosab Feb 24, 2025
b4b4675
correct bam assertion
famosab Feb 24, 2025
1ad6d9f
add bam test
famosab Feb 24, 2025
b35dc0c
revert changes to nf-test config
famosab Feb 24, 2025
3623384
Merge branch 'master' into pb-cram
famosab Feb 24, 2025
ad7838c
revert changes to nf-test config
famosab Feb 24, 2025
1ee823a
address review comments
famosab Feb 25, 2025
de43ff6
Merge branch 'master' into pb-cram
famosab Feb 25, 2025
ca96a18
swap bam-cram to val input
famosab Feb 26, 2025
9537583
swap bam-cram to val input
famosab Feb 26, 2025
7ce2d05
Merge branch 'master' into pb-cram
famosab Feb 26, 2025
4492f6a
fix meta for lint
famosab Feb 26, 2025
53c4e27
Merge branch 'master' into pb-cram
famosab Feb 26, 2025
67f2c34
add meta maps
famosab Feb 26, 2025
f26fef6
align
famosab Feb 26, 2025
65ae227
fix meta
famosab Feb 26, 2025
2639ff8
fix meta
famosab Feb 26, 2025
b94abc1
remove single module sbwf
famosab Feb 26, 2025
008a9c0
swap back to def
famosab Feb 26, 2025
d0d9117
swap back to def
famosab Feb 26, 2025
5f20a00
Merge branch 'master' into pb-cram
famosab Feb 26, 2025
08d39cc
edit nf-test config
famosab Feb 27, 2025
c5efc91
edit nf-test config
famosab Feb 27, 2025
c6e1af7
update snaps
famosab Feb 27, 2025
5565eb0
back
famosab Feb 27, 2025
8614e56
Merge branch 'master' into pb-cram
famosab Feb 27, 2025
83a85f8
add debug step
mashehu Feb 27, 2025
9cd3dcc
more debugging
mashehu Feb 27, 2025
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
40 changes: 40 additions & 0 deletions .github/workflows/nf-test-gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,46 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0

- name: Basic GPU Check
run: |
whoami
groups
nvidia-smi
docker info | grep -i runtime
# This should succeed based on your output

- name: Run Application (Will Fail)
run: |
# Run your actual application command here
# For example: python my_gpu_script.py
# Or: docker run your_image your_command
# ADD "set -x" TO SEE EXACTLY WHAT'S HAPPENING
set -x
your_actual_command_that_fails
continue-on-error: true # This allows the workflow to continue even if this step fails

- name: Debug Environment
run: |
echo "=== Debug After Failure ==="
env | grep -i cuda
env | grep -i nvidia
ls -la /dev/nvidia*
ldconfig -p | grep cuda
continue-on-error: true # This allows the workflow to continue even if this step fails

- name: Test Different CUDA Versions
run: |
# Test with CUDA 12.0
docker run --rm --gpus all nvidia/cuda:12.0.1-base-ubuntu22.04 nvidia-smi

# Test with CUDA 11.8
docker run --rm --gpus all nvidia/cuda:11.8.0-base-ubuntu22.04 nvidia-smi

# Try running your application inside a CUDA container
docker run --rm --gpus all -v $(pwd):/app -w /app nvidia/cuda:11.8.0-runtime-ubuntu22.04 your_application_command
continue-on-error: true # This allows the workflow to continue even if this step fails

- name: Run nf-test Action
uses: ./.github/actions/nf-test-action
env:
Expand Down
46 changes: 31 additions & 15 deletions modules/nf-core/parabricks/fq2bam/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,22 @@ process PARABRICKS_FQ2BAM {
container "nvcr.io/nvidia/clara/clara-parabricks:4.4.0-1"

input:
tuple val(meta), path(reads)
tuple val(meta) , path(reads)
tuple val(meta2), path(fasta)
tuple val(meta3), path(index)
tuple val(meta4), path(interval_file)
path(known_sites)
tuple val(meta5), path(known_sites)
val(output_fmt) // either bam or cram

output:
tuple val(meta), path("*.bam") , emit: bam
tuple val(meta), path("*.bai") , emit: bai
tuple val(meta), path("*.table"), emit: bqsr_table , optional:true
path("versions.yml") , emit: versions
path("qc_metrics") , emit: qc_metrics , optional:true
path("duplicate-metrics.txt") , emit: duplicate_metrics , optional:true
tuple val(meta), path("*.bam") , emit: bam , optional:true
tuple val(meta), path("*.bai") , emit: bai , optional:true
tuple val(meta), path("*.cram") , emit: cram , optional:true
tuple val(meta), path("*.crai") , emit: crai , optional:true
tuple val(meta), path("*.table") , emit: bqsr_table , optional:true
tuple val(meta), path("*_qc_metrics") , emit: qc_metrics , optional:true
tuple val(meta), path("*.duplicate-metrics.txt"), emit: duplicate_metrics, optional:true
path("versions.yml") , emit: versions

when:
task.ext.when == null || task.ext.when
Expand All @@ -31,10 +34,14 @@ process PARABRICKS_FQ2BAM {
}
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"

def in_fq_command = meta.single_end ? "--in-se-fq $reads" : "--in-fq $reads"
def known_sites_command = known_sites ? known_sites.collect{"--knownSites $it"}.join(' ') : ""
def known_sites_output = known_sites ? "--out-recal-file ${prefix}.table" : ""
def interval_file_command = interval_file ? interval_file.collect{"--interval-file $it"}.join(' ') : ""
def extension = "$output_fmt"

def known_sites_command = known_sites ? (known_sites instanceof List ? known_sites.collect { "--knownSites $it" }.join(' ') : "--knownSites ${known_sites}") : ""
def known_sites_output_cmd = known_sites ? "--out-recal-file ${prefix}.table" : ""
def interval_file_command = interval_file ? (interval_file instanceof List ? interval_file.collect { "--interval-file $it" }.join(' ') : "--interval-file ${interval_file}") : ""

def num_gpus = task.accelerator ? "--num-gpus $task.accelerator.request" : ''
"""
INDEX=`find -L ./ -name "*.amb" | sed 's/\\.amb\$//'`
Expand All @@ -44,9 +51,9 @@ process PARABRICKS_FQ2BAM {
fq2bam \\
--ref \$INDEX \\
$in_fq_command \\
--out-bam ${prefix}.bam \\
--out-bam ${prefix}.${extension} \\
$known_sites_command \\
$known_sites_output \\
$known_sites_output_cmd \\
$interval_file_command \\
$num_gpus \\
$args
Expand All @@ -62,10 +69,19 @@ process PARABRICKS_FQ2BAM {
if (workflow.profile.tokenize(',').intersect(['conda', 'mamba']).size() >= 1) {
error "Parabricks module does not support Conda. Please use Docker / Singularity / Podman instead."
}
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def extension = "$output_fmt"
def extension_index = "$output_fmt" == "cram" ? "crai" : "bai"
def known_sites_output = known_sites ? "touch ${prefix}.table" : ""
def qc_metrics_output = args.contains("--out-qc-metrics-dir") ? "mkdir ${prefix}_qc_metrics" : ""
def duplicate_metrics_output = args.contains("--out-duplicate-metrics") ? "touch ${prefix}.duplicate-metrics.txt" : ""
"""
touch ${prefix}.bam
touch ${prefix}.bam.bai
touch ${prefix}.${extension}
touch ${prefix}.${extension}.${extension_index}
$known_sites_output
$qc_metrics_output
$duplicate_metrics_output

cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand Down
56 changes: 46 additions & 10 deletions modules/nf-core/parabricks/fq2bam/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,19 @@ input:
description: (optional) file(s) containing genomic intervals for use in base
quality score recalibration (BQSR)
pattern: "*.{bed,interval_list,picard,list,intervals}"
- - known_sites:
- - meta5:
type: map
description: |
Groovy Map containing known sites information
- known_sites:
type: file
description: (optional) known sites file(s) for calculating BQSR. markdups must
be true to perform BQSR.
pattern: "*.vcf.gz"
- - output_fmt:
type: string
description: Output format for the alignment. Options are 'bam' or 'cram'
pattern: "{bam,cram}"
output:
- bam:
- meta:
Expand All @@ -75,6 +83,26 @@ output:
type: file
description: index corresponding to sorted BAM file
pattern: "*.bai"
- cram:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- "*.cram":
type: file
description: Sorted CRAM file
pattern: "*.cram"
- crai:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- "*.crai":
type: file
description: index corresponding to sorted CRAM file
pattern: "*.crai"
- bqsr_table:
- meta:
type: map
Expand All @@ -86,22 +114,30 @@ output:
description: (optional) table from base quality score recalibration calculation,
to be used with parabricks/applybqsr
pattern: "*.table"
- versions:
- versions.yml:
type: file
description: File containing software versions
pattern: "versions.yml"
- qc_metrics:
- qc_metrics:
- meta:
type: map
description: |
Groovy Map containing sample information
- "*_qc_metrics":
type: directory
description: (optional) optional directory of qc metrics
pattern: "qc_metrics"
pattern: "*_qc_metrics"
- duplicate_metrics:
- duplicate-metrics.txt:
- meta:
type: map
description: |
Groovy Map containing sample information
- "*.duplicate-metrics.txt":
type: file
description: (optional) metrics calculated from marking duplicates in the bam
file
pattern: "*-duplicate-metrics.txt"
pattern: "*.duplicate-metrics.txt"
- versions:
- versions.yml:
type: file
description: File containing software versions
pattern: "versions.yml"
authors:
- "@bsiranosian"
- "@adamrtalbot"
Expand Down
Loading
Loading