-
Notifications
You must be signed in to change notification settings - Fork 526
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fix string resource definition in CLI and profile (#2627)
### Description The PR is related to the[ issue described for the slurm submit executor](snakemake/snakemake-executor-plugin-slurm#18) plugin to not correctly hand over arguments. The test folder is named `test_slurm_resource_propagation meesters` and may not be complete, as it covers multiple related scenarios to provoke the error. Note, that the tests were carried out when using a cluster: - `$ snakemake --executor slurm -j2 --workflow-profile ./profiles/ --default-resources slurm_account=<account>` yields ``Error: WorkflowError: Failed to evaluate default resources value '<function eval_resource_expression.<locals>.callable at 0x7f5c19ed0e00>'.``` when the patition is defined at the rule level in a profile. (see the directory of the test case) - likewise `$ snakemake --executor slurm -j2 --workflow-profile ./profiles/ --default-resources slurm_account=<account> --set-resources slurm_extra="--nice=150"` yields ```ValueError: Invalid resource definition: entries have to be defined as RULE:RESOURCE=VALUE, with VALUE being a positive integer a quoted string, or a Python expression (e.g. min(max(2*input.size_mb, 1000), 8000)).``` These errors can both be triggered on the command line and in the config file, of course. ### QC * [x] The PR contains a test case for the changes or the changes are already covered by an existing test case. * [ ] The documentation (`docs/`) is updated to reflect the changes or this is not necessary (e.g. if the change does neither modify the language nor the behavior or functionalities of Snakemake). --------- Co-authored-by: Johannes Koester <johannes.koester@uni-due.de> Co-authored-by: Johannes Köster <johannes.koester@tu-dortmund.de>
- Loading branch information
1 parent
6252404
commit bbd76ae
Showing
8 changed files
with
30 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# fails when submitted as | ||
# $ snakemake --executor slurm -j2 --workflow-profile ./profiles/ --default-resources slurm_account=m2_zdvhpc | ||
|
||
rule all: | ||
input: "a.out" | ||
|
||
rule test1: | ||
output: "a.out" | ||
shell: "touch {output}" |
Empty file.
4 changes: 4 additions & 0 deletions
4
tests/test_resource_string_in_cli_or_profile/profiles/config.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
set-resources: | ||
test1: | ||
slurm_partition: "smp" | ||
slurm_extra: "'--nice=150'" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters