Skip to content
Merged
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
10 changes: 5 additions & 5 deletions common.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Respect overrides from environment
BIOCONDA_UTILS_TAG=${BIOCONDA_UTILS_TAG:="v3.7.2"}
MINIFORGE_VER=${MINIFORGE_VER:="25.3.0-3"}
MINIFORGE_INSTALLATION_DIR=${MINIFORGE_INSTALLATION_DIR:="/opt/miniforge"}
MAMBAFORGE_VER=${MAMBAFORGE_VER:="24.11.0-1"}
MAMBAFORGE_INSTALLATION_DIR=${MAMBAFORGE_INSTALLATION_DIR:="/opt/mambaforge"}
platform=$(uname -s)
arch=$(uname -m)
if [[ "$platform" == "Darwin" ]]; then
if [[ "$arch" == "arm64" ]]; then
export MACOSX_DEPLOYMENT_TARGET=13.0
export MACOSX_SDK_VERSION=13.0
elif [[ "$arch" == "x86_64" ]]; then
export MACOSX_DEPLOYMENT_TARGET=11.0
export MACOSX_SDK_VERSION=11.0
elif [[ "$arch" == 'x86_64' ]]; then
export MACOSX_DEPLOYMENT_TARGET=10.15
export MACOSX_SDK_VERSION=10.15
fi
fi
6 changes: 3 additions & 3 deletions configure-conda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ fi
source common.sh

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

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

if [ ${BIOCONDA_DISABLE_BUILD_PREP:=0} == 0 ]; then
conda config --add channels "file://${MINIFORGE_INSTALLATION_DIR}/conda-bld"
conda config --add channels "file://${MAMBAFORGE_INSTALLATION_DIR}/conda-bld"
fi
37 changes: 19 additions & 18 deletions install-and-set-up-conda.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/bin/bash
#! /bin/bash

set -e

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

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

# Remove existing installation on macOS runners
sudo rm -rf ${MINIFORGE_INSTALLATION_DIR}
sudo mkdir -p $(dirname $MINIFORGE_INSTALLATION_DIR)
sudo chown -R $USER $(dirname $MINIFORGE_INSTALLATION_DIR)
sudo rm -rf ${MAMBAFORGE_INSTALLATION_DIR}
sudo mkdir -p $(dirname $MAMBAFORGE_INSTALLATION_DIR)
sudo chown -R $USER $(dirname $MAMBAFORGE_INSTALLATION_DIR)

# conda-forge-ci-setup does some additional setup for Mac.
BIOCONDA_ADDITIONAL_INSTALL_PKGS="conda-forge-ci-setup"
else
mkdir -p $(dirname $MINIFORGE_INSTALLATION_DIR)
mkdir -p $(dirname $MAMBAFORGE_INSTALLATION_DIR)
OS="Linux"
BIOCONDA_ADDITIONAL_INSTALL_PKGS=""
fi

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

# Install miniforge
# Install mambaforge
echo Download ${MINIFORGE_URL}
curl -L ${MINIFORGE_URL} > miniforge.sh
head miniforge.sh
bash miniforge.sh -b -p "${MINIFORGE_INSTALLATION_DIR}"
curl -L ${MINIFORGE_URL} > mambaforge.sh
head mambaforge.sh
bash mambaforge.sh -b -p "${MAMBAFORGE_INSTALLATION_DIR}"

export PATH="${MINIFORGE_INSTALLATION_DIR}/bin:${PATH}"
export PATH="${MAMBAFORGE_INSTALLATION_DIR}/bin:${PATH}"

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

source ${MINIFORGE_INSTALLATION_DIR}/etc/profile.d/conda.sh
source ${MINIFORGE_INSTALLATION_DIR}/etc/profile.d/mamba.sh
source ${MAMBAFORGE_INSTALLATION_DIR}/etc/profile.d/conda.sh
source ${MAMBAFORGE_INSTALLATION_DIR}/etc/profile.d/mamba.sh

# set up env with all dependencies
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
Expand All @@ -81,11 +82,11 @@ if [ ${BIOCONDA_DISABLE_BUILD_PREP:=0} == 0 ]; then

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

echo "=========="
Expand Down