From c946860318d6be3b45d59361c237682b72598758 Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Mon, 12 Aug 2024 19:02:08 +0000 Subject: [PATCH] another attempt at removing mamba --- .github/workflows/build-images.yml | 2 +- images/bioconda-utils-build-env-cos7/Dockerfile | 8 ++++---- images/create-env/Dockerfile | 3 +-- images/create-env/Dockerfile.test | 3 --- images/create-env/README.md | 7 ++----- images/create-env/install-conda | 11 +++++------ images/create-env/prepare.sh | 6 ------ 7 files changed, 13 insertions(+), 27 deletions(-) diff --git a/.github/workflows/build-images.yml b/.github/workflows/build-images.yml index c79e171a4a..0796c98d1d 100644 --- a/.github/workflows/build-images.yml +++ b/.github/workflows/build-images.yml @@ -191,7 +191,7 @@ jobs: wget https://raw.githubusercontent.com/bioconda/bioconda-common/master/{common,install-and-set-up-conda,configure-conda}.sh bash install-and-set-up-conda.sh eval "$(conda shell.bash hook)" - mamba create -n bioconda -y --file test-requirements.txt --file bioconda_utils/bioconda_utils-requirements.txt + conda create -n bioconda -y --file test-requirements.txt --file bioconda_utils/bioconda_utils-requirements.txt conda activate bioconda python setup.py install diff --git a/images/bioconda-utils-build-env-cos7/Dockerfile b/images/bioconda-utils-build-env-cos7/Dockerfile index 9b23b16a79..bae6f61430 100644 --- a/images/bioconda-utils-build-env-cos7/Dockerfile +++ b/images/bioconda-utils-build-env-cos7/Dockerfile @@ -50,14 +50,14 @@ RUN . /opt/conda/etc/profile.d/conda.sh && conda activate base && \ sed -nE \ '/^conda([> requirements.txt +RUN echo -e "$CONDA_VERSION" > requirements.txt RUN ./install-conda ./requirements.txt /opt/create-env ARG BUSYBOX_IMAGE diff --git a/images/create-env/Dockerfile.test b/images/create-env/Dockerfile.test index 5de59c7699..f04649005e 100644 --- a/images/create-env/Dockerfile.test +++ b/images/create-env/Dockerfile.test @@ -5,7 +5,6 @@ RUN set -x && \ CONDA_PKGS_DIRS="/tmp/pkgs" \ /opt/create-env/env-execute \ create-env \ - --conda=mamba \ /usr/local \ file findutils grep RUN set -x && \ @@ -34,7 +33,6 @@ FROM "${base}" as build_bioconda_package RUN set -x && \ /opt/create-env/env-execute \ create-env \ - --conda=mamba \ --strip-files=\* \ /usr/local \ python @@ -58,7 +56,6 @@ FROM "${base}" as build_conda RUN set -x && \ /opt/create-env/env-execute \ create-env \ - --conda=mamba \ --env-activate-args='--prefix-is-base' \ --strip-files=\* \ --remove-paths=\*.a \ diff --git a/images/create-env/README.md b/images/create-env/README.md index ca9a7ed9a4..cc84f3b476 100644 --- a/images/create-env/README.md +++ b/images/create-env/README.md @@ -1,6 +1,6 @@ # bioconda/create-env -The `create-env` container image, available as [`quay.io/bioconda/create-env`](https://quay.io/repository/bioconda/create-env?tab=tags), provides [`conda`](https://github.com/conda/conda/) (and [`mamba`](https://github.com/mamba-org/mamba)) alongside a convenience wrapper `create-env` to create small container images based on Conda packages. +The `create-env` container image, available as [`quay.io/bioconda/create-env`](https://quay.io/repository/bioconda/create-env?tab=tags), provides [`conda`](https://github.com/conda/conda/) alongside a convenience wrapper `create-env` to create small container images based on Conda packages. ## Options @@ -37,13 +37,12 @@ Post-processing steps are triggered by arguments to `create-env`: ## Usage example: ```Dockerfile FROM quay.io/bioconda/create-env:2.1.0 as build -# Create an environment containing python=3.9 at /usr/local using mamba, strip +# Create an environment containing python=3.9 at /usr/local, strip # files and remove some less important files: RUN export CONDA_ADD_PIP_AS_PYTHON_DEPENDENCY=0 \ && \ /opt/create-env/env-execute \ create-env \ - --conda=mamba \ --strip-files='bin/*' \ --strip-files='lib/*' \ --remove-paths='*.a' \ @@ -87,8 +86,6 @@ RUN /usr/local/env-activate.sh && python -c 'import sys; print(sys.version)' ```sh . /opt/create-env/env-activate.sh export CONDA_ALWAYS_COPY=0 - create-env --conda=mamba /opt/python-3.8 python=3.8 - create-env --conda=mamba /opt/python-3.9 python=3.9 create-env --conda=: --strip-files=\* /opt/python-3.8 create-env --conda=: --strip-files=\* /opt/python-3.9 ``` diff --git a/images/create-env/install-conda b/images/create-env/install-conda index a3b9b33272..7ce597bc32 100755 --- a/images/create-env/install-conda +++ b/images/create-env/install-conda @@ -22,23 +22,23 @@ miniconda_boostrap_prefix="$( pwd )/miniconda" # Install the base Conda installation. . "${miniconda_boostrap_prefix}/etc/profile.d/conda.sh" - # Install conda, mamba and some additional tools: + # Install conda and some additional tools: # - tini: init program, # - binutils, findutils: tools to strip down image/environment size, # Only need `strip` executable from binutils. Other binaries from the package # and especially the "sysroot" dependency is only bloat for this container # image. (NOTE: The binary needs libgcc-ng which is explicitly added later.) - mamba create --yes \ + conda create --yes \ --prefix="${conda_install_prefix}" \ --channel=conda-forge \ binutils cp -aL "${conda_install_prefix}/bin/strip" ./strip conda run --prefix="${conda_install_prefix}" strip -- ./strip - mamba remove --yes --all \ + conda remove --yes --all \ --prefix="${conda_install_prefix}" - mamba create --yes \ + conda create --yes \ --prefix="${conda_install_prefix}" \ --channel=conda-forge \ \ @@ -116,8 +116,7 @@ conda config \ # This is intentional as it speeds up conda startup time. conda list --name=base conda info --all -mamba --version -# Make sure we have the requested conda, mamba versions installed. +# Make sure we have the requested conda version installed, and no mamba conda list \ --export '^(conda|mamba)$' \ | sed -n 's/=[^=]*$//p' \ diff --git a/images/create-env/prepare.sh b/images/create-env/prepare.sh index e9fb937e74..d98ad01b4f 100644 --- a/images/create-env/prepare.sh +++ b/images/create-env/prepare.sh @@ -21,16 +21,10 @@ CONDA_VERSION=$( podman run -t $REGISTRY/${BUILD_ENV_IMAGE_NAME}:${BIOCONDA_IMAGE_TAG} \ bash -c "/opt/conda/bin/conda list --export '^conda$'| sed -n 's/=[^=]*$//p'" ) -MAMBA_VERSION=$( - podman run -t $REGISTRY/${BUILD_ENV_IMAGE_NAME}:${BIOCONDA_IMAGE_TAG} \ - bash -c "/opt/conda/bin/conda list --export '^mamba$'| sed -n 's/=[^=]*$//p'" -) # Remove trailing \r with parameter expansion export CONDA_VERSION=${CONDA_VERSION%$'\r'} -export MAMBA_VERSION=${MAMBA_VERSION%$'\r'} BUILD_ARGS+=("--build-arg=CONDA_VERSION=$CONDA_VERSION") -BUILD_ARGS+=("--build-arg=MAMBA_VERSION=$MAMBA_VERSION") # Needs busybox image to copy some items over if [ $(tag_exists $BASE_BUSYBOX_IMAGE_NAME $BASE_TAG) ]; then