From 535b4e9693a1a1d39fc5937c645f4b264143a59c Mon Sep 17 00:00:00 2001 From: Ryan Dale Date: Mon, 20 Nov 2023 09:10:06 -0500 Subject: [PATCH] Various updates (#45) - Removed `MINICONDA_VER`. It only appears to be used in the now-deprecated bioconda-actions repo, and we're using mambaforge anyway. - Added `linux-aarch64` to the local channels. This is just to be complete -- I'm not sure this local channel setup is actually needed any more, because the pilot ARM builds worked OK. However, this may end up being important when there are many dependencies being built in which case the local channel should have priority. - Updated the readme to reflect current organization, so I can refer to it in the updated bioconda-docs. This info is better maintained here anyway rather than over on bioconda-docs. - Added `configure-conda.sh` to the test in this repo just to be complete. --- .github/workflows/test.yml | 1 + README.md | 34 ++++++++++++++++++++++++++++++++-- common.sh | 1 - install-and-set-up-conda.sh | 2 +- 4 files changed, 34 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index da04b52..4034354 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,3 +12,4 @@ jobs: - name: Test install bioconda-utils run: | COMMON_GIT_REF=${GITHUB_SHA} bash install-and-set-up-conda.sh + bash configure-conda.sh diff --git a/README.md b/README.md index a7da0ad..b13bd3b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,34 @@ -This repository contains common definitions for the bioconda build system, e.g., the bioconda-utils tag to use and the miniconda version. +# Overview +This repository acts as a central "source of truth" which can be used by +various components of the Bioconda build system. -- `common.sh` contains environment variables that control versions +# Components + +**`common.sh`:** contains environment variables that control versions. + +**`install-and-set-up-conda.sh`:** +- downloads and installs conda using the Mambaforge distribution +- installs bioconda-utils dependencies +- installs the version of bioconda-utils specified in common.sh via pip install + +**`configure-conda.sh`:** ensures channels are configured correctly. + +# Typical usage + +In practice, a typical CI environment will do the following: + +1. Download the files, typically via: + + ```bash + wget https://raw.githubusercontent.com/bioconda/bioconda-common/master/{common,install-and-set-up-conda,configure-conda}.sh + ``` + +2. Run `install-and-set-up-conda.sh` (which sources `common.sh`). + +3. Use the CI platform's mechanism to cache the conda install dir (which is + configured in `common.sh`). + +4. After a cache restore, run `configure-conda.sh`. The reason for this is that + the `--system` arg for `conda config` is not supported by mamba, and so the + channel config ends up in the home directory which is not cached. diff --git a/common.sh b/common.sh index 47c3191..34d4892 100644 --- a/common.sh +++ b/common.sh @@ -1,4 +1,3 @@ -MINICONDA_VER=py37_4.8.3 BIOCONDA_UTILS_TAG=v2.9.0 MAMBAFORGE_VER=23.1.0-1 MAMBAFORGE_INSTALLATION_DIR="/opt/mambaforge" diff --git a/install-and-set-up-conda.sh b/install-and-set-up-conda.sh index d8cad5e..5cdf0ca 100644 --- a/install-and-set-up-conda.sh +++ b/install-and-set-up-conda.sh @@ -87,7 +87,7 @@ 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 "${MAMBAFORGE_INSTALLATION_DIR}/conda-bld/{noarch,linux-64,osx-64}" + mkdir -p "${MAMBAFORGE_INSTALLATION_DIR}/conda-bld/{noarch,linux-64,osx-64,linux-aarch64}" conda index "${MAMBAFORGE_INSTALLATION_DIR}/conda-bld" conda config --add channels "file://${MAMBAFORGE_INSTALLATION_DIR}/conda-bld" fi