nextflow-io / nextflow

A DSL for data-driven computational pipelines
http://nextflow.io
Apache License 2.0
2.61k stars 605 forks source link

Institution/Cluster level config #4952

Open chris-cheshire opened 2 months ago

chris-cheshire commented 2 months ago

New feature

We would like to implement some required config for our whole cluster.

This would include required tracer plugins and default executors etc. nf-core provides this through the institution config files but this does not extend to non-nf-core pipelines. Nextflow only looks as high as the user's home directory for config. It would be very useful if we could configure Nextflow to search for config at the system level using an environment variable or something, like NXF_CONFIG. This way we could point to a cluster-level config whenever anyone loads Nextflow using module load by forcing the env variable.

Usage scenario

For system-level config of Nextflow to help enforce best practices within an institution.

Suggest implementation

It would be very useful if we could configure Nextflow to search for config at the system level using an environment variable or something, like NXF_CONFIG. This way we could point to a cluster-level config whenever anyone loads Nextflow using module load by forcing the env variable.

bentsherman commented 2 months ago

Do you set NXF_HOME to a system-level directory?

I see that the lowest priority config file is $HOME/.nextflow/config, but maybe we could add a priority below that -- $NXF_HOME/config. They are the same when Nextflow is installed in the home directory, but not if it's installed elsewhere.

chris-cheshire commented 2 months ago

Thanks for the quick reply. We use the LMod module loading system, where the executables for each nextflow version are stored in a system-level directory structure. At the moment we download the all self-packaged version, but I have just seen that you can't use non-core plugins in these releases. We could house the config file in this installation directory or at least a symlink.