Skip to content

Commit

Permalink
rm mamba from images
Browse files Browse the repository at this point in the history
  • Loading branch information
daler committed Aug 11, 2024
1 parent 9195c9e commit f311612
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 34 deletions.
12 changes: 1 addition & 11 deletions .github/workflows/build-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,23 +175,13 @@ jobs:
with:
fetch-depth: 0

# # Clone bioconda-recipes to use as part of the tests.
# - uses: actions/checkout@v4
# with:
# fetch-depth: 0
# repository: bioconda/bioconda-recipes
# path: recipes

# - name: set path
# run: echo "/opt/mambaforge/bin" >> $GITHUB_PATH

- name: Install bioconda-utils
run: |
export BIOCONDA_DISABLE_BUILD_PREP=1
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
Expand Down
1 change: 0 additions & 1 deletion bioconda_utils/bioconda_utils-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ conda-libmamba-solver=24.1.*
conda-build=24.5.*
conda-index=0.4.*
conda-package-streaming=0.9.*
mamba=1.5.*
boa=0.17.*

argh=0.31.* # CLI
Expand Down
8 changes: 4 additions & 4 deletions images/bioconda-utils-build-env-cos7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ RUN . /opt/conda/etc/profile.d/conda.sh && conda activate base && \
sed -nE \
'/^conda([><!=~ ].+)?$/p' \
/opt/bioconda-utils/bioconda_utils-requirements.txt \
| xargs -r mamba install --yes && \
| xargs -r conda install --yes && \
# FIXME: "remove truststore" only necessary due to python downgrade.
# Updating requirements should fix that.
# (Also this removal will break in future.)
mamba remove --yes truststore && \
mamba install --yes --file /opt/bioconda-utils/bioconda_utils-requirements.txt && \
conda remove --yes truststore && \
conda install --yes --file /opt/bioconda-utils/bioconda_utils-requirements.txt && \
pip install --no-deps --find-links /opt/bioconda-utils bioconda_utils && \
mamba clean --yes --index --tarballs && \
conda clean --yes --index --tarballs && \
# Find files that are not already in group "lucky" and change their group and mode.
find /opt/conda \
\! -group lucky \
Expand Down
5 changes: 2 additions & 3 deletions images/create-env/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ RUN arch="$( uname -m )" \
wget --quiet -O ./miniconda.sh \
"https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-${arch}.sh"

# Install exact versions of conda/mamba
# Install exact versions of condaa
ARG CONDA_VERSION
ARG MAMBA_VERSION
RUN echo -e "$CONDA_VERSION\n$MAMBA_VERSION" > requirements.txt
RUN echo -e "$CONDA_VERSION" > requirements.txt
RUN ./install-conda ./requirements.txt /opt/create-env

ARG BUSYBOX_IMAGE
Expand Down
3 changes: 0 additions & 3 deletions images/create-env/Dockerfile.test
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
Expand Down Expand Up @@ -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
Expand All @@ -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 \
Expand Down
9 changes: 4 additions & 5 deletions images/create-env/install-conda
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ miniconda_boostrap_prefix="$( pwd )/miniconda"
# 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 \
\
Expand Down Expand Up @@ -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
conda list \
--export '^(conda|mamba)$' \
| sed -n 's/=[^=]*$//p' \
Expand Down
8 changes: 1 addition & 7 deletions images/create-env/prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ BUILD_ARGS=()



# Get the exact versions of mamba and conda that were installed in build-env.
# Get the exact versions of conda that wasinstalled in build-env.
#
# If this tag exists on quay.io (that is, this create-env is being built in
# a subsequent run), then use that. Otherwise, we assume this tag has already
Expand All @@ -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
Expand Down

0 comments on commit f311612

Please sign in to comment.