Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support for osx-arm64 builds #46775

Merged
merged 53 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
9f1e998
example recipe for osx-arm64
aliciaaevans Mar 20, 2024
d99ac26
test arm builds on macOS-14
aliciaaevans Mar 20, 2024
0f256cc
add arch flag
aliciaaevans Mar 25, 2024
c9c2f70
try setting a higher sdk version
aliciaaevans Mar 26, 2024
6860ca9
check sdk versions
aliciaaevans Mar 26, 2024
c0d311b
set sdk earlier
aliciaaevans Mar 26, 2024
6f341bc
move logging
aliciaaevans Mar 26, 2024
c9b46b5
set deployment target
aliciaaevans Mar 26, 2024
636bb8b
move var setting
aliciaaevans Mar 26, 2024
eeac233
how old can we go?
aliciaaevans Mar 26, 2024
1d7c601
try 11.0 sdk
aliciaaevans Mar 26, 2024
8df4439
trigger on PR
aliciaaevans Mar 26, 2024
c1c8812
Apply suggestions from code review
aliciaaevans Mar 27, 2024
d982386
zip a level up to match other ci
aliciaaevans Mar 27, 2024
b6f8ebf
must include noarch
aliciaaevans Mar 29, 2024
ec3d5a2
remove sdk workaround
aliciaaevans Apr 1, 2024
a624f82
log deployment target
aliciaaevans Apr 1, 2024
dc4525c
use master cache
aliciaaevans Apr 1, 2024
aa72299
case for job name
aliciaaevans Apr 2, 2024
6f6fb5d
initial merge wf (set up for testing)
aliciaaevans Apr 2, 2024
93f21d0
updates from testing
aliciaaevans Apr 4, 2024
b64a616
source common.sh instead of directly setting env vars
aliciaaevans Jul 1, 2024
65d07cc
enable osx-arm64 on CircleCI
aliciaaevans Jul 1, 2024
2f29bab
xcode version (match github actions)
aliciaaevans Jul 1, 2024
bbae926
debugging
aliciaaevans Jul 1, 2024
9fbffa1
no docker for osx
aliciaaevans Jul 1, 2024
7e5f85c
match bulk setup
aliciaaevans Jul 1, 2024
32a7032
comment out run_conda_forge_build_setup
aliciaaevans Jul 1, 2024
fbd98a1
Little more generic test
aliciaaevans Jul 1, 2024
674ade5
longer build test
aliciaaevans Jul 1, 2024
cd6df20
clean up
aliciaaevans Jul 1, 2024
dda42dc
remove setup
aliciaaevans Jul 1, 2024
8ed90a0
simplify and add osx-arm64
aliciaaevans Jul 1, 2024
62e8f45
revert
aliciaaevans Jul 1, 2024
4742b8d
try to match other CI
aliciaaevans Jul 2, 2024
c51ea55
standardize CI configurations for additional platforms
aliciaaevans Jul 5, 2024
188e89d
fix scripts path
aliciaaevans Jul 5, 2024
feda25f
fix check
aliciaaevans Jul 5, 2024
09cbbc9
test skip
aliciaaevans Jul 5, 2024
57fb5c4
reenable test packages
aliciaaevans Jul 5, 2024
a3cee7e
add osx-arm64 to bulk
aliciaaevans Jul 5, 2024
e794400
test with user friendly name
aliciaaevans Jul 5, 2024
ef3150d
move arm jobs to existing GHA config
aliciaaevans Jul 5, 2024
16fbbf3
test run_conda_forge_build_setup
aliciaaevans Jul 9, 2024
86cb5c7
test run_conda_forge_build_setup on GitHub Actions
aliciaaevans Jul 9, 2024
88afef6
debug sdk location
aliciaaevans Jul 9, 2024
8ad3623
try permissions
aliciaaevans Jul 9, 2024
dcd97dc
run_conda_forge_build_setup is working on GHA
aliciaaevans Jul 9, 2024
b2320e0
clean up
aliciaaevans Jul 9, 2024
0c559ad
Try newer xcode version
aliciaaevans Jul 10, 2024
06eb067
try x flag to see how noisy it is
aliciaaevans Jul 10, 2024
61866d8
bump builds
aliciaaevans Jul 10, 2024
e915615
Apply suggestions from code review
aliciaaevans Jul 10, 2024
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
88 changes: 63 additions & 25 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
version: 2.1

