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

Sfitz add resource handler #326

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

Conversation

sorelfitzgibbon
Copy link
Contributor

@sorelfitzgibbon sorelfitzgibbon commented Dec 14, 2024

Add new resource handler.

  • Values for the default configuration were set to work well with our typical range of input BAM sizes. Setting it to work with very large BAMs would have compromised efficiency. To run very large BAMs the user should use the m64 config or create their own config.

  • I think I should test this on one or more full size BAMs.

  • python scripts for converting json to and from tsv are in a temporary PR at pipeline-nextflow-config

  • A figure showing the configuration TSV with conditional formatting is pasted in this Discussion.

  • The original spreadsheet, which includes additional tables for assessing the settings is on Box

Closes #305, #288

Testing Results

I'm not sure what's going on with the two config tests that currently exist. It looks like the format has entirely changed?

  • NFTest sbatch --partition F72 --cpus-per-task 16 --mem 27G test/runNFtest.sh
    • output: /hot/software/pipeline/pipeline-call-sSNV/Nextflow/development/8.1.0/sfitz-add-resource-handler
    • sbatch --partition F72 --cpus-per-task 16 --mem 28G test/runNFtest.sh (using f16)
      • log: /hot/software/pipeline/pipeline-call-sSNV/Nextflow/development/8.1.0/sfitz-add-resource-handler/log-nftest-20241217T222804Z.log
    • sbatch --partition F72 --cpus-per-task 16 --mem 27G test/runNFtest.sh (using default)
      • log: /hot/software/pipeline/pipeline-call-sSNV/Nextflow/development/8.1.0/sfitz-add-resource-handler/log-nftest-20241217T230418Z.log
    • cases: a_mini-all-tools-std-input

Checklist

  • I have read the code review guidelines and the code review best practice on GitHub check-list.

  • I have reviewed the Nextflow pipeline standards.

  • The name of the branch is meaningful and well formatted following the standards, using [AD_username (or 5 letters of AD if AD is too long)]-[brief_description_of_branch].

  • I have set up or verified the branch protection rule following the github standards before opening this pull request.

  • I have added my name to the contributors listings in the manifest block in the nextflow.config as part of this pull request, am listed already, or do not wish to be listed. (This acknowledgement is optional.)

  • I have added the changes included in this pull request to the CHANGELOG.md under the next release version or unreleased, and updated the date.

  • I have updated the version number in the metadata.yaml and manifest block of the nextflow.config file following semver, or the version number has already been updated. (Leave it unchecked if you are unsure about new version number and discuss it with the infrastructure team in this PR.)

  • I have tested the pipeline on at least one A-mini sample.

@sorelfitzgibbon sorelfitzgibbon marked this pull request as draft December 14, 2024 01:31
Copy link

Bleep bloop, I am a robot.

Alas, some of the Nextflow configuration tests failed!

test/configtest-F16.json

