From 8bf7c8b4ea8f78aebd5d101434f850634ef0cd2a Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Mon, 2 Sep 2024 10:16:50 +0200 Subject: [PATCH 1/6] remove defaults channel for conda https://www.theregister.com/2024/08/08/anaconda_puts_the_squeeze_on/ According to the FAQs on https://repo.anaconda.com/pkgs/ this includes `pkgs/main`, `pkgs/r`, and `pkgs/msys2`. Seems also to be a good idea because for `mulled_channels` we apparently never used it (consistency). --- lib/galaxy/config/sample/galaxy.yml.sample | 2 +- lib/galaxy/config/schemas/config_schema.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/galaxy/config/sample/galaxy.yml.sample b/lib/galaxy/config/sample/galaxy.yml.sample index a09b781abebe..2452f0211bcd 100644 --- a/lib/galaxy/config/sample/galaxy.yml.sample +++ b/lib/galaxy/config/sample/galaxy.yml.sample @@ -578,7 +578,7 @@ galaxy: # conda channels to enable by default # (https://conda.io/docs/user-guide/tasks/manage-channels.html) - #conda_ensure_channels: conda-forge,bioconda,defaults + #conda_ensure_channels: conda-forge,bioconda # Use locally-built conda packages. #conda_use_local: false diff --git a/lib/galaxy/config/schemas/config_schema.yml b/lib/galaxy/config/schemas/config_schema.yml index 0fba005c5e39..bf2b70de9a07 100644 --- a/lib/galaxy/config/schemas/config_schema.yml +++ b/lib/galaxy/config/schemas/config_schema.yml @@ -359,7 +359,7 @@ mapping: conda_ensure_channels: type: str - default: conda-forge,bioconda,defaults + default: conda-forge,bioconda required: false desc: | conda channels to enable by default From 9c9b52d5a626cae14e6ea38429ffefddddcbb0bc Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Mon, 2 Sep 2024 12:06:10 +0200 Subject: [PATCH 2/6] update osx startup workflow to use miniforge --- .github/workflows/osx_startup.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/osx_startup.yaml b/.github/workflows/osx_startup.yaml index 0a3050cbcb6b..981a44cf9a8d 100644 --- a/.github/workflows/osx_startup.yaml +++ b/.github/workflows/osx_startup.yaml @@ -49,9 +49,10 @@ jobs: with: path: .tox key: tox-cache-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('galaxy root/requirements.txt') }}-osx - - name: Install miniconda # use this job to test using Python from a conda environment + - name: Install miniforge # use this job to test using Python from a conda environment uses: conda-incubator/setup-miniconda@v3 with: + miniforge-version: latest activate-environment: '' - name: Restore client cache uses: actions/cache@v4 From c15417c2e50c6cf07b27dd9446b58094816360b4 Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Mon, 2 Sep 2024 12:39:43 +0200 Subject: [PATCH 3/6] deprecate 32bit conda installation option can be installed manually by affected users --- lib/galaxy/tool_util/deps/conda_util.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/galaxy/tool_util/deps/conda_util.py b/lib/galaxy/tool_util/deps/conda_util.py index 4905b6091e3e..19550602ed83 100644 --- a/lib/galaxy/tool_util/deps/conda_util.py +++ b/lib/galaxy/tool_util/deps/conda_util.py @@ -60,13 +60,10 @@ def conda_link() -> str: else: url = "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-x86_64.sh" else: - if sys.maxsize > 2**32: - if "arm64" in platform.platform(): - url = "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-aarch64.sh" - else: - url = "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh" + if "arm64" in platform.platform(): + url = "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-aarch64.sh" else: - url = "https://repo.anaconda.com/miniconda/Miniconda3-4.5.12-Linux-x86.sh" + url = "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh" return url From c778a2ae3f469ab33e387358de905bbf30d262e4 Mon Sep 17 00:00:00 2001 From: Nicola Soranzo Date: Mon, 2 Sep 2024 14:03:18 +0100 Subject: [PATCH 4/6] Remove conda defaults channel from more places --- doc/source/admin/dependency_resolvers.rst | 2 +- doc/source/admin/galaxy_options.rst | 2 +- lib/galaxy/tool_util/deps/resolvers/conda.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/source/admin/dependency_resolvers.rst b/doc/source/admin/dependency_resolvers.rst index 19862f4c7c23..88821e74fa5d 100644 --- a/doc/source/admin/dependency_resolvers.rst +++ b/doc/source/admin/dependency_resolvers.rst @@ -207,7 +207,7 @@ debug ensure_channels Conda channels to enable by default. See https://conda.io/docs/user-guide/tasks/manage-channels.html for more information about channels. This defaults to the value of the global ``conda_ensure_channels`` option or - ``iuc,conda-forge,bioconda,defaults`` otherwise. This order should be consistent with the `Bioconda prescribed + ``conda-forge,bioconda`` otherwise. This order should be consistent with the `Bioconda prescribed order `__ if it includes ``bioconda``. auto_install diff --git a/doc/source/admin/galaxy_options.rst b/doc/source/admin/galaxy_options.rst index 43469fd2c7fb..a5d872c754fb 100644 --- a/doc/source/admin/galaxy_options.rst +++ b/doc/source/admin/galaxy_options.rst @@ -477,7 +477,7 @@ :Description: conda channels to enable by default (https://conda.io/docs/user-guide/tasks/manage-channels.html) -:Default: ``conda-forge,bioconda,defaults`` +:Default: ``conda-forge,bioconda`` :Type: str diff --git a/lib/galaxy/tool_util/deps/resolvers/conda.py b/lib/galaxy/tool_util/deps/resolvers/conda.py index d28fca78b42c..450e0c1b6fdd 100644 --- a/lib/galaxy/tool_util/deps/resolvers/conda.py +++ b/lib/galaxy/tool_util/deps/resolvers/conda.py @@ -45,7 +45,7 @@ DEFAULT_CONDARC_OVERRIDE = "_condarc" # Conda channel order from highest to lowest, following the one used in # https://github.com/bioconda/bioconda-recipes/blob/master/config.yml -DEFAULT_ENSURE_CHANNELS = "conda-forge,bioconda,defaults" +DEFAULT_ENSURE_CHANNELS = "conda-forge,bioconda" CONDA_SOURCE_CMD = """[ "$(basename "$CONDA_DEFAULT_ENV")" = "$(basename '{environment_path}')" ] || {{ MAX_TRIES=3 COUNT=0 From a850008651faae119bbbda95b9f6dece31fc66ff Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Tue, 3 Sep 2024 15:40:17 +0200 Subject: [PATCH 5/6] add miniforge3 to prefix search --- lib/galaxy/tool_util/deps/conda_util.py | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/lib/galaxy/tool_util/deps/conda_util.py b/lib/galaxy/tool_util/deps/conda_util.py index 19550602ed83..3af39301e884 100644 --- a/lib/galaxy/tool_util/deps/conda_util.py +++ b/lib/galaxy/tool_util/deps/conda_util.py @@ -72,21 +72,12 @@ def find_conda_prefix() -> str: for Miniconda installs. """ home = os.path.expanduser("~") - miniconda_2_dest = os.path.join(home, "miniconda2") - miniconda_3_dest = os.path.join(home, "miniconda3") - anaconda_2_dest = os.path.join(home, "anaconda2") - anaconda_3_dest = os.path.join(home, "anaconda3") - # Prefer miniconda3 install if both available - if os.path.exists(miniconda_3_dest): - return miniconda_3_dest - elif os.path.exists(miniconda_2_dest): - return miniconda_2_dest - elif os.path.exists(anaconda_3_dest): - return anaconda_3_dest - elif os.path.exists(anaconda_2_dest): - return anaconda_2_dest - else: - return miniconda_3_dest + destinations = ["miniforge3", "miniconda3", "miniconda2", "anaconda3", "anaconda2"] + for destination in destinations: + destination = os.path.join(home, destination) + if os.path.exists(destination): + return destination + return "miniforge3" class CondaContext(installable.InstallableContext): From b44d49b5904b74d649f49c76a683730a6f714559 Mon Sep 17 00:00:00 2001 From: M Bernt Date: Tue, 3 Sep 2024 15:55:15 +0200 Subject: [PATCH 6/6] also add home for default return Co-authored-by: Nicola Soranzo --- lib/galaxy/tool_util/deps/conda_util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/galaxy/tool_util/deps/conda_util.py b/lib/galaxy/tool_util/deps/conda_util.py index 3af39301e884..8bead7148a5d 100644 --- a/lib/galaxy/tool_util/deps/conda_util.py +++ b/lib/galaxy/tool_util/deps/conda_util.py @@ -77,7 +77,7 @@ def find_conda_prefix() -> str: destination = os.path.join(home, destination) if os.path.exists(destination): return destination - return "miniforge3" + return os.path.join(home, "miniforge3") class CondaContext(installable.InstallableContext):