executors:
# osx-arm64:
# macos:
# xcode: 14.2.0 # indicate your selected version of Xcode
# resource_class: macos.m1.large.gen1
osx-arm64:
macos:
xcode: 15.4.0
resource_class: macos.m1.medium.gen1
linux-aarch64:
machine:
image: ubuntu-2204:current
Expand All @@ -22,7 +22,13 @@ jobs: # a basic unit of work in a run

- run:
name: Check for Additional Platforms
command: ./.circleci/check-for-additional-platforms.sh "origin/master...HEAD" "build_and_test"
command: |
result=$(./scripts/check-for-additional-platforms.sh "origin/master...HEAD" "build_and_test" "${CIRCLE_JOB}")
if [[ ${result} != "build" ]]
then
echo "No recipes using this platform, skipping rest of job."
circleci-agent step halt
fi

- run:
name: Fetch bioconda install script
Expand All @@ -47,14 +53,29 @@ jobs: # a basic unit of work in a run
- run:
name: Build and test
command: |
. common.sh
source /opt/mambaforge/etc/profile.d/conda.sh
source /opt/mambaforge/etc/profile.d/mamba.sh
mamba activate bioconda
bioconda-utils build recipes config.yml \
--lint --docker --mulled-test \
--docker-base-image "quay.io/bioconda/bioconda-utils-build-env-cos7-$(arch):${BIOCONDA_UTILS_TAG#v}" \
--git-range origin/master HEAD
set -xe
eval "$(conda shell.bash hook)"
conda activate bioconda
source common.sh

# Sets up OSX SDK
if [[ $(uname) = "Darwin" ]]; then
if [[ "${OSX_SDK_DIR:-}" == "" ]]; then
OSX_SDK_DIR="$(xcode-select -p)/Platforms/MacOSX.platform/Developer/SDKs"
fi
sudo chmod o+rwx ${OSX_SDK_DIR}
run_conda_forge_build_setup
fi

if command -V docker >/dev/null; then
bioconda-utils build recipes config.yml \
--lint --docker --mulled-test \
--docker-base-image "quay.io/bioconda/bioconda-utils-build-env-cos7-$(arch):${BIOCONDA_UTILS_TAG#v}" \
--git-range origin/master HEAD
else
bioconda-utils build recipes config.yml \
--lint --git-range origin/master HEAD
fi

- run:
name: Prepare artifacts
Expand All @@ -63,7 +84,7 @@ jobs: # a basic unit of work in a run
mkdir -p /tmp/artifacts/packages
cd /opt/mambaforge/envs/bioconda/conda-bld || exit 0
find -name .cache | xargs rm -rf || true
for n in index.html channeldata.json linux-aarch64 linux-64 osx-64 noarch; do
for n in index.html channeldata.json linux-aarch64 linux-64 osx-64 osx-arm64 noarch; do
cp -rv $n /tmp/artifacts/packages || true
done
if command -V docker >/dev/null; then
Expand Down Expand Up @@ -93,7 +114,13 @@ jobs: # a basic unit of work in a run

- run:
name: Check for Additional Platforms
command: ./.circleci/check-for-additional-platforms.sh "${CIRCLE_SHA1}~1 ${CIRCLE_SHA1}" "build_and_upload"
command: |
result=$(./scripts/check-for-additional-platforms.sh "${CIRCLE_SHA1}~1 ${CIRCLE_SHA1}" "build_and_upload" "${CIRCLE_JOB}")
if [[ ${result} != "build" ]]
then
echo "No recipes using this platform, skipping rest of job."
circleci-agent step halt
fi

- run:
name: Fetch bioconda install script
Expand All @@ -118,9 +145,20 @@ jobs: # a basic unit of work in a run
- run:
name: Build and push
command: |
source /opt/mambaforge/etc/profile.d/conda.sh
source /opt/mambaforge/etc/profile.d/mamba.sh
mamba activate bioconda
set -xe
eval "$(conda shell.bash hook)"
conda activate bioconda
source common.sh

