-
Notifications
You must be signed in to change notification settings - Fork 239
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
Support for easier parallel builds for different architectures #416
Comments
There are multiple options. runs-on: ${{ matrix.os }}
strategy:
matrix:
architecture: [x64, x86]
os: [ubuntu-latest, macos-latest, windows-latest]
exclude:
- architecture: x86
os: macos-latest
include:
- architecture: x86
CIBW_SKIP: "*64"
- architecture: x64
CIBW_SKIP: "*win32 *i686"
|
Unfortunately this does not work because it seems you can't conditionally define environment variables (so that their values are different than values in matrix, but they still conditionally depend on values in matrix) in easy way (you could do this with another build/job step but that can be too much work). I came out with this which enables you to define different environment variable values for different matrix jobs: name: Python bindings
on: [push, pull_request]
env:
CIBW_SKIP: cp27-* pp*
jobs:
build:
name: Building and testing on ${{ matrix.config.os }} ${{ matrix.config.architecture }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {os: ubuntu-latest, architecture: "*x86_64" }
- {os: ubuntu-latest, architecture: "*i686" }
- {os: windows-latest, architecture: "*amd64" }
- {os: windows-latest, architecture: "*win32" }
- {os: macos-latest, architecture: "*x86_64" }
env:
CIBW_BUILD: ${{ matrix.config.architecture }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python_version }}
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install cibuildwheel
run: python -m pip install cibuildwheel
- name: Build and test wheels
run: python -m cibuildwheel
- name: Upload artifacts to storage
if: success() || failure()
uses: actions/upload-artifact@v2
with:
path: ./wheelhouse/*.whl It seems to work, although it may not be the best or easiest solution. |
That looks good to me @filips123. What kind of concurrency limits do Github apply in this scenario? Is there a limit to the number of active jobs? |
I'm a little hesitant to add yet another way of selecting/unselecting builds. How are all these going to interact? |
20 concurrent jobs for whole account for free plan, 40 for pro plan, with maximum of 5 concurrent macOS jobs. See this for more details.
Yes, I agree. I seems that my solution with manually specifying existing platform tags works, and it isn't that much work. Other CI services also probably support similar ways of specifying jobs. Maybe it would be just nice to have some examples or documentation about this. |
Silly idea, maybe, probably. But how hard is it to create a GitHub action? If it's possible to somehow put the responsibility of splitting up the cibuildwheel job into a GitHub action (e.g., automatically setting |
Does #469 help here? |
I think #482 and the followup #535, combined with the current actions support, likely covers this pretty well. We could add an "arch" setting to the action, and allow Oh, actually, what if we allow activate QUEMU on the action if this is passed, though? That would be useful! Though maybe tricky, we can't call actions from actions. I think there are examples. I'll check. |
Currently, the only parallel thing that happens is building for different operating systems. However, all builds in that specific OS will still be sequential which means bigger projects will take very long time to compile. However, most CI systems support parallel builds. If you buld wheels for 32-bit and 64-bit in parallel, you will get much faster builds.
You can already do this if you use
CIBW_BUILD
and separatly define once 32-bit and once 64-bit builds for each system (except macOS which only has 64-bit). However, problem is that Windows and Linux use different architecture tags: Windows usesamd64
andwin32
, while (many)Linux usesx86_64
andi686
(and other architectures as well). This means it is harder to define them in "compact" and easy way.For example, if architecture tags would be the same, you could use something like this (in GitHub Actions):
But if it is not, you will have to manually define more jobs with separate matrices for separate tags.
Maybe there is also some better way, but it would be nice if this is also specified in documentation and examples.
The text was updated successfully, but these errors were encountered: