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

[24.1] remove mamba special handling #19293

Draft
wants to merge 2 commits into
base: release_24.1
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions lib/galaxy/tool_util/deps/container_resolvers/mulled.py
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,6 @@ def __init__(
"namespace": namespace,
"hash_func": self.hash_func,
"command": "build-and-test",
"use_mamba": True,
}
self._mulled_kwds["channels"] = default_mulled_conda_channels_from_env() or self._get_config_option(
"mulled_channels", DEFAULT_CHANNELS
Expand Down Expand Up @@ -789,7 +788,6 @@ def __init__(
"namespace": "local",
"singularity": True,
"singularity_image_dir": self.cache_directory.path,
"use_mamba": True,
}
self.involucro_context = InvolucroContext(**self._involucro_context_kwds)
auto_init = self._get_config_option("involucro_auto_init", True)
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/tool_util/deps/mulled/invfile.lua
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ end

local conda_image = VAR.CONDA_IMAGE
if conda_image == '' then
conda_image = 'quay.io/condaforge/mambaforge:latest'
conda_image = 'quay.io/condaforge/miniforge3:latest'
nsoranzo marked this conversation as resolved.
Show resolved Hide resolved
end

local conda_bin = VAR.CONDA_BIN
Expand Down
33 changes: 2 additions & 31 deletions lib/galaxy/tool_util/deps/mulled/mulled_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,6 @@ def mull_targets(
repository_template=DEFAULT_REPOSITORY_TEMPLATE,
dry_run=False,
conda_version=None,
mamba_version=None,
use_mamba=False,
verbose=False,
binds=DEFAULT_BINDS,
rebuild=True,
Expand Down Expand Up @@ -303,24 +301,13 @@ def mull_targets(

verbose = "--verbose" if verbose else "--quiet"
conda_bin = "conda"
if use_mamba:
conda_bin = "mamba"
if mamba_version is None:
mamba_version = ""
involucro_args.extend(["-set", f"CONDA_BIN={conda_bin}"])
if conda_version is not None or mamba_version is not None:
mamba_test = "true"
if conda_version is not None:
specs = []
if conda_version is not None:
specs.append(f"conda={conda_version}")
if mamba_version is not None:
specs.append(f"mamba={mamba_version}")
if mamba_version == "" and not specs:
# If nothing but mamba without a specific version is requested,
# then only run conda install if mamba is not already installed.
mamba_test = "[ '[]' = \"$( conda list --json --full-name mamba )\" ]"
conda_install = f"""conda install {verbose} --yes {" ".join(f"'{spec}'" for spec in specs)}"""
involucro_args.extend(["-set", f"PREINSTALL=if {mamba_test} ; then {conda_install} ; fi"])
involucro_args.extend(["-set", f"PREINSTALL={conda_install}"])

involucro_args.append(command)
if test_files:
Expand Down Expand Up @@ -493,18 +480,6 @@ def add_build_arguments(parser):
default=None,
help="Change to specified version of Conda before installing packages.",
)
parser.add_argument(
"--mamba-version",
dest="mamba_version",
default=None,
help="Change to specified version of Mamba before installing packages.",
)
parser.add_argument(
"--use-mamba",
dest="use_mamba",
action="store_true",
help="Use Mamba instead of Conda for package installation.",
)
parser.add_argument(
"--oauth-token",
dest="oauth_token",
Expand Down Expand Up @@ -570,10 +545,6 @@ def args_to_mull_targets_kwds(args):
kwds["repository_template"] = args.repository_template
if hasattr(args, "conda_version"):
kwds["conda_version"] = args.conda_version
if hasattr(args, "mamba_version"):
kwds["mamba_version"] = args.mamba_version
if hasattr(args, "use_mamba"):
kwds["use_mamba"] = args.use_mamba
if hasattr(args, "oauth_token"):
kwds["oauth_token"] = args.oauth_token
if hasattr(args, "rebuild"):
Expand Down
4 changes: 1 addition & 3 deletions test/unit/tool_util/mulled/test_mulled_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ def test_base_image_for_targets(target, version, base_image):
assert base_image_for_targets([target], conda_context) == base_image


@pytest.mark.parametrize("use_mamba", [False, True])
@external_dependency_management
def test_mulled_build_files_cli(use_mamba: bool, tmpdir) -> None:
def test_mulled_build_files_cli(tmpdir) -> None:
singularity_image_dir = tmpdir.mkdir("singularity image dir")
target = build_target("zlib", version="1.2.13", build="h166bdaf_4")
involucro_context = InvolucroContext(involucro_bin=os.path.join(tmpdir, "involucro"))
Expand All @@ -41,7 +40,6 @@ def test_mulled_build_files_cli(use_mamba: bool, tmpdir) -> None:
involucro_context=involucro_context,
command="build-and-test",
singularity=True,
use_mamba=use_mamba,
singularity_image_dir=singularity_image_dir,
)
assert exit_code == 0
Expand Down
Loading