Open tvanbaak opened 4 months ago
My guess is that resourceLabels
needs to be added to the list of repeatable directives: https://github.com/nextflow-io/nextflow/blob/12b027ee7e70d65bdee912856478894af4602170/modules/nextflow/src/main/groovy/nextflow/script/ProcessConfig.groovy#L119
Also, even if this issue is fixed, you can't repeat settings in the config. The second one will overwrite the first.
It's not repeatable on purpose. The docs should how to provide multiple labels in the same directive
process my_task {
resourceLabels region: 'some-region', user: 'some-username'
'''
<task script>
'''
}
It's not repeatable on purpose.
I repeated it in hello.nf
above and it worked. That's what made me think it should work to set it in both config and pipeline. Is that behavior a bug, then?
I think it worked in the process definition because of how the directive is defined: https://github.com/nextflow-io/nextflow/blob/12b027ee7e70d65bdee912856478894af4602170/modules/nextflow/src/main/groovy/nextflow/script/ProcessConfig.groovy#L755-L768
But I wonder if it was written this way only to support merging of process definition and process config
With the use of withName
, it is possible to share resource labels across modules. Example:
process {
resourceLabels = [
'Project': 'pipeline'
]
withName: debug {
resourceLabels += ['pipeline:module': 'debug']
cpus = 2
}
}
However this doesn't seem to be possible from within a process.
Also, the +=
for modifying config options is not supported by the strict config syntax in the language server (and eventually Nextflow itself)
Bug report
Expected behavior and actual behavior
resourceLabels
can be specified in a pipeline process multiple times and the results are all merged together into the final set of name-value pairs.resourceLabels
can also be specified in the config. There are some unintuitive behaviors related to this:resourceLabels
can't be specified multiple times in a config. The later config value replaces the earlier one rather than merging the values together the way it works in aprocess
block in the pipeline.resourceLabels
in the pipeline replaces, rather than merges with, the value ofresourceLabels
in the config.If this is as intended, the documentation of
resourceLabels
should mention this.It might be desirable to change the behavior to be consistent, but it would probably result in a backwards-incompatible change no matter how you do it.
Steps to reproduce the problem
hello.nf
:nextflow.config
Program output
Running with the above:
Note the absence of
two
andthree
.If you remove the
four
andfive
fromhello.nf
, you get the following instead:Note the absence of
two
.Environment
Additional context
(Add any other context about the problem here)