Respect conda channels in mulled docker container building #13755
Respect conda channels in mulled docker container building #13755mvdbeek merged 3 commits intogalaxyproject:devfrom
Conversation
74d1764 to
682b67e
Compare
| for channel in ensure_channels: | ||
| if channel.startswith("file://"): | ||
| bind_path = channel[7:] | ||
| binds.extend(["-v", f"/{bind_path}:/{bind_path}"]) |
There was a problem hiding this comment.
How come you're prefixing the bind paths with /, and wouldn't you want to to hardcode the bind destination to what the container expects ?
There was a problem hiding this comment.
How come you're prefixing the bind paths with /,
I took inspiration from here:
But you are right the / is redundant. I will remove it at both places.
and wouldn't you want to to hardcode the bind destination to what the container expects ?
This should be what the container expects, i.e. the same value is given to the -c / --channel argument of conda search.
| DEFAULT_CHANNELS = os.environ["DEFAULT_MULLED_CONDA_CHANNELS"].split(",") | ||
| else: | ||
| DEFAULT_CHANNELS = ["conda-forge", "bioconda"] | ||
| DEFAULT_CHANNELS = default_mulled_conda_channels_from_env() or ["conda-forge", "bioconda"] |
There was a problem hiding this comment.
Would it make sense to add this to the command line parser as well ?
There was a problem hiding this comment.
How do you mean this?
There was a problem hiding this comment.
There's an argparse section below, you'd want to be able to set the channels there
There was a problem hiding this comment.
This change should only alter the default of the --channels argument, users can still overwrite the value.
to the value given by `--conda_channels` xref galaxyproject/galaxy#13755
to the value given by `--conda_channels` xref galaxyproject/galaxy#13755
|
Maybe galaxyproject/planemo@a3cd29a (added here galaxyproject/planemo#1227) is even a better solution? Still, it might be good to respect the env variable and certainly it's necessary to set the binds correctly. |
ca69541 to
b6c75ee
Compare
mvdbeek
left a comment
There was a problem hiding this comment.
Looks good, you can fix the linting with make format (or by installing pre-commit and copying .pre-commit-config.yaml.sample to .pre-commit-config.yaml).
to the value given by `--conda_channels` xref galaxyproject/galaxy#13755
b6c75ee to
1794748
Compare
DEFAULT_MULLED_CONDA_CHANNELS is now respected when building mulled docker containers. In addition the change to CondaInDockerContext allows to use local packages. Ideally planemo users would be able to set the channels via a command line option, but I could not find a way.
respecting conda channels on disk: follow up on galaxyproject#13755 - CondaInDockerContext needs the list of channels and not the joined str - get_file_from_recipe should use local data
DEFAULT_MULLED_CONDA_CHANNELS is now respected when building mulled docker containers.
In addition the change to CondaInDockerContext allows to use local packages.
Ideally planemo users would be able to set the channels via a command line option, but I could not find a way. Also this should be done for singularity container building?
How to test the changes?
(Select all options that apply)
License