I could use some help from the config magicians fo...
# configs
m
I could use some help from the config magicians for our institutional pipelines šŸ§™šŸ» We’ve got a series of workflows over at nf/cmgg, with our own version of #CGRTMASKY. Common plugins for our infra are defined in the configs repo. Whenever we activate the
nomad
profile, all other plugin imports for the configs repo are overwritten. We’d like the have them all. Please send help, you’re my only hope
šŸ‘€ 1
according to @Ben Sherman, stacking
plugin
blocks should be possible when using
NXF_PARSER=v2
, but as far as I can tell, that only goes 2 layers deep at the moment.
We import a
plugin
block from here, when them imports another block from here, followed by the final block in the pipeline config
for reference, this only happens when we import the
nomad
config profile (second one), when we use other profiles (which don’t have an extra plugin block), it works perfectly
cc @Nicolas Vannieuwkerke
j
I don't know if it helps, but I seem to remember that sub
profiles
can have a different behaviour than straight
-c
configs...
And maybe it did something like completely overwriting whole scopes rather than specific entries... but I think this was a VERY long time ago...
Does the same thing happen with other plugs, or specific nomad?
m
only the nomad plugin, since it’s the only one that has an extra
plugin
block
for example, when we’re running on GCP, all the import work like they should, because there’s only 2 layers of
plugin
blocks I suppose
j
I think you might be stuck between a rock and a hard place... to me it sounds like a problem with
nomad
or
nextflow
...
I'm not sure we would be able to fix tha
(from my knowledge ocf configs)
m
I know we used to be unable to ā€œmergeā€ plugin blocks, but that should’ve been fixed in NXF_VER>26 according to Ben
šŸ¤” 1
p
I don't follow, where's the second layer when not running nomad?
When I do some quick tests, it mostly looks like any
plugins
block will replace anything previous.
b
@Matthias De Smet I think I was mistaken when I originally told you about this. It turns out that the v1 config parser never supported merging plugin blocks. the v2 parser accidentally supported it in some cases but not others: https://github.com/nextflow-io/nextflow/issues/6754 so it is actually a grey area at the moment. I need to review the implications of explicitly supporting it and (hopefully) resolve the grey area by 26.10 e.g. merging is convenient in this case with nomad, but overwriting gives the user full control over which plugins are loaded. on the other hand, removing a plugin declared by the pipeline (like
nf-schema
) would just break the pipeline
p
šŸ™€ Just to check my understanding, the v2 parser don't have any hijinks like where a
{..}
block could redefine things whereas the same would work if written
a.b = c
?
b
no, that was a quirk of the v1 parser
I think the v2 parser currently either merges or overwrites plugin blocks depending on whether the second block is coming from a profile / include /
-c
option
m
šŸ¤” would you be able to document the exact behaviour somewhere?
I think stacking the blocks is a nice feature
for example, our case: • we have plugins in the pipeline
nextflow.config
which are needed to make the pipeline run • then we have plugin in our configs which are common across all our pipelines, but only of interest to us, not the broader public • lastly, we have a executor specific plugin which only needs to be loaded conditionally (e.g in a profile)
b
that's the thing, there is nothing to document because currently the behavior is undefined šŸ˜… that is, any behavior is accidental
m
Yeah, I mean, can we document the ā€œaccidentsā€ somewhere and make it a formal spec/requirement for the robot overlords/dev minions to take into account?
Currently I’m noticing that
include
== stack and
profile
== overwrite
Although the
profile
in our case also has an
include
so there’s that šŸ¤·šŸ»
p
I don't know how others see it, but generally documenting accidents like this make it much harder to fix them to behave sanely. For now I'd recommend making sure assuming the worst of the world. I haven't tried now but have the feeling you should be able to build up a representation of your needed plugins in
params
and deduce a filename to include that gives a suitable
plugins
clause at the end.
j
Could document here in the meantime: https://midnighter.github.io/nextflow-gotchas/
šŸ‘ 1
m
@Ben Sherman (or anyone else) is there any version of the code below that could work?
Copy code
plugins workflow.profile.contains('nomad') ? {
    id 'nf-cgroup-metrics@1.0.1'
    id 'nf-cmgg@0.2.5'
    id 'nf-teams@0.1.1'
    id 'nf-nomad@0.4.0'
} : {
    id 'nf-cgroup-metrics@1.0.1'
    id 'nf-cmgg@0.2.5'
    id 'nf-teams@0.1.1'
}
shake no 1