From 543f0778292b3d598784192b1798a2e445bbba18 Mon Sep 17 00:00:00 2001 From: William Barnhart Date: Thu, 6 Oct 2022 14:09:30 -0400 Subject: [PATCH 1/6] Update support for Linux ARM on GitLab --- README.md | 2 +- examples/gitlab-with-qemu.yml | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 examples/gitlab-with-qemu.yml diff --git a/README.md b/README.md index bfb40a63d..a9335319a 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ Usage | Travis CI | ✅ | | ✅ | ✅ | | | AppVeyor | ✅ | ✅ | ✅ | | ✅² | | CircleCI | ✅ | ✅ | | | ✅² | -| Gitlab CI | ✅ | | | | | +| Gitlab CI | ✅ | | | ✅¹ | | | Cirrus CI | ✅ | ✅³ | ✅ | ✅ | ✅ | ¹ [Requires emulation](https://cibuildwheel.readthedocs.io/en/stable/faq/#emulation), distributed separately. Other services may also support Linux ARM through emulation or third-party build hosts, but these are not tested in our CI.
diff --git a/examples/gitlab-with-qemu.yml b/examples/gitlab-with-qemu.yml new file mode 100644 index 000000000..a67d491a9 --- /dev/null +++ b/examples/gitlab-with-qemu.yml @@ -0,0 +1,21 @@ +linux: + image: python:3.8 + # make a docker daemon available for cibuildwheel to use + services: + - name: docker:dind + entrypoint: ["env", "-u", "DOCKER_HOST"] + command: ["dockerd-entrypoint.sh"] + variables: + DOCKER_HOST: tcp://docker:2375/ + DOCKER_DRIVER: overlay2 + # See https://github.com/docker-library/docker/pull/166 + DOCKER_TLS_CERTDIR: "" + script: + - curl -sSL https://get.docker.com/ | sh + # Warning: This is extremely slow, be careful with how many wheels you build + - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes + - python -m pip install cibuildwheel==2.10.2 + - cibuildwheel --output-dir wheelhouse + artifacts: + paths: + - wheelhouse/ From ee6b4fdf2d52584aa19081e1a65976da98f58504 Mon Sep 17 00:00:00 2001 From: William Barnhart Date: Thu, 6 Oct 2022 18:59:01 -0400 Subject: [PATCH 2/6] Be more explicit about platform and arch --- examples/gitlab-with-qemu.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/gitlab-with-qemu.yml b/examples/gitlab-with-qemu.yml index a67d491a9..1f5b11b4c 100644 --- a/examples/gitlab-with-qemu.yml +++ b/examples/gitlab-with-qemu.yml @@ -15,7 +15,8 @@ linux: # Warning: This is extremely slow, be careful with how many wheels you build - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - python -m pip install cibuildwheel==2.10.2 - - cibuildwheel --output-dir wheelhouse + # Assuming your CI runner's default architecture is x86_64... + - cibuildwheel --output-dir wheelhouse --platform linux --archs aarch64 artifacts: paths: - wheelhouse/ From dd4314f57029deb28cdbd15d8a396ec9069859c3 Mon Sep 17 00:00:00 2001 From: William Barnhart Date: Fri, 7 Oct 2022 00:46:01 -0400 Subject: [PATCH 3/6] Update windows support on GitLab --- README.md | 2 +- examples/gitlab-minimal.yml | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a9335319a..9a4843342 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ Usage | Travis CI | ✅ | | ✅ | ✅ | | | AppVeyor | ✅ | ✅ | ✅ | | ✅² | | CircleCI | ✅ | ✅ | | | ✅² | -| Gitlab CI | ✅ | | | ✅¹ | | +| Gitlab CI | ✅ | | ✅ | ✅¹ | | | Cirrus CI | ✅ | ✅³ | ✅ | ✅ | ✅ | ¹ [Requires emulation](https://cibuildwheel.readthedocs.io/en/stable/faq/#emulation), distributed separately. Other services may also support Linux ARM through emulation or third-party build hosts, but these are not tested in our CI.
diff --git a/examples/gitlab-minimal.yml b/examples/gitlab-minimal.yml index cb1be4f98..1ebbc3524 100644 --- a/examples/gitlab-minimal.yml +++ b/examples/gitlab-minimal.yml @@ -17,3 +17,18 @@ linux: artifacts: paths: - wheelhouse/ + +windows: + before_script: + - choco install python -y --version 3.8.6 + - choco install git.install -y + - py -m pip install cibuildwheel==2.10.2 + script: + - git submodule update --init + - py -m cibuildwheel --output-dir wheelhouse --platform windows + artifacts: + paths: + - wheelhouse/ + image: mcr.microsoft.com/windows/servercore:1809 + tags: + - windows From d961fbd89aaf1c7fe7bd54119969830f13a07091 Mon Sep 17 00:00:00 2001 From: William Barnhart Date: Fri, 7 Oct 2022 00:48:01 -0400 Subject: [PATCH 4/6] remove submodule checkout --- examples/gitlab-minimal.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/gitlab-minimal.yml b/examples/gitlab-minimal.yml index 1ebbc3524..3a1ed6c68 100644 --- a/examples/gitlab-minimal.yml +++ b/examples/gitlab-minimal.yml @@ -24,7 +24,6 @@ windows: - choco install git.install -y - py -m pip install cibuildwheel==2.10.2 script: - - git submodule update --init - py -m cibuildwheel --output-dir wheelhouse --platform windows artifacts: paths: From 768f964056a71b66beedf306c9e72831c6fc8d03 Mon Sep 17 00:00:00 2001 From: William Barnhart Date: Fri, 7 Oct 2022 10:44:39 -0400 Subject: [PATCH 5/6] cleanup and add windows to .gitlab-ci.yml --- .gitlab-ci.yml | 13 +++++++++++++ examples/gitlab-minimal.yml | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5f6d0deb9..b9f711cf9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -17,3 +17,16 @@ linux: - curl -sSL https://get.docker.com/ | sh - python -m pip install -e ".[dev]" pytest-custom-exit-code - python ./bin/run_tests.py + +windows: + image: mcr.microsoft.com/windows/servercore:1809 + variables: + PYTEST_ADDOPTS: -k "unit_test or test_0_basic" --suppress-no-test-exit-code + before_script: + - choco install python -y --version 3.8.6 + script: + - py -m cibuildwheel --output-dir wheelhouse --platform windows + - py -m pip install -e ".[dev]" pytest-custom-exit-code + - py bin\run_tests.py + tags: + - windows diff --git a/examples/gitlab-minimal.yml b/examples/gitlab-minimal.yml index 3a1ed6c68..f5883f613 100644 --- a/examples/gitlab-minimal.yml +++ b/examples/gitlab-minimal.yml @@ -19,6 +19,7 @@ linux: - wheelhouse/ windows: + image: mcr.microsoft.com/windows/servercore:1809 before_script: - choco install python -y --version 3.8.6 - choco install git.install -y @@ -28,6 +29,5 @@ windows: artifacts: paths: - wheelhouse/ - image: mcr.microsoft.com/windows/servercore:1809 tags: - windows From 309fc010b9369fd747fd41149bff0ba202eb9b31 Mon Sep 17 00:00:00 2001 From: William Barnhart Date: Fri, 7 Oct 2022 11:20:11 -0400 Subject: [PATCH 6/6] add cross building for pybind on gitlab to example --- docs/data/projects.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/data/projects.yml b/docs/data/projects.yml index 5129dbb6e..e25ed35bf 100644 --- a/docs/data/projects.yml +++ b/docs/data/projects.yml @@ -204,6 +204,12 @@ ci: [github] os: [windows, apple, linux] +- name: pybind11 cross build example + gh: wbarnha/pybind_cmake_example_crossbuild + ci: [github, gitlab] + os: [windows, apple, linux] + notes: Same as pybind11 cmake_example but used to demo Linux ARM + Windows + macOS builds on GitLab + - name: iminuit gh: scikit-hep/iminuit ci: [github] @@ -599,7 +605,7 @@ gh: tensorchord/envd ci: [github] os: [apple, linux, windows] - note: A machine learning development environment build toool + note: A machine learning development environment build tool - name: mosec gh: mosecorg/mosec