@ ["params","proc_resource_params"]
- {"call_sIndel_Manta":{"cpus":"6","memory":"6 GB","retry_strategy":{"memory":{"operand":"12 GB","strategy":"add"}},"withName:call_sSNV_Strelka2":{"cpus":"6","memory":"2 GB","retry_strategy":{"memory":{"operand":"12 GB","strategy":"add"}}}},"call_sSNV_Mutect2":{"cpus":"1","memory":"2 GB","retry_strategy":{"memory":{"operand":"2 GB","strategy":"add"}}},"call_sSNV_SomaticSniper":{"cpus":"1","memory":"1 GB","retry_strategy":{"memory":{"operand":"3 GB","strategy":"add"}}},"call_sSNV_Strelka2":{"ext":{"retry_codes":[]}},"concat_VCFs_BCFtools":{"cpus":"1","memory":"1 GB","retry_strategy":{"memory":{"operand":"10 GB","strategy":"add"}}},"convert_BAM2Pileup_SAMtools":{"cpus":"1","memory":"1 GB","retry_strategy":{"memory":{"operand":"5 GB","strategy":"add"}}},"create_IndelCandidate_SAMtools":{"cpus":"1","memory":"1 GB","retry_strategy":{"memory":{"operand":"5 GB","strategy":"add"}}},"plot_VennDiagram_R":{"cpus":"1","memory":"1 GB","retry_strategy":{"memory":{"operand":"10 GB","strategy":"add"}}},"run_LearnReadOrientationModel_GATK":{"cpus":"1","memory":"8 GB","retry_strategy":{"memory":{"operand":"8 GB","strategy":"add"}},"withName:call_sSNV_MuSE":{"cpus":"6","memory":"24 GB","retry_strategy":{"memory":{"operand":"8 GB","strategy":"add"}}}},"run_sump_MuSE":{"cpus":"8","memory":"16 GB","retry_strategy":{"memory":{"operand":"16 GB","strategy":"add"}}},"run_validate_PipeVal":{"cpus":"1","memory":"1 GB"}}
@ ["params","base_allocations"]
+ {"call_sIndel_Manta":{"cpus":"6","memory":"6 GB"},"call_sSNV_MuSE":{"cpus":"6","memory":"24 GB"},"call_sSNV_Mutect2":{"cpus":"1","memory":"2 GB"},"call_sSNV_SomaticSniper":{"cpus":"1","memory":"1 GB"},"concat_VCFs_BCFtools":{"cpus":"1","memory":"1 GB"},"convert_BAM2Pileup_SAMtools":{"cpus":"1","memory":"1 GB"},"create_IndelCandidate_SAMtools":{"cpus":"1","memory":"1 GB"},"plot_VennDiagram_R":{"cpus":"1","memory":"1 GB"},"run_LearnReadOrientationModel_GATK":{"cpus":"1","memory":"8 GB"},"run_sump_MuSE":{"cpus":"8","memory":"16 GB"},"run_validate_PipeVal":{"cpus":"1","memory":"1 GB"}}
@ ["params","max_time"]
+ "24d 20h 31m 24s"
@ ["params","min_time"]
+ "1s"
@ ["params","retry_information"]
+ {"call_sIndel_Manta":{"memory":{"operand":"12 GB","strategy":"add"}},"call_sSNV_MuSE":{"memory":{"operand":"8 GB","strategy":"add"}},"call_sSNV_Mutect2":{"memory":{"operand":"2 GB","strategy":"add"}},"call_sSNV_SomaticSniper":{"memory":{"operand":"3 GB","strategy":"add"}},"concat_VCFs_BCFtools":{"memory":{"operand":"10 GB","strategy":"add"}},"convert_BAM2Pileup_SAMtools":{"memory":{"operand":"5 GB","strategy":"add"}},"create_IndelCandidate_SAMtools":{"memory":{"operand":"5 GB","strategy":"add"}},"plot_VennDiagram_R":{"memory":{"operand":"10 GB","strategy":"add"}},"run_LearnReadOrientationModel_GATK":{"memory":{"operand":"8 GB","strategy":"add"}},"run_sump_MuSE":{"memory":{"operand":"16 GB","strategy":"add"}}}
@ ["process","withName:call_sIndel_Manta","withName:call_sSNV_Strelka2"]
- {"cpus":"6","memory":"2 GB","retry_strategy":{"memory":{"operand":"12 GB","strategy":"add"}}}
@ ["process","withName:run_LearnReadOrientationModel_GATK","withName:call_sSNV_MuSE"]
- {"cpus":"6","memory":"24 GB","retry_strategy":{"memory":{"operand":"8 GB","strategy":"add"}}}
@ ["process","withName:call_sSNV_MuSE"]
+ {"cpus":"6","memory":{"1":"24 GB","2":"31 GB","3":"31 GB","closure":"retry_updater(24 GB, add, 8 GB, $task.attempt, memory)"}}
@ ["resource_handler"]
+ {"handle_resources":"closure()","set_resource_limit_params":"closure()","set_retry":"closure()","setup_retry":"closure()"}

test/configtest-F32.json