# Sets up OSX SDK
if [[ $(uname) = "Darwin" ]]; then
if [[ "${OSX_SDK_DIR:-}" == "" ]]; then
OSX_SDK_DIR="$(xcode-select -p)/Platforms/MacOSX.platform/Developer/SDKs"
fi
sudo chmod o+rwx ${OSX_SDK_DIR}
run_conda_forge_build_setup
fi

bioconda-utils handle-merged-pr recipes config.yml \
--repo bioconda/bioconda-recipes \
--git-range ${CIRCLE_SHA1}~1 ${CIRCLE_SHA1} \
Expand Down Expand Up @@ -184,10 +222,10 @@ jobs: # a basic unit of work in a run
name: Build and upload
command: |
set -e
. common.sh
source /opt/mambaforge/etc/profile.d/conda.sh
source /opt/mambaforge/etc/profile.d/mamba.sh
mamba activate bioconda
eval "$(conda shell.bash hook)"
conda activate bioconda
source common.sh

echo '============'
conda info --all
conda config --show-sources
Expand All @@ -214,7 +252,7 @@ workflows:
matrix:
parameters:
os:
#- osx-arm64
- osx-arm64
- linux-aarch64

build and upload (ARM):
Expand All @@ -226,7 +264,7 @@ workflows:
matrix:
parameters:
os:
#- osx-arm64
- osx-arm64
- linux-aarch64


Expand All @@ -239,6 +277,6 @@ workflows:
matrix:
parameters:
os:
#- osx-arm64
# - osx-arm64 Bulk is on GitHub Actions
- linux-aarch64
runner: [0, 1, 2, 3, 4, 5]
64 changes: 63 additions & 1 deletion .github/workflows/Bulk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
conda clean -y --all

build-osx:
name: Bulk OSX Builds
name: Bulk OSX-64 Builds
if: "contains(github.event.head_commit.message, '[ci run]')"
runs-on: macos-13
strategy:
Expand Down Expand Up @@ -121,3 +121,65 @@ jobs:
--lint --anaconda-upload --record-build-failures --skiplist-leafs \
--exclude bioconda-repodata-patches
conda clean -y --all

build-osx-arm:
name: Bulk OSX-ARM64 Builds
if: "contains(github.event.head_commit.message, '[ci run]')"
runs-on: macOS-14 # M1
strategy:
fail-fast: false
max-parallel: 4
matrix:
runner: [0, 1, 2, 3]
steps:
- uses: actions/checkout@v4
with:
# checkout as BiocondaBot in order to have the permission to push fail logs
token: ${{secrets.BIOCONDA_BOT_REPO_TOKEN}}

- name: set git user
run: |
git config user.name BiocondaBot
git config user.email [email protected]

- name: set path
run: echo "/opt/mambaforge/bin" >> $GITHUB_PATH

- name: Fetch conda install script
run: |
wget https://raw.githubusercontent.com/bioconda/bioconda-common/bulk/{common,install-and-set-up-conda,configure-conda}.sh

- name: Set up bioconda-utils
run: bash install-and-set-up-conda.sh

- name: Configure conda
run: bash configure-conda.sh

- name: Build and upload
env:
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
INVOLUCRO_AUTH: ${{ secrets.INVOLUCRO_AUTH }}
QUAY_OAUTH_TOKEN: ${{ secrets.QUAY_OAUTH_TOKEN }}
# Mimic circleci
OSTYPE: "darwin"
CI: "true"
run: |
set -xe
eval "$(conda shell.bash hook)"
conda activate bioconda

source common.sh
# Sets up OSX SDK
run_conda_forge_build_setup

echo '============'
conda info --all
conda config --show-sources
conda activate bioconda
python -c 'import bioconda_utils.utils as u ; import pathlib as p ; print(*(f"{f}:\n{p.Path(f).read_text()}" for f in u.load_conda_build_config().exclusive_config_files), sep="\n")'
echo '============'
bioconda-utils build recipes config.yml \
--worker-offset ${{ matrix.runner }} --n-workers 4 \
--lint --anaconda-upload --record-build-failures --skiplist-leafs \
--exclude bioconda-repodata-patches
conda clean -y --all
Loading