Skip to content

Commit 9cc799f

Browse files
authored
Convert to miniforge, take 2 (#73)
1 parent a6f9401 commit 9cc799f

File tree

3 files changed

+24
-25
lines changed

3 files changed

+24
-25
lines changed

common.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Respect overrides from environment
22
BIOCONDA_UTILS_TAG=${BIOCONDA_UTILS_TAG:="v3.7.2"}
3-
MAMBAFORGE_VER=${MAMBAFORGE_VER:="24.11.3-2"}
4-
MAMBAFORGE_INSTALLATION_DIR=${MAMBAFORGE_INSTALLATION_DIR:="/opt/mambaforge"}
3+
MINIFORGE_VER=${MINIFORGE_VER:="25.3.0-3"}
4+
MINIFORGE_INSTALLATION_DIR=${MINIFORGE_INSTALLATION_DIR:="/opt/mambaforge"}
55
platform=$(uname -s)
66
arch=$(uname -m)
77
if [[ "$platform" == "Darwin" ]]; then

configure-conda.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ fi
1414
source common.sh
1515

1616
# assert that common.sh has set the variables we need
17-
if [ -z ${MAMBAFORGE_INSTALLATION_DIR+x} ]
17+
if [ -z ${MINIFORGE_INSTALLATION_DIR+x} ]
1818
then
19-
echo "ERROR: The variable MAMBAFORGE_INSTALLATION_DIR is not set by common.sh. Exiting."
19+
echo "ERROR: The variable MINIFORGE_INSTALLATION_DIR is not set by common.sh. Exiting."
2020
exit 1
2121
fi
2222

@@ -29,5 +29,5 @@ conda config --set channel_priority strict
2929
# conda config --set conda_build.pkg_format 2
3030

3131
if [ ${BIOCONDA_DISABLE_BUILD_PREP:=0} == 0 ]; then
32-
conda config --add channels "file://${MAMBAFORGE_INSTALLATION_DIR}/conda-bld"
32+
conda config --add channels "file://${MINIFORGE_INSTALLATION_DIR}/conda-bld"
3333
fi

install-and-set-up-conda.sh

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
#! /bin/bash
2-
1+
#!/bin/bash
32
set -e
43

5-
# - Installs mambaforge to ${HOME}/mambaforge. Version is determined by common.sh,
4+
# - Installs miniforge to ${HOME}/mambaforge. Version is determined by common.sh,
65
# which is downloaded at runtime.
76
# - Sets channel order and sets strict channel priority
87
# - Installs bioconda-utils into a "bioconda" env (unless
@@ -22,7 +21,7 @@ done
2221
source common.sh
2322

2423
# assert that common.sh has set the variables we need
25-
for var in BIOCONDA_UTILS_TAG MAMBAFORGE_VER MAMBAFORGE_INSTALLATION_DIR
24+
for var in BIOCONDA_UTILS_TAG MINIFORGE_VER MINIFORGE_INSTALLATION_DIR
2625
do
2726
if [ -z ${var+x} ]
2827
then
@@ -38,27 +37,27 @@ if [[ $(uname) == "Darwin" ]]; then
3837
OS="MacOSX"
3938

4039
# Remove existing installation on macOS runners
41-
sudo rm -rf ${MAMBAFORGE_INSTALLATION_DIR}
42-
sudo mkdir -p $(dirname $MAMBAFORGE_INSTALLATION_DIR)
43-
sudo chown -R $USER $(dirname $MAMBAFORGE_INSTALLATION_DIR)
40+
sudo rm -rf ${MINIFORGE_INSTALLATION_DIR}
41+
sudo mkdir -p $(dirname $MINIFORGE_INSTALLATION_DIR)
42+
sudo chown -R $USER $(dirname $MINIFORGE_INSTALLATION_DIR)
4443

4544
# conda-forge-ci-setup does some additional setup for Mac.
4645
BIOCONDA_ADDITIONAL_INSTALL_PKGS="conda-forge-ci-setup"
4746
else
48-
mkdir -p $(dirname $MAMBAFORGE_INSTALLATION_DIR)
47+
mkdir -p $(dirname $MINIFORGE_INSTALLATION_DIR)
4948
OS="Linux"
5049
BIOCONDA_ADDITIONAL_INSTALL_PKGS=""
5150
fi
5251

53-
MINIFORGE_URL="https://github.com/conda-forge/miniforge/releases/download/${MAMBAFORGE_VER}/Miniforge3-${MAMBAFORGE_VER}-${OS}-${ARCH}.sh"
52+
MINIFORGE_URL="https://github.com/conda-forge/miniforge/releases/download/${MINIFORGE_VER}/Miniforge3-${MINIFORGE_VER}-${OS}-${ARCH}.sh"
5453

55-
# Install mambaforge
54+
# Install miniforge
5655
echo Download ${MINIFORGE_URL}
57-
curl -L ${MINIFORGE_URL} > mambaforge.sh
58-
head mambaforge.sh
59-
bash mambaforge.sh -b -p "${MAMBAFORGE_INSTALLATION_DIR}"
56+
curl -L ${MINIFORGE_URL} > miniforge.sh
57+
head miniforge.sh
58+
bash miniforge.sh -b -p "${MINIFORGE_INSTALLATION_DIR}"
6059

61-
export PATH="${MAMBAFORGE_INSTALLATION_DIR}/bin:${PATH}"
60+
export PATH="${MINIFORGE_INSTALLATION_DIR}/bin:${PATH}"
6261

6362
# Set up channels
6463
# disable build preparation here because we don't yet have the local channel from conda-build
@@ -69,24 +68,24 @@ BIOCONDA_DISABLE_BUILD_PREP=1 bash configure-conda.sh
6968
# which case set BIOCONDA_DISABLE_BUILD_PREP to a non-zero value.
7069
if [ ${BIOCONDA_DISABLE_BUILD_PREP:=0} == 0 ]; then
7170

72-
source ${MAMBAFORGE_INSTALLATION_DIR}/etc/profile.d/conda.sh
73-
source ${MAMBAFORGE_INSTALLATION_DIR}/etc/profile.d/mamba.sh
71+
source ${MINIFORGE_INSTALLATION_DIR}/etc/profile.d/conda.sh
72+
source ${MINIFORGE_INSTALLATION_DIR}/etc/profile.d/mamba.sh
7473

7574
# set up env with all dependencies
7675
conda create -n bioconda -y --file https://raw.githubusercontent.com/bioconda/bioconda-utils/$BIOCONDA_UTILS_TAG/bioconda_utils/bioconda_utils-requirements.txt $BIOCONDA_ADDITIONAL_INSTALL_PKGS
7776

7877
conda activate bioconda
7978

8079
# install bioconda-utils itself via pip (this way we don't always have to wait for the conda package to be built before being able to fix things here)
81-
pip install git+https://github.com/bioconda/bioconda-utils.git@$BIOCONDA_UTILS_TAG
80+
pip install git+https://github.com/bioconda/bioconda-utils.git@$BIOCONDA_UTILS_TAG --no-build-isolation --no-cache-dir --use-pep517
8281

8382
# Set local channel as highest priority (requires conda-build, which is
8483
# installed as a dependency of bioconda-utils)
85-
mkdir -p "${MAMBAFORGE_INSTALLATION_DIR}/conda-bld/{noarch,linux-64,osx-64,linux-aarch64,osx-arm64}"
84+
mkdir -p "${MINIFORGE_INSTALLATION_DIR}/conda-bld/{noarch,linux-64,osx-64,linux-aarch64,osx-arm64}"
8685
# The base installation does not include conda-index, so use "command conda" to run bioconda
8786
# env's "conda index".
88-
command conda index "${MAMBAFORGE_INSTALLATION_DIR}/conda-bld"
89-
conda config --add channels "file://${MAMBAFORGE_INSTALLATION_DIR}/conda-bld"
87+
command conda index "${MINIFORGE_INSTALLATION_DIR}/conda-bld"
88+
conda config --add channels "file://${MINIFORGE_INSTALLATION_DIR}/conda-bld"
9089
fi
9190

9291
echo "=========="

0 commit comments

Comments
 (0)