diff --git a/.azure-pipelines/azure-pipelines-linux.yml b/.azure-pipelines/azure-pipelines-linux.yml deleted file mode 100755 index ae22dfe..0000000 --- a/.azure-pipelines/azure-pipelines-linux.yml +++ /dev/null @@ -1,112 +0,0 @@ -# This file was generated automatically from conda-smithy. To update this configuration, -# update the conda-forge.yml and/or the recipe/meta.yaml. -# -*- mode: yaml -*- - -jobs: -- job: linux - pool: - vmImage: ubuntu-latest - strategy: - matrix: - linux_64_amrex_precisiondpmpimpich: - CONFIG: linux_64_amrex_precisiondpmpimpich - UPLOAD_PACKAGES: 'True' - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma9 - linux_64_amrex_precisiondpmpinompi: - CONFIG: linux_64_amrex_precisiondpmpinompi - UPLOAD_PACKAGES: 'True' - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma9 - linux_64_amrex_precisiondpmpiopenmpi: - CONFIG: linux_64_amrex_precisiondpmpiopenmpi - UPLOAD_PACKAGES: 'True' - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma9 - linux_64_amrex_precisionspmpimpich: - CONFIG: linux_64_amrex_precisionspmpimpich - UPLOAD_PACKAGES: 'True' - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma9 - linux_64_amrex_precisionspmpinompi: - CONFIG: linux_64_amrex_precisionspmpinompi - UPLOAD_PACKAGES: 'True' - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma9 - linux_64_amrex_precisionspmpiopenmpi: - CONFIG: linux_64_amrex_precisionspmpiopenmpi - UPLOAD_PACKAGES: 'True' - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma9 - linux_aarch64_amrex_precisiondpmpimpich: - CONFIG: linux_aarch64_amrex_precisiondpmpimpich - UPLOAD_PACKAGES: 'True' - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma9 - linux_aarch64_amrex_precisiondpmpinompi: - CONFIG: linux_aarch64_amrex_precisiondpmpinompi - UPLOAD_PACKAGES: 'True' - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma9 - linux_aarch64_amrex_precisiondpmpiopenmpi: - CONFIG: linux_aarch64_amrex_precisiondpmpiopenmpi - UPLOAD_PACKAGES: 'True' - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma9 - linux_aarch64_amrex_precisionspmpimpich: - CONFIG: linux_aarch64_amrex_precisionspmpimpich - UPLOAD_PACKAGES: 'True' - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma9 - linux_aarch64_amrex_precisionspmpinompi: - CONFIG: linux_aarch64_amrex_precisionspmpinompi - UPLOAD_PACKAGES: 'True' - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma9 - linux_aarch64_amrex_precisionspmpiopenmpi: - CONFIG: linux_aarch64_amrex_precisionspmpiopenmpi - UPLOAD_PACKAGES: 'True' - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma9 - linux_ppc64le_amrex_precisiondpmpimpich: - CONFIG: linux_ppc64le_amrex_precisiondpmpimpich - UPLOAD_PACKAGES: 'True' - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma9 - linux_ppc64le_amrex_precisiondpmpinompi: - CONFIG: linux_ppc64le_amrex_precisiondpmpinompi - UPLOAD_PACKAGES: 'True' - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma9 - linux_ppc64le_amrex_precisiondpmpiopenmpi: - CONFIG: linux_ppc64le_amrex_precisiondpmpiopenmpi - UPLOAD_PACKAGES: 'True' - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma9 - linux_ppc64le_amrex_precisionspmpimpich: - CONFIG: linux_ppc64le_amrex_precisionspmpimpich - UPLOAD_PACKAGES: 'True' - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma9 - linux_ppc64le_amrex_precisionspmpinompi: - CONFIG: linux_ppc64le_amrex_precisionspmpinompi - UPLOAD_PACKAGES: 'True' - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma9 - linux_ppc64le_amrex_precisionspmpiopenmpi: - CONFIG: linux_ppc64le_amrex_precisionspmpiopenmpi - UPLOAD_PACKAGES: 'True' - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma9 - timeoutInMinutes: 360 - variables: {} - - steps: - # configure qemu binfmt-misc running. This allows us to run docker containers - # embedded qemu-static - - script: | - docker run --rm --privileged multiarch/qemu-user-static:register --reset --credential yes - ls /proc/sys/fs/binfmt_misc/ - condition: not(startsWith(variables['CONFIG'], 'linux_64')) - displayName: Configure binfmt_misc - - - script: | - export CI=azure - export flow_run_id=azure_$(Build.BuildNumber).$(System.JobAttempt) - export remote_url=$(Build.Repository.Uri) - export sha=$(Build.SourceVersion) - export GIT_BRANCH=$BUILD_SOURCEBRANCHNAME - export FEEDSTOCK_NAME=$(basename ${BUILD_REPOSITORY_NAME}) - if [[ "${BUILD_REASON:-}" == "PullRequest" ]]; then - export IS_PR_BUILD="True" - else - export IS_PR_BUILD="False" - fi - .scripts/run_docker_build.sh - displayName: Run docker build - env: - BINSTAR_TOKEN: $(BINSTAR_TOKEN) - FEEDSTOCK_TOKEN: $(FEEDSTOCK_TOKEN) - STAGING_BINSTAR_TOKEN: $(STAGING_BINSTAR_TOKEN) diff --git a/.github/workflows/conda-build.yml b/.github/workflows/conda-build.yml index a948c6c..e65c297 100644 --- a/.github/workflows/conda-build.yml +++ b/.github/workflows/conda-build.yml @@ -1,15 +1,195 @@ -# This file was added automatically by admin-migrations. Do not modify. -# It ensures that Github Actions can run once rerendered for the first time. +# This file was generated automatically from conda-smithy. To update this configuration, +# update the conda-forge.yml and/or the recipe/meta.yaml. # -*- mode: yaml -*- name: Build conda package on: - workflow_dispatch: + push: + + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} + cancel-in-progress: true jobs: build: - name: Disabled build - runs-on: ubuntu-slim - if: false + name: ${{ matrix.CONFIG }} + runs-on: ${{ matrix.runs_on }} + timeout-minutes: 360 + strategy: + fail-fast: false + max-parallel: 50 + matrix: + include: + - CONFIG: linux_64_amrex_precisiondpmpimpich + UPLOAD_PACKAGES: True + os: ubuntu + runs_on: ['ubuntu-latest'] + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma9 + - CONFIG: linux_64_amrex_precisiondpmpinompi + UPLOAD_PACKAGES: True + os: ubuntu + runs_on: ['ubuntu-latest'] + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma9 + - CONFIG: linux_64_amrex_precisiondpmpiopenmpi + UPLOAD_PACKAGES: True + os: ubuntu + runs_on: ['ubuntu-latest'] + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma9 + - CONFIG: linux_64_amrex_precisionspmpimpich + UPLOAD_PACKAGES: True + os: ubuntu + runs_on: ['ubuntu-latest'] + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma9 + - CONFIG: linux_64_amrex_precisionspmpinompi + UPLOAD_PACKAGES: True + os: ubuntu + runs_on: ['ubuntu-latest'] + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma9 + - CONFIG: linux_64_amrex_precisionspmpiopenmpi + UPLOAD_PACKAGES: True + os: ubuntu + runs_on: ['ubuntu-latest'] + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma9 + - CONFIG: linux_aarch64_amrex_precisiondpmpimpich + UPLOAD_PACKAGES: True + os: ubuntu + runs_on: ['ubuntu-latest'] + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma9 + - CONFIG: linux_aarch64_amrex_precisiondpmpinompi + UPLOAD_PACKAGES: True + os: ubuntu + runs_on: ['ubuntu-latest'] + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma9 + - CONFIG: linux_aarch64_amrex_precisiondpmpiopenmpi + UPLOAD_PACKAGES: True + os: ubuntu + runs_on: ['ubuntu-latest'] + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma9 + - CONFIG: linux_aarch64_amrex_precisionspmpimpich + UPLOAD_PACKAGES: True + os: ubuntu + runs_on: ['ubuntu-latest'] + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma9 + - CONFIG: linux_aarch64_amrex_precisionspmpinompi + UPLOAD_PACKAGES: True + os: ubuntu + runs_on: ['ubuntu-latest'] + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma9 + - CONFIG: linux_aarch64_amrex_precisionspmpiopenmpi + UPLOAD_PACKAGES: True + os: ubuntu + runs_on: ['ubuntu-latest'] + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma9 + - CONFIG: linux_ppc64le_amrex_precisiondpmpimpich + UPLOAD_PACKAGES: True + os: ubuntu + runs_on: ['ubuntu-latest'] + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma9 + - CONFIG: linux_ppc64le_amrex_precisiondpmpinompi + UPLOAD_PACKAGES: True + os: ubuntu + runs_on: ['ubuntu-latest'] + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma9 + - CONFIG: linux_ppc64le_amrex_precisiondpmpiopenmpi + UPLOAD_PACKAGES: True + os: ubuntu + runs_on: ['ubuntu-latest'] + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma9 + - CONFIG: linux_ppc64le_amrex_precisionspmpimpich + UPLOAD_PACKAGES: True + os: ubuntu + runs_on: ['ubuntu-latest'] + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma9 + - CONFIG: linux_ppc64le_amrex_precisionspmpinompi + UPLOAD_PACKAGES: True + os: ubuntu + runs_on: ['ubuntu-latest'] + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma9 + - CONFIG: linux_ppc64le_amrex_precisionspmpiopenmpi + UPLOAD_PACKAGES: True + os: ubuntu + runs_on: ['ubuntu-latest'] + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma9 steps: - - run: exit 0 + + - name: Checkout code + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - name: Build on Linux + id: build-linux + if: matrix.os == 'ubuntu' + env: + CONFIG: ${{ matrix.CONFIG }} + UPLOAD_PACKAGES: ${{ matrix.UPLOAD_PACKAGES }} + DOCKER_IMAGE: ${{ matrix.DOCKER_IMAGE }} + CI: github_actions + CONDA_FORGE_DOCKER_RUN_ARGS: "${{ matrix.CONDA_FORGE_DOCKER_RUN_ARGS }}" + BINSTAR_TOKEN: ${{ secrets.BINSTAR_TOKEN }} + FEEDSTOCK_TOKEN: ${{ secrets.FEEDSTOCK_TOKEN }} + STAGING_BINSTAR_TOKEN: ${{ secrets.STAGING_BINSTAR_TOKEN }} + shell: bash + run: | + if [[ "$(uname -m)" == "x86_64" ]]; then + echo "::group::Configure binfmt_misc" + docker run --rm --privileged multiarch/qemu-user-static:register --reset --credential yes + fi + export flow_run_id="github_$GITHUB_RUN_ID" + export remote_url="https://github.com/$GITHUB_REPOSITORY" + export sha="$GITHUB_SHA" + export FEEDSTOCK_NAME="$(basename $GITHUB_REPOSITORY)" + export GIT_BRANCH="$(basename $GITHUB_REF)" + if [[ "${GITHUB_EVENT_NAME}" == "pull_request" ]]; then + export IS_PR_BUILD="True" + else + export IS_PR_BUILD="False" + fi + echo "::endgroup::" + ./.scripts/run_docker_build.sh + + - name: Build on macOS + id: build-macos + if: matrix.os == 'macos' + env: + CONFIG: ${{ matrix.CONFIG }} + UPLOAD_PACKAGES: ${{ matrix.UPLOAD_PACKAGES }} + CI: github_actions + BINSTAR_TOKEN: ${{ secrets.BINSTAR_TOKEN }} + FEEDSTOCK_TOKEN: ${{ secrets.FEEDSTOCK_TOKEN }} + STAGING_BINSTAR_TOKEN: ${{ secrets.STAGING_BINSTAR_TOKEN }} + shell: bash + run: | + export flow_run_id="github_$GITHUB_RUN_ID" + export remote_url="https://github.com/$GITHUB_REPOSITORY" + export sha="$GITHUB_SHA" + export FEEDSTOCK_NAME="$(basename $GITHUB_REPOSITORY)" + export GIT_BRANCH="$(basename $GITHUB_REF)" + if [[ "${GITHUB_EVENT_NAME}" == "pull_request" ]]; then + export IS_PR_BUILD="True" + else + export IS_PR_BUILD="False" + fi + ./.scripts/run_osx_build.sh + + - name: Build on windows + id: build-windows + if: matrix.os == 'windows' + shell: cmd + run: | + set "flow_run_id=github_%GITHUB_RUN_ID%" + set "remote_url=https://github.com/%GITHUB_REPOSITORY%" + set "sha=%GITHUB_SHA%" + call ".scripts\run_win_build.bat" + env: + # default value; make it explicit, as it needs to match with artefact + # generation below. Not configurable for now, can be revisited later + CONDA_BLD_DIR: C:\bld + MINIFORGE_HOME: ${{ contains(runner.arch, 'ARM') && 'C' || 'D' }}:\Miniforge + PYTHONUNBUFFERED: 1 + CONFIG: ${{ matrix.CONFIG }} + CI: github_actions + UPLOAD_PACKAGES: ${{ matrix.UPLOAD_PACKAGES }} + BINSTAR_TOKEN: ${{ secrets.BINSTAR_TOKEN }} + FEEDSTOCK_TOKEN: ${{ secrets.FEEDSTOCK_TOKEN }} + STAGING_BINSTAR_TOKEN: ${{ secrets.STAGING_BINSTAR_TOKEN }} \ No newline at end of file diff --git a/.scripts/build_steps.sh b/.scripts/build_steps.sh index 5215a65..b5ef46f 100755 --- a/.scripts/build_steps.sh +++ b/.scripts/build_steps.sh @@ -20,6 +20,7 @@ export PYTHONUNBUFFERED=1 export RECIPE_ROOT="${RECIPE_ROOT:-/home/conda/recipe_root}" export CI_SUPPORT="${FEEDSTOCK_ROOT}/.ci_support" export CONFIG_FILE="${CI_SUPPORT}/${CONFIG}.yaml" +export RATTLER_CACHE_DIR="${FEEDSTOCK_ROOT}/build_artifacts/pkg_cache" cat >~/.condarc </dev/null && pwd )" PROVIDER_DIR="$(basename "$THISDIR")" @@ -27,7 +29,7 @@ if [[ "${sha:-}" == "" ]]; then popd fi -docker info +${DOCKER_EXECUTABLE} info # In order for the conda-build process in the container to write to the mounted # volumes, we need to run with the same id as the host machine, which is @@ -35,6 +37,7 @@ docker info export HOST_USER_ID=$(id -u) # Check if docker-machine is being used (normally on OSX) and get the uid from # the VM + if hash docker-machine 2> /dev/null && docker-machine active > /dev/null; then export HOST_USER_ID=$(docker-machine ssh $(docker-machine active) id -u) fi @@ -76,16 +79,34 @@ if [ -z "${CI}" ]; then DOCKER_RUN_ARGS="-it ${DOCKER_RUN_ARGS}" fi -( endgroup "Configure Docker" ) 2> /dev/null +# Default volume suffix for Docker (preserve original behavior) +VOLUME_SUFFIX=",z" +# Podman-specific handling +if [ "${DOCKER_EXECUTABLE}" = "podman" ]; then + # Fix file permissions for rootless podman builds + podman unshare chown -R ${HOST_USER_ID}:${HOST_USER_ID} "${ARTIFACTS}" + podman unshare chown -R ${HOST_USER_ID}:${HOST_USER_ID} "${RECIPE_ROOT}" + + # Add SELinux label only if enforcing + if command -v getenforce &>/dev/null && [ "$(getenforce)" = "Enforcing" ]; then + VOLUME_SUFFIX=",z" + else + VOLUME_SUFFIX="" + fi +fi + +( endgroup "Configure Docker" ) 2> /dev/null ( startgroup "Start Docker" ) 2> /dev/null export UPLOAD_PACKAGES="${UPLOAD_PACKAGES:-True}" export IS_PR_BUILD="${IS_PR_BUILD:-False}" -docker pull "${DOCKER_IMAGE}" -docker run ${DOCKER_RUN_ARGS} \ - -v "${RECIPE_ROOT}":/home/conda/recipe_root:rw,z,delegated \ - -v "${FEEDSTOCK_ROOT}":/home/conda/feedstock_root:rw,z,delegated \ + +${DOCKER_EXECUTABLE} pull "${DOCKER_IMAGE}" + +${DOCKER_EXECUTABLE} run ${DOCKER_RUN_ARGS} \ + -v "${RECIPE_ROOT}":/home/conda/recipe_root:rw${VOLUME_SUFFIX},delegated \ + -v "${FEEDSTOCK_ROOT}":/home/conda/feedstock_root:rw${VOLUME_SUFFIX},delegated \ -e CONFIG \ -e HOST_USER_ID \ -e UPLOAD_PACKAGES \ diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 438c19b..03594e4 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -28,6 +28,5 @@ stages: condition: and(succeeded(), eq(dependencies.Check.outputs['Skip.result.start_main'], 'true')) dependsOn: Check jobs: - - template: ./.azure-pipelines/azure-pipelines-linux.yml - template: ./.azure-pipelines/azure-pipelines-osx.yml - template: ./.azure-pipelines/azure-pipelines-win.yml \ No newline at end of file diff --git a/build-locally.py b/build-locally.py index 825a4af..05493e4 100755 --- a/build-locally.py +++ b/build-locally.py @@ -28,13 +28,6 @@ def setup_environment(ns): os.path.dirname(__file__), "miniforge3" ) - # The default cache location might not be writable using docker on macOS. - if ns.config.startswith("linux") and platform.system() == "Darwin": - os.environ["CONDA_FORGE_DOCKER_RUN_ARGS"] = ( - os.environ.get("CONDA_FORGE_DOCKER_RUN_ARGS", "") - + " -e RATTLER_CACHE_DIR=/tmp/rattler_cache" - ) - def run_docker_build(ns): script = ".scripts/run_docker_build.sh" diff --git a/recipe/recipe.yaml b/recipe/recipe.yaml index b776602..ef3e4fe 100644 --- a/recipe/recipe.yaml +++ b/recipe/recipe.yaml @@ -4,7 +4,7 @@ context: # ensure mpi is defined (needed for conda-smithy recipe-lint) # prioritize nompi variant via build number name: amrex - version: "26.03" + version: "26.04" build: 0 mpi: ${{ mpi or "nompi" }} # is this still needed? mpi_prefix: ${{ "nompi" if mpi == "nompi" else "mpi_" + mpi }} @@ -15,7 +15,7 @@ package: source: url: https://github.com/AMReX-Codes/amrex/archive/refs/tags/${{ version }}.tar.gz - sha256: 2b48d20a81e5cc760f345c314bc76421ad7c4976a8737be20379b2d5da4c1f3c + sha256: 6774449027793ae583036150ee17d929c88cdc04fee136da8de201cbe78c4c03 build: # add build string so packages can depend on