@ ["params","proc_resource_params"]
- {"call_sIndel_Manta":{"cpus":"8","memory":"6 GB","retry_strategy":{"memory":{"operand":"5 GB","strategy":"add"}}},"call_sSNV_MuSE":{"cpus":"12","memory":"48 GB","retry_strategy":{"memory":{"operand":"16 GB","strategy":"add"}}},"call_sSNV_Mutect2":{"cpus":"1","memory":"2 GB","retry_strategy":{"memory":{"operand":"2 GB","strategy":"add"}}},"call_sSNV_SomaticSniper":{"cpus":"1","memory":"1 GB","retry_strategy":{"memory":{"operand":"5 GB","strategy":"add"}}},"call_sSNV_Strelka2":{"cpus":"8","ext":{"retry_codes":[]},"memory":"2 GB","retry_strategy":{"memory":{"operand":"12 GB","strategy":"add"}}},"concat_VCFs_BCFtools":{"cpus":"1","memory":"1 GB","retry_strategy":{"memory":{"operand":"10 GB","strategy":"add"}}},"convert_BAM2Pileup_SAMtools":{"cpus":"1","memory":"1 GB","retry_strategy":{"memory":{"operand":"5 GB","strategy":"add"}}},"create_IndelCandidate_SAMtools":{"cpus":"1","memory":"1 GB","retry_strategy":{"memory":{"operand":"5 GB","strategy":"add"}}},"plot_VennDiagram_R":{"cpus":"1","memory":"1 GB","retry_strategy":{"memory":{"operand":"10 GB","strategy":"add"}}},"run_LearnReadOrientationModel_GATK":{"cpus":"1","memory":"12 GB","retry_strategy":{"memory":{"operand":"20 GB","strategy":"add"}}},"run_sump_MuSE":{"cpus":"12","memory":"18 GB","retry_strategy":{"memory":{"operand":"16 GB","strategy":"add"}}},"run_validate_PipeVal":{"cpus":"1","memory":"1 GB"}}
@ ["params","base_allocations"]
+ {"call_sIndel_Manta":{"cpus":"8","memory":"6 GB"},"call_sSNV_MuSE":{"cpus":"12","memory":"48 GB"},"call_sSNV_Mutect2":{"cpus":"1","memory":"2 GB"},"call_sSNV_SomaticSniper":{"cpus":"1","memory":"1 GB"},"call_sSNV_Strelka2":{"cpus":"8","memory":"2 GB"},"concat_VCFs_BCFtools":{"cpus":"1","memory":"1 GB"},"convert_BAM2Pileup_SAMtools":{"cpus":"1","memory":"1 GB"},"create_IndelCandidate_SAMtools":{"cpus":"1","memory":"1 GB"},"plot_VennDiagram_R":{"cpus":"1","memory":"1 GB"},"run_LearnReadOrientationModel_GATK":{"cpus":"1","memory":"12 GB"},"run_sump_MuSE":{"cpus":"12","memory":"18 GB"},"run_validate_PipeVal":{"cpus":"1","memory":"1 GB"}}
@ ["params","max_time"]
+ "24d 20h 31m 24s"
@ ["params","min_time"]
+ "1s"
@ ["params","retry_information"]
+ {"call_sIndel_Manta":{"memory":{"operand":"5 GB","strategy":"add"}},"call_sSNV_MuSE":{"memory":{"operand":"16 GB","strategy":"add"}},"call_sSNV_Mutect2":{"memory":{"operand":"2 GB","strategy":"add"}},"call_sSNV_SomaticSniper":{"memory":{"operand":"5 GB","strategy":"add"}},"call_sSNV_Strelka2":{"memory":{"operand":"12 GB","strategy":"add"}},"concat_VCFs_BCFtools":{"memory":{"operand":"10 GB","strategy":"add"}},"convert_BAM2Pileup_SAMtools":{"memory":{"operand":"5 GB","strategy":"add"}},"create_IndelCandidate_SAMtools":{"memory":{"operand":"5 GB","strategy":"add"}},"plot_VennDiagram_R":{"memory":{"operand":"10 GB","strategy":"add"}},"run_LearnReadOrientationModel_GATK":{"memory":{"operand":"20 GB","strategy":"add"}},"run_sump_MuSE":{"memory":{"operand":"16 GB","strategy":"add"}}}
@ ["resource_handler"]
+ {"handle_resources":"closure()","set_resource_limit_params":"closure()","set_retry":"closure()","setup_retry":"closure()"}

If the above changes are surprising, stop and determine what happened.

If the above changes are expected, there are two ways to fix this:

  1. Automatically: Post a comment starting with "/fix-tests" (without the quotes) and I will update the tests for you (you must review my work afterwards).
  2. Manually: Follow these steps on Confluence.

@yashpatel6 yashpatel6 self-assigned this Dec 16, 2024
@sorelfitzgibbon
Copy link
Contributor Author

/fix-tests

Copy link

Bleep bloop, I am a robot.

I have updated all of the failing tests for you with a7afc9b. You must review my work before merging this pull request!

@wiz-inc-8da00b022c
Copy link

wiz-inc-8da00b022c bot commented Dec 17, 2024

Wiz Scan Summary

Scanner Findings
Vulnerability Finding Vulnerabilities
Data Finding Sensitive Data 1 Info
Secret Finding Secrets
IaC Misconfiguration IaC Misconfigurations
Total 1 Info

View scan details in Wiz

To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension.

@sorelfitzgibbon sorelfitzgibbon marked this pull request as ready for review December 18, 2024 00:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add missing processes in SomaticSniper to resource configs
2 participants