Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Institutional configs are not included when NXF_OFFLINE is on #3430

Open
Aratz opened this issue Jan 27, 2025 · 3 comments
Open

Institutional configs are not included when NXF_OFFLINE is on #3430

Aratz opened this issue Jan 27, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@Aratz
Copy link
Contributor

Aratz commented Jan 27, 2025

Description of the bug

In the pipeline template, custom_config_base is set so that it will be downloaded from github automatically:

custom_config_base = "https://raw.githubusercontent.com/nf-core/configs/${params.custom_config_version}"

As far as I understand, this is the reason this config is excluded later when running in offline mode:

includeConfig !System.getenv('NXF_OFFLINE') && params.custom_config_base ? "${params.custom_config_base}/nfcore_custom.config" : "/dev/null"

When downloading institutional profiles, nf-core/tools will set custom_config_base to"${projectDir}/../configs/", but nextflow will still ignore it when NXF_OFFLINE is on.

Either nf-core/tools should remove the conditional on L208 when downloading the institutional profiles, or this conditional should be adapted to include this file as long as custom_config_base does not point to github.

This is a follow up to #3132

How to reproduce:

  • nf-core pipelines download demultiplex --download-configuration yes --compress none --revision 1.5.4 --container-system singularity
  • export NXF_OFFLINE='true'
  • nextflow run nf-core-demultiplex_1.5.4/1_5_4/main.nf -profile test,singularity,uppmax --outdir outdir

Command used and terminal output

N E X T F L O W   ~  version 24.10.3

Unknown configuration profile: 'uppmax'

System information

No response

@Aratz Aratz added the bug Something isn't working label Jan 27, 2025
@MatthiasZepper
Copy link
Member

I think, the problem is simply a wrong negation for !System.getenv('NXF_OFFLINE'), because the intention was to enable the local configs only when the system is offline.

As of now, the evaluation looks like this:

NXF_OFFLINE params.custom_config_base Result
Set (true) Set (true) "/dev/null"
Set (true) Not set (false/null) "/dev/null"
Not set (false/null) Set (true) "${params.custom_config_base}/nfcore_custom.config"
Not set (false/null) Not set (false/null) "/dev/null"

But even if I do not set NXF_OFFLINE (we anyway do not set it, because it causes other issues), it does not work in Seqera Platform.

@Aratz
Copy link
Contributor Author

Aratz commented Mar 13, 2025

I'm not sure I follow, wouldn't one want to be able to use the institutional configs regardless if one is online or not?

Essentially, the default behavior to download the institutional configs from https://github.com/nf-core/configs/. If users want to use them offline, they should set params.custom_config_base to the actual location where they downloaded the files, and if they don't want these file they should set params.custom_config_base to null.

Don't we want the truth table to look something like this instead?

NXF_OFFLINE params.custom_config_base Result
Set (true) Set (true) "${params.custom_config_base}/nfcore_custom.config" *
Set (true) Not set (false/null) "/dev/null"
Not set (false/null) Set (true) "${params.custom_config_base}/nfcore_custom.config"
Not set (false/null) Not set (false/null) "/dev/null"

* Assuming the users have set params.custom_config_base to a local path

Namely the conditional would be independent of NXF_OFFLINE as @bentsherman initially suggested and would look something like:

includeConfig params.custom_config_base ? "${params.custom_config_base}/nfcore_custom.config" : '/dev/null'

@bentsherman
Copy link

bentsherman commented Mar 13, 2025

Good point. The institutional configs should be included even in offline mode, if they are locally available. So something like:

includeConfig params.custom_config_base && (!System.getenv('NXF_OFFLINE') || !params.custom_config_base.startsWith('http')) ? "${params.custom_config_base}/nfcore_custom.config" : "/dev/null"

You could also just condition on params.custom_config_base != null but I think they didn't go for that because then offline users would have to remember to set the option to null

@MatthiasZepper we fixed that issue in platform but I don't know if it was backported, so depending on your version you might not have the fix yet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants