ANTsX / ANTsPy

A fast medical imaging analysis library in Python with algorithms for registration, segmentation, and more.
https://antspyx.readthedocs.io
Apache License 2.0
608 stars 161 forks source link

Refactor CI for PyPI #527

Open ravnoor opened 6 months ago

ravnoor commented 6 months ago

Wheels are built and pushed to PyPI successfully for all OSs and architectures: 1, 2. As before, we're utilizing 2 build systems: Cirrus CI (macos_arm64 and linux_aarch64) and GHA (macos_x86_64, linux_x86_64, and win_amd64). While GHA supports building natively on Apple Silicon via macos-latest-xlarge runner, this feature is limited to Teams/Enterprise accounts AFAIK. Besides, Cirrus CI provides substantially lower free credits relative to GHA, so there will be instances where the CI/CD for arm64 will fail to execute due to insufficient credits. Therefore, as a stopgap, I've also provisioned a self-hosted macOS VM based on Cirrus's Tart virtualization that can run on Apple Silicon via wheels-macosx_arm64.yml. For this last bit to work, a self-hosted runner needs to be initialized via GitHub while I donate CPU time on my M1 MacBook Air as and if the need arises.

Pushing to PyPI is confirmed working using multiple build systems, so if the secrets.PYPI_API_TOKEN repository secret is configured it should be seamless. For Cirrus CI, once access to ANTsX/ANTsPy has been granted at https://cirrus-ci.com/, the runner should automatically read the config from .cirrus.yml.

In terms of PyPI storage, I believe we're at the max 10GB for the project, so upgrade requests should be in order to support another version or two.

On a related note, if there's interest, I can test pushing the multi-arch image (amd64/ arm64) directly to Docker Hub - build works already through Cirrus CI. The current workflow (ci-docker.yml) only supports amd64. An access token or access delegation would be needed to accomplish that.

Cheers!