Skip to content

Shared cluster nextflow config - #102

Open
rdemko2332 wants to merge 2 commits into
masterfrom
shared-cluster-nextflow-config
Open

Shared cluster nextflow config#102
rdemko2332 wants to merge 2 commits into
masterfrom
shared-cluster-nextflow-config

Conversation

@rdemko2332

Copy link
Copy Markdown
Contributor

No description provided.

New WorkflowStep.pm helper getSharedClusterNextflowConfigIncludeBlock(): reads
$clusterServer.sharedNextflowConfig from stepsShared.prop (via getSharedConfigRelaxed,
so an unset value is a silent no-op) and, if set, returns an includeConfig line pulling
in that cluster-provided config file. Lets a cluster-wide nextflow process{} setting
(e.g. beforeScript = 'module load apptainer/1.4.1 && unset LD_LIBRARY_PATH') be rolled
out via a one-line stepsShared.prop change instead of hand-editing every
Make*NextflowConfig.pm generator -- 37 of them exist, and this session's ortho work
already needed the same beforeScript line added to 7 by hand.

Mirrors the existing getNextflowLsfScratchEnvBlock() pattern in the same file (same
shared-helper shape, already called identically from 28 of the 37 generators).

Also fixed getNextflowLsfScratchEnvBlock() while here: NXF_SCRATCH = '$LSF_TMPDIR' had
no default, crashing under nextflow's own set -u if LSF doesn't export LSF_TMPDIR --
the same bug independently found and hand-fixed in 7 ortho-specific generators on
another branch this session. Centralizing the fix here covers all 28 current callers.
…erator

Every Make*NextflowConfig.pm step class (38 total) now computes
$sharedClusterConfig = $self->getSharedClusterNextflowConfigIncludeBlock() and
interpolates it at the very top of its generated nextflow config, before params {}.
When $clusterServer.sharedNextflowConfig isn't set in stepsShared.prop this renders as
an empty string -- verified byte-identical output to before this change for that
(default, current) case. When it is set, an includeConfig '<path>' line appears at the
top, pulling in whatever cluster-wide process{} settings that shared file declares.

Mechanical, per-file changes only: add the one declaration line (anchored next to each
file's existing $lsfEnv/$lsfScratch computation, or near the top of run() for the 5
files with neither), and prepend $sharedClusterConfig to whatever the file already
prints (either interpolated into a heredoc string, or concatenated onto a $configString
variable) -- every file's own existing style preserved as-is, nothing else changed.

The 5 ortho-specific generators here still hand-roll their own $lsfScratch (predates the
shared getNextflowLsfScratchEnvBlock() helper 28 of the others already use) -- left
untouched, out of scope for this change.
@rdemko2332
rdemko2332 requested a review from jbrestel September 9, 2026 19:44
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.

1 participant