Anyone ever see the following warning from CI? ``...
# pipeline-maintainers
j
Anyone ever see the following warning from CI?
Copy code
> WARN: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    >     There is a problem with your Conda configuration!
    >     You will need to set-up the conda-forge and bioconda channels correctly.
    >     Please refer to <https://bioconda.github.io/>
    >     The observed channel order is
    >     [defaults]
    >     but the following channel order is required:
    >     [conda-forge, bioconda]
    > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
j
But I would expect (unmodified) CI runners to configure conda correctly - so not sure why I get this in CI?
m
Given it's finding
defaults
, I presume this is not present in a yaml for a module, but it could be that Conda setup is still setting defaults as the main channel. As far as I can see it's using
miniconda
which I think still has
defaults
in the default channel.
Ah, wait. There's a remove defaults option
So it shouldn't be that
Are you sure there's no module with
defaults
in the yaml?
j
None
@Damon-Lee Pointon is also finding this error on a different pipeline now. Could be a problem with the GitHub action?
m
That was my initial thought, but I'm not sure how to debug that further
j
Apparently there's an option to explicitly configure channels:
Copy code
channels: conda-forge,spyder-ide
https://github.com/conda-incubator/setup-miniconda?tab=readme-ov-file#example-4-conda-options
m
Is it definitely though that the action has
defaults
as the only channel even though it's been excluded? (i.e. excluding defaults is only valid if there are other channels to set as default)
j
This is the relevant part of the CI runner output: https://pastebin.com/Y2iQACQk It looks like defaults is being set even though it's actively been excluded
Copy code
==> /usr/share/miniconda/.condarc <==
  channels:
    - defaults
 
  ==> /home/runner/.condarc <==
  auto_update_conda: True
  auto_activate: True
  notify_outdated_conda: False
  changeps1: False
  pkgs_dirs:
    - /home/runner/conda_pkgs_dir
  channels: []
  always_yes: True
  solver: libmamba
So there are no channels defined in the runners .condarc, so it falls back to the system condarc?
m
Yes, that makes sense
j
So AIUI the github runner uses a fixed version of the conda installation action, so that's unlikely to be the source of the error itself - maybe something has changed about the behaviour/configuation of the latest conda installer?
m
I think conda and miniconda have always returned
defaults
if no channels were set in the
.condarc
, so perhaps just adding
channels: conda-forge
to the action is enough
j
I will give it a go!
OK, this fixes the problem with the conda setup not working correctly in CI:
Copy code
- name: Conda setup
      if: contains(inputs.profile, 'conda')
      uses: conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3
      with:
        auto-update-conda: true
        conda-solver: libmamba
        channels: conda-forge,bioconda
        channel-priority: strict
        conda-remove-defaults: true
I changed it to explicitly set up the channels we want and set the channel priority. There's also an option to use
miniforge
instead of
miniconda
that might be worth considering for lack of defaults-ness. Would this be something worthwhile putting into the template?
m
I think it would be useful, although leaving
bioconda
out since the template should be more general as we have other fields contributing to nf-core now too
πŸ‘ 3
πŸ‘πŸ» 2
p
Yup, agreed πŸ‘πŸ»
j
m
You might want to add
nodefaults
to channels to be explicit.
πŸ‘ 1
j
Looks like
nodefaults
is going to be deprecated - conda-incubator has a warning if you include it. So better to stick with
conda-remove-defaults
, I think
πŸ‘ 1
πŸ‘πŸ» 1
p
I've not heard of
conda-remove-defaults
- does it work the same way, a channel name?
j
It’s a configuration option for the GH action, not a Conda thing itself
I think it would be useful, although leaving
bioconda
out since the template should be more general as we have other fields contributing to nf-core now too
Just had a thought, the template currently enforces bioconda presence in the
checkCondaChannels()
function - so leaving bioconda off the list will still produce the warning?
p
it does? I thought we took that out a while ago
p
Right, you beat me to it
I guess this is local configuration, not conda environment specification, so it doesn't actually matter much if bioconda is there or not πŸ€”
I could go either way on removing it or not
<!subteam^S044DU0NG68> should we be enforcing the
bioconda
channel in a user's local conda config?
m
Agreeing with @Jim Downie. bioconda should not be enforced. How about having
checkCondaChannels
fonction with parameters, that way we can adapt it if needed
m
Isn’t this a solved issue for the actual modules if the
environment.yml
file is configured correctly?
m
Right
So this should only be checked with tools then via linting?
m
Possibly. Are there any tools that don’t define the channel for their dependencies?
m
I'm guessing tools that don't have conda recipes
m
I tend to always prefix the tool with
bioconda::whatever
or
conda-forge::dependency
> I’m guessing tools that don’t have conda recipes No conda recipe == no conda test, so also non issue I guess?
j
Agree should not be enforced
m
Same. Don't enforce bioconda
πŸ’― 5
e
Shouldn't matter because
conda.channels
should be the nextflow source of truth right? https://github.com/nf-core/nf-core-utils/issues/2
How about having
checkCondaChannels
fonction with parameters, that way we can adapt it if needed
We've had that for ages, and it's already in the plugin πŸ˜†