Skip to content

Commit

Permalink
Reduce test matrix for emulated architecture
Browse files Browse the repository at this point in the history
  • Loading branch information
hmaarrfk committed Oct 25, 2022
1 parent 0950521 commit bc8b082
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions build_miniforge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ============="
Expand All @@ -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
8 changes: 4 additions & 4 deletions scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

Expand Down Expand Up @@ -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
Expand All @@ -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}"
Expand Down

0 comments on commit bc8b082

Please sign in to comment.