From bc8b08246e1a4f54a6e5d04290735cdc2ff6db70 Mon Sep 17 00:00:00 2001 From: Mark Harfouche Date: Sun, 23 Oct 2022 13:38:20 -0400 Subject: [PATCH] Reduce test matrix for emulated architecture --- .github/workflows/ci.yml | 13 +++++++++++++ build_miniforge.sh | 8 ++++++-- scripts/test.sh | 8 ++++---- 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ab669b81..89a3e1f2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -132,6 +132,11 @@ jobs: DOCKERIMAGE: condaforge/linux-anvil-aarch64 MINIFORGE_NAME: "Mambaforge-pypy3" OS_NAME: "Linux" + # Reduce the test matrix because the builds timeouts on emulated architectures + # The time consuming operation is an attempt a full solve of conda/mamba/boa + # for as a compatibility + # xref https://github.com/conda-forge/miniforge/pull/361 + TEST_IMAGE_NAMES: "ubuntu:22.04" - os: ubuntu-latest ARCH: x86_64 @@ -164,6 +169,14 @@ jobs: DOCKERIMAGE: condaforge/linux-anvil-ppc64le MINIFORGE_NAME: "Mambaforge-pypy3" OS_NAME: "Linux" + # Reduce the test matrix because the builds timeouts on emulated architectures + # The time consuming operation is an attempt a full solve of conda/mamba/boa + # for as a compatibility + # xref https://github.com/conda-forge/miniforge/pull/361 + TEST_IMAGE_NAMES: "centos:7" + # It turns out, tat on this particular image, even a single test + # for compatibility does not finish in time. + TEST_CONDA_MAMBA_BOA_COMPATIBILITY: "no" steps: - name: Checkout code diff --git a/build_miniforge.sh b/build_miniforge.sh index 856b3ce8..74e6f9b3 100755 --- a/build_miniforge.sh +++ b/build_miniforge.sh @@ -17,6 +17,8 @@ DOCKERIMAGE=${DOCKERIMAGE:-condaforge/linux-anvil-aarch64} export MINIFORGE_NAME=${MINIFORGE_NAME:-Miniforge3} OS_NAME=${OS_NAME:-Linux} EXT=${EXT:-sh} +TEST_IMAGE_NAMES=${TEST_IMAGE_NAMES:-ubuntu:22.04 ubuntu:20.04 ubuntu:18.04 ubuntu:16.04 centos:7 debian:bullseye debian:buster} +TEST_CONDA_MAMBA_BOA_COMPATIBILITY=${TEST_CONDA_MAMBA_BOA_COMPATIBILITY:-yes} export CONSTRUCT_ROOT=/construct echo "============= Create build directory =============" @@ -33,8 +35,10 @@ docker run --rm -v "$(pwd):/construct" \ "${DOCKERIMAGE}" /construct/scripts/build.sh echo "============= Test the installer =============" -for TEST_IMAGE_NAME in "ubuntu:22.04" "ubuntu:20.04" "ubuntu:18.04" "ubuntu:16.04" "centos:7" "debian:bullseye" "debian:buster"; do +for TEST_IMAGE_NAME in ${TEST_IMAGE_NAMES}; do echo "============= Test installer on ${TEST_IMAGE_NAME} =============" - docker run --rm -v "$(pwd):/construct" -e CONSTRUCT_ROOT \ + docker run --rm \ + -v "$(pwd):${CONSTRUCT_ROOT}" -e CONSTRUCT_ROOT \ + -e TEST_CONDA_MAMBA_BOA_COMPATIBILITY \ "${DOCKER_ARCH}/${TEST_IMAGE_NAME}" /construct/scripts/test.sh done diff --git a/scripts/test.sh b/scripts/test.sh index ba18cc23..30fa6ea3 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -7,6 +7,7 @@ echo "***** Start: Testing Miniforge installer *****" export CONDA_PATH="${HOME}/miniforge" CONSTRUCT_ROOT="${CONSTRUCT_ROOT:-${PWD}}" +TEST_CONDA_MAMBA_BOA_COMPATIBILITY=${TEST_CONDA_MAMBA_BOA_COMPATIBILITY:-yes} cd "${CONSTRUCT_ROOT}" @@ -45,7 +46,7 @@ if [[ "$(uname)" == MINGW* ]]; then conda.exe install r-base --yes --quiet conda.exe list - if [[ "${INSTALLER_NAME}" == "Mambaforge" ]]; then + if [[ "${INSTALLER_NAME}" == "Mambaforge" ]] && [[ "${TEST_CONDA_MAMBA_BOA_COMPATIBILITY}" == "yes" ]]; then echo "***** Mambaforge detected. Checking for boa compatibility *****" mamba_version_start=$(mamba --version | grep mamba | cut -d ' ' -f 2) mamba.exe install boa --yes @@ -66,14 +67,13 @@ else conda info conda list - if [[ "${INSTALLER_NAME}" == "Mambaforge" ]]; then + if [[ "${INSTALLER_NAME}" == "Mambaforge" ]] && [[ "${TEST_CONDA_MAMBA_BOA_COMPATIBILITY}" == "yes" ]]; then echo "***** Mambaforge detected. Checking for boa compatibility *****" implementation=$(python -c "import platform; print(platform.python_implementation().lower())") major_minor_version=$(python -c 'import sys; print(f"{sys.version_info[0]}.{sys.version_info[1]}")') mamba_version_start=$(mamba --version | grep mamba | cut -d ' ' -f 2) mamba info - mamba install "mamba=${mamba_version_start}" "python=${major_minor_version}.*=*_${implementation}" boa --yes --verbose || \ - (wc -l /root/miniforge/pkgs/cache/09cdf8bf.json && cat /root/miniforge/pkgs/cache/09cdf8bf.json && exit 1) + mamba install "mamba=${mamba_version_start}" "python=${major_minor_version}.*=*_${implementation}" boa --yes mamba_version_end=$(mamba --version | grep mamba | cut -d ' ' -f 2) if [[ "${mamba_version_start}" != "${mamba_version_end}" ]]; then echo "mamba version changed from ${mamba_version_start} to ${mamba_version_end}"