-
-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[WIP] CI Build wheels for arm64 on circleci. #20711
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
Changes from all commits
dec4b67
5137014
4c030e0
8ee5826
1e69d03
a8d2caa
cedadc1
303b4c4
39925a1
4260426
078f273
9216184
6d4ee5c
7cc4fd7
94a8c3c
c58c685
239fbf1
0497b50
827dc4e
8ebde47
fd2c531
b39bf63
6c9fc0b
1b2ca79
bc0174e
eec5805
bcc8906
23a97c3
8eda6ba
808ff72
0d42150
5070a2a
c49f39d
ac67f6b
1a89340
4f63c11
2da7ae1
f1a0933
1e5a058
078fb19
09df028
92c07da
1bc8ab7
a5169db
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
set -x | ||
|
||
sudo apt-get update | ||
sudo apt-get install -y wget | ||
|
||
# Install Python 3.8 with conda from miniforge because this is | ||
# the simplest way to get a working anaconda-client for the wheel | ||
# upload step to the staging area on the anaconda.org service. | ||
export CONDA=$HOME/mambaforge | ||
wget https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-$(uname)-$(uname -m).sh | ||
bash Mambaforge-$(uname)-$(uname -m).sh -b -f -p $CONDA | ||
echo 'export CONDA=$CONDA' >> $BASH_ENV # to be reused in a later step | ||
export PATH=$CONDA/bin:$PATH | ||
mamba update --yes conda | ||
pip install --upgrade pip | ||
for pyversion in 37 38 39; do | ||
pywheel=`echo "cp"$pyversion"-manylinux_aarch64"` | ||
export CIBW_BUILD=$pywheel | ||
cmarmo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
python -m pip install cibuildwheel | ||
python -m cibuildwheel --output-dir wheelhouse | ||
done |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,14 @@ | |
set -e | ||
set -x | ||
|
||
# Install Python 3.8 because of a bug with Python 3.9 | ||
export PATH=$CONDA/bin:$PATH | ||
conda create -n upload -y python=3.8 | ||
source activate upload | ||
conda install -y anaconda-client | ||
which anaconda | ||
|
||
# TODO: how to detect nightly builds for ARM on Circle CI? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we can use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was thinking on something like this. We might want to design a uniform strategy that would work for any CI. Let's keep the nightly build config for a follow-up PR. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1. |
||
if [ "$GITHUB_EVENT_NAME" == "schedule" ]; then | ||
ANACONDA_ORG="scipy-wheels-nightly" | ||
ANACONDA_TOKEN="$SCIKIT_LEARN_NIGHTLY_UPLOAD_TOKEN" | ||
|
@@ -11,12 +19,10 @@ else | |
ANACONDA_TOKEN="$SCIKIT_LEARN_STAGING_UPLOAD_TOKEN" | ||
fi | ||
|
||
# Install Python 3.8 because of a bug with Python 3.9 | ||
export PATH=$CONDA/bin:$PATH | ||
conda create -n upload -y python=3.8 | ||
source activate upload | ||
conda install -y anaconda-client | ||
|
||
# Force a replacement if the remote file already exists | ||
anaconda -t $ANACONDA_TOKEN upload --force -u $ANACONDA_ORG dist/artifact/* | ||
echo "Index: https://pypi.anaconda.org/$ANACONDA_ORG/simple" | ||
if [ "$ANACONDA_TOKEN" == "" ]; then | ||
echo "No upload token defined to upload to anaconda.org/$ANACONDA_ORG: skipping." | ||
else | ||
# Force a replacement if the remote file already exists | ||
anaconda -t $ANACONDA_TOKEN upload --force -u $ANACONDA_ORG dist/artifact/* | ||
echo "Index: https://pypi.anaconda.org/$ANACONDA_ORG/simple" | ||
fi |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am afraid that building the ARM wheels sequentially will slow down the release process. Actually, for 3 python, circle ci seems to be able to complete in 25m which is not too bad. Maybe this is because of ccache?
Still we might want to have one CI job per Python version and leverage Circle CI parallelism https://circleci.com/docs/2.0/parallelism-faster-jobs/. Although one would have to check how many concurrent workers are offered by default in the free Circle Ci account.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I am confused when reading the logs of the cibuildwheel: it seems that it's always using Python3.8 to build all the 3 wheel versions. This means that we will build 3.7 wheels against the Python 3.8 ABI.
I think we need to make sure that each Python version is run in its own circleci job config within an image with the matching Python version: https://circleci.com/docs/2.0/circleci-images/#python (3.7, 3.8 and 3.9).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, according to https://circleci.com/pricing/ I don't think we can benefit from parallelism. So no need to try to get this to work.
However we still need to split the for loop into independent jobs to make sure we use the right Python version for each generated wheel.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand correctly those customized python images are not available for arm (see the available images for arm documentation), this means to reinstall a conda environment for each wheel on the host image
ubuntu-2004:202101-01
.I am confused too then... :) ... I was thinking that the
CIBW_BUILD
variable was requesting a specific python version in themanylinux
image... eg this line shows that python 3.9 is called ... but it is not clear to me if it is during the build of the wheel... perhaps I should also add a bit of verbosity during the WIP state.Anyway, I understand your concern, let me create the conda envs then.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes you are right! For some reason I thought cibuildwheel used docker only for the repair step but it's indeed actually also used for the build step: https://github.com/pypa/cibuildwheel/blob/144733dc60fe0c9c3114e7ef2e4996ad919fec5c/cibuildwheel/linux.py#L186
Too bad that the
which python
command does not print its output in the log, that would have lifted the ambiguity.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have configured
CIBW_BUILD_VERBOSITY: 1
as for the other wheels. Hope this will help.