Skip to content

Commit

Permalink
Merge pull request #1660 from mayeut/gha-qemu
Browse files Browse the repository at this point in the history
feat: use GHA to build s390x/ppc64le images
  • Loading branch information
mayeut authored Aug 3, 2024
2 parents c36dbab + 6b65780 commit 32dfa47
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 20 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,15 @@ jobs:
strategy:
fail-fast: false
matrix:
policy: ["manylinux2014", "musllinux_1_1", "musllinux_1_2"]
platform: ["i686", "x86_64"]
policy: ["manylinux2014", "manylinux_2_28", "musllinux_1_1", "musllinux_1_2"]
platform: ["x86_64", "s390x", "ppc64le"]
include:
- policy: "manylinux_2_28"
platform: "x86_64"
- policy: "manylinux2014"
platform: "i686"
- policy: "musllinux_1_1"
platform: "i686"
- policy: "musllinux_1_2"
platform: "i686"

env:
POLICY: ${{ matrix.policy }}
Expand Down
32 changes: 16 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,34 +26,34 @@ jobs:
virt: vm
group: edge
env: POLICY="manylinux2014" PLATFORM="aarch64"
- arch: s390x
env: POLICY="manylinux2014" PLATFORM="s390x"
- arch: ppc64le
env: POLICY="manylinux2014" PLATFORM="ppc64le"
#- arch: s390x
# env: POLICY="manylinux2014" PLATFORM="s390x"
#- arch: ppc64le
# env: POLICY="manylinux2014" PLATFORM="ppc64le"
- arch: arm64-graviton2
virt: vm
group: edge
env: POLICY="manylinux_2_28" PLATFORM="aarch64"
- arch: s390x
env: POLICY="manylinux_2_28" PLATFORM="s390x"
- arch: ppc64le
env: POLICY="manylinux_2_28" PLATFORM="ppc64le"
#- arch: s390x
# env: POLICY="manylinux_2_28" PLATFORM="s390x"
#- arch: ppc64le
# env: POLICY="manylinux_2_28" PLATFORM="ppc64le"
- arch: arm64-graviton2
virt: vm
group: edge
env: POLICY="musllinux_1_1" PLATFORM="aarch64"
- arch: s390x
env: POLICY="musllinux_1_1" PLATFORM="s390x"
- arch: ppc64le
env: POLICY="musllinux_1_1" PLATFORM="ppc64le"
#- arch: s390x
# env: POLICY="musllinux_1_1" PLATFORM="s390x"
#- arch: ppc64le
# env: POLICY="musllinux_1_1" PLATFORM="ppc64le"
- arch: arm64-graviton2
virt: vm
group: edge
env: POLICY="musllinux_1_2" PLATFORM="aarch64"
- arch: s390x
env: POLICY="musllinux_1_2" PLATFORM="s390x"
- arch: ppc64le
env: POLICY="musllinux_1_2" PLATFORM="ppc64le"
#- arch: s390x
# env: POLICY="musllinux_1_2" PLATFORM="s390x"
#- arch: ppc64le
# env: POLICY="musllinux_1_2" PLATFORM="ppc64le"

before_install:
- if [ -d "${HOME}/buildx-cache/.buildx-cache-${POLICY}_${PLATFORM}" ]; then cp -rlf ${HOME}/buildx-cache/.buildx-cache-${POLICY}_${PLATFORM} ./; fi
Expand Down
6 changes: 6 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,19 @@ export PLATFORM

# get docker default multiarch image prefix for PLATFORM
if [ "${PLATFORM}" == "x86_64" ]; then
GOARCH="amd64"
MULTIARCH_PREFIX="amd64/"
elif [ "${PLATFORM}" == "i686" ]; then
GOARCH="386"
MULTIARCH_PREFIX="i386/"
elif [ "${PLATFORM}" == "aarch64" ]; then
GOARCH="arm64"
MULTIARCH_PREFIX="arm64v8/"
elif [ "${PLATFORM}" == "ppc64le" ]; then
GOARCH="ppc64le"
MULTIARCH_PREFIX="ppc64le/"
elif [ "${PLATFORM}" == "s390x" ]; then
GOARCH="s390x"
MULTIARCH_PREFIX="s390x/"
else
echo "Unsupported platform: '${PLATFORM}'"
Expand Down Expand Up @@ -66,6 +71,7 @@ export PREPEND_PATH
export LD_LIBRARY_PATH_ARG

BUILD_ARGS_COMMON="
--platform=linux/${GOARCH}
--build-arg POLICY --build-arg PLATFORM --build-arg BASEIMAGE
--build-arg DEVTOOLSET_ROOTPATH --build-arg PREPEND_PATH --build-arg LD_LIBRARY_PATH_ARG
--rm -t quay.io/pypa/${POLICY}_${PLATFORM}:${COMMIT_SHA}
Expand Down

0 comments on commit 32dfa47

Please sign in to comment.