-
Notifications
You must be signed in to change notification settings - Fork 242
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
ci+cd.feat(wheel & pypi): improve and simplify the process and support more platforms #489
Changes from all commits
1d33214
2e4ea5f
86b9ed6
3012648
aa91b68
f9fa315
bbe01da
d5c2c2b
472144b
67a4485
1e3a298
d65dd85
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -8,6 +8,8 @@ on: | |||||
pull_request: | ||||||
schedule: | ||||||
- cron: '17 3 * * 0' | ||||||
release: | ||||||
types: [created] | ||||||
|
||||||
jobs: | ||||||
flake8: | ||||||
|
@@ -127,40 +129,30 @@ jobs: | |||||
|
||||||
wheels: | ||||||
name: Build and upload wheels | ||||||
runs-on: ubuntu-latest | ||||||
strategy: | ||||||
matrix: | ||||||
DOCKER_IMAGE: | ||||||
- quay.io/pypa/manylinux2014_x86_64 | ||||||
# Disable i686 builds for now: no binary wheels for cryptography, | ||||||
# source build fails, e.g. https://github.com/inducer/pyopencl/pull/421/checks?check_run_id=1781071632 | ||||||
# - quay.io/pypa/manylinux2014_i686 | ||||||
os: [ubuntu-latest] | ||||||
runs-on: ${{ matrix.os }} | ||||||
steps: | ||||||
- uses: actions/checkout@v2 | ||||||
- name: "Main Script" | ||||||
- name: "build wheel" | ||||||
env: | ||||||
TWINE_USERNAME: __token__ | ||||||
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} | ||||||
DOCKER_IMAGE: ${{ matrix.DOCKER_IMAGE }} | ||||||
|
||||||
CIBW_PROJECT_REQUIRES_PYTHON: "~=3.6" | ||||||
CIBW_SKIP: "pp36-*" # The docker image using doesn't support pp36 | ||||||
CIBW_BEFORE_BUILD: "./scripts/prepare-build-wheels.sh" | ||||||
CIBW_REPAIR_WHEEL_COMMAND: "auditwheel repair {wheel} -w {dest_dir} --lib-sdir=/.libs && python ./scripts/fix-wheel.py {wheel} ~/deps/ocl-icd/COPYING" | ||||||
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.
Suggested change
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. Customized repair command might not be needed at all after merging with latest master. |
||||||
CIBW_MANYLINUX_X86_64_IMAGE: "manylinux2014" | ||||||
CIBW_MANYLINUX_PYPY_X86_64_IMAGE: "quay.io/pypa/manylinux2014_x86_64" | ||||||
CIBW_ARCHS: "auto64" # 32bit unsupported for now | ||||||
run: | | ||||||
pwd | ||||||
ls -la | ||||||
|
||||||
# Only perform upload for tag builds, otherwise unset TWINE_USERNAME to prevent | ||||||
if ! [[ $GITHUB_REF == refs/tags* ]]; then | ||||||
echo "Not a tag build, GITHUB_REF is '$GITHUB_REF'. Unsetting TWINE_USERNAME" | ||||||
unset TWINE_USERNAME | ||||||
fi | ||||||
|
||||||
if [[ $DOCKER_IMAGE == *i686* ]]; then | ||||||
PRE_CMD=linux32 | ||||||
else | ||||||
PRE_CMD="" | ||||||
fi | ||||||
|
||||||
docker run --rm -v `pwd`:/io -e TWINE_USERNAME -e TWINE_PASSWORD $DOCKER_IMAGE $PRE_CMD /io/scripts/build-wheels.sh | ||||||
ls wheelhouse/ | ||||||
pipx run --spec='cibuildwheel==1.11.1.post1' cibuildwheel --output-dir dist | ||||||
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. change to use action https://cibuildwheel.readthedocs.io/en/stable/setup/ 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. Whether to use the action I think is a matter of preference and the owner's settings. As suggested in the OP, I let the maintainers to decide. |
||||||
ls -l ./dist/ | ||||||
- name: "upload wheel" | ||||||
uses: pypa/[email protected] | ||||||
if: github.event_name == 'release' && github.event.action == 'created' | ||||||
with: | ||||||
user: __token__ | ||||||
password: ${{ secrets.TWINE_PASSWORD }} | ||||||
|
||||||
downstream_tests: | ||||||
strategy: | ||||||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/bin/bash | ||
set -e -x -o pipefail | ||
|
||
if [[ ! -d ~/deps ]]; then | ||
|
||
# dependencies need to be setup | ||
|
||
mkdir -p ~/deps | ||
pushd ~/deps | ||
|
||
curl https://tiker.net/tmp/.tmux.conf | ||
yum install -y git yum openssl-devel ruby | ||
|
||
git clone --branch v2.3.0 https://github.com/OCL-dev/ocl-icd | ||
cd ocl-icd | ||
curl -L -O https://raw.githubusercontent.com/conda-forge/ocl-icd-feedstock/e2c03e3ddb1ff86630ccf80dc7b87a81640025ea/recipe/install-headers.patch | ||
git apply install-headers.patch | ||
curl -L -O https://github.com/isuruf/ocl-icd/commit/3862386b51930f95d9ad1089f7157a98165d5a6b.patch | ||
git apply 3862386b51930f95d9ad1089f7157a98165d5a6b.patch | ||
autoreconf -i | ||
chmod +x configure | ||
./configure --prefix=/usr | ||
make -j$(nproc) | ||
make install | ||
|
||
popd | ||
yxliang01 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
fi | ||
|
||
# Compile wheels | ||
PYTHON_VERSION=$(python -c 'import platform; print(platform.python_version())') | ||
NUMPY_VERSION_SPEC='==' | ||
if [[ "${PYTHON_VERSION}" == '3.6'* ]]; then | ||
NUMPY_VERSION_SPEC="${NUMPY_VERSION_SPEC}1.11.3" | ||
elif [[ "${PYTHON_VERSION}" == '3.7'* ]]; then | ||
NUMPY_VERSION_SPEC="${NUMPY_VERSION_SPEC}1.14.5" | ||
elif [[ "${PYTHON_VERSION}" == '3.8'* ]]; then | ||
NUMPY_VERSION_SPEC="${NUMPY_VERSION_SPEC}1.17.3" | ||
elif [[ "${PYTHON_VERSION}" == '3.9'* ]]; then | ||
NUMPY_VERSION_SPEC="${NUMPY_VERSION_SPEC}1.19.5" | ||
else | ||
# Unknown python version, let it unpinned instead | ||
NUMPY_VERSION_SPEC='' | ||
fi | ||
yxliang01 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# TODO: declear dependencies except numpy as build-time dependency as per PEP518 | ||
# Build with the oldest numpy available to be compatible with newer ones | ||
pip install "numpy${NUMPY_VERSION_SPEC}" pybind11 mako | ||
|
||
# For bundling license files | ||
pip install delocate |
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.
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.
There are certain python dependencies installed in the script, so this might not work until the system-wide setup is separated.