diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a50049b..fa428ed 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,9 +28,14 @@ jobs: aarch64, ] version: [ - 17.0.6, - 18.1.8, + 17, + 18, ] + include: + - version-major: 17 + version: 17.0.6 + - version-major: 18 + version: 18.1.8 steps: - uses: actions/checkout@v4 @@ -51,7 +56,9 @@ jobs: with: context: . push: true - tags: ${{ env.REGISTRY }}/${{ github.repository_owner }}/manylinux2014_${{ matrix.arch }}-llvm:${{ matrix.version }} + tags: | + ${{ env.REGISTRY }}/${{ github.repository_owner }}/manylinux_2_28_${{ matrix.arch }}-llvm:${{ matrix.version }} + ${{ env.REGISTRY }}/${{ github.repository_owner }}/manylinux_2_28_${{ matrix.arch }}-llvm:${{ matrix.version-major }} build-args: | LLVM_TAG=llvmorg-${{ matrix.version }} ARCH=${{ matrix.arch }} diff --git a/Dockerfile b/Dockerfile index 1131769..b6df151 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,12 @@ ARG ARCH=x86_64 -FROM quay.io/pypa/manylinux2014_$ARCH +FROM messense/manylinux_2_28-cross:$ARCH + +LABEL org.opencontainers.image.source=https://github.com/halide/docker-images WORKDIR /ws ## Install wget -RUN yum -y install wget +#RUN yum -y install wget ## Install Ninja RUN git clone --depth 1 --branch v1.12.1 https://github.com/ninja-build/ninja.git && \ @@ -26,7 +28,8 @@ RUN wget -q https://github.com/google/flatbuffers/archive/refs/tags/v${FB_VERSIO ## Install flatbuffers ARG WABT_VERSION=1.0.36 -RUN git clone --recursive --depth 1 --branch ${WABT_VERSION} https://github.com/WebAssembly/wabt.git && \ +RUN git clone --depth 1 --branch ${WABT_VERSION} https://github.com/WebAssembly/wabt.git && \ + git -C wabt submodule update --init third_party/picosha2 && \ cmake -G Ninja -S wabt -B build \ -DCMAKE_BUILD_TYPE=Release \ -DWITH_EXCEPTIONS=ON \ diff --git a/README.md b/README.md index e682556..1837dbe 100644 --- a/README.md +++ b/README.md @@ -14,16 +14,32 @@ already, the following: 1. Create a [GitHub token] with `write:packages` permissions. 2. Store the token in an environment variable, `GITHUB_TOKEN`. - 3. Log in to the Container Registry Service via `echo $GITHUB_TOKEN | docker login ghcr.io -u USERNAME --password-stdin` - 4. Run the `./build-images.sh` script. You must specify the llvm version as + 3. Log in to the Container Registry Service via `echo $GITHUB_TOKEN | sudo docker login ghcr.io -u USERNAME --password-stdin` + 4. Run the `./build-images.sh 18.1.8` script. You must specify the llvm version as the first argument. The `reset-docker.sh` script will delete **everything** from your local Docker instance, so be warned. But it can come in handy when disk space is an issue. 5. Push the images via: - docker push ghcr.io/halide/manylinux2014_aarch64-llvm:17.0.6 - docker push ghcr.io/halide/manylinux2014_x86_64-llvm:17.0.6 + docker push ghcr.io/halide/manylinux2014_aarch64-llvm:18.1.8 + docker push ghcr.io/halide/manylinux2014_x86_64-llvm:18.1.8 See the docs for more details: https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry +## Setting up qemu + +For some reason, the directions for doing this are hard to find. Fortunately, +it's pretty easy: + +``` +$ sudo apt install qemu-user-static +$ sudo docker run --rm --privileged multiarch/qemu-user-static --reset -p yes +... +$ sudo docker buildx ls +... +``` + +The last command should print a long list of cross-platforms, +including `linux/arm64`. + [GitHub token]: https://github.com/settings/tokens/new diff --git a/build-images.sh b/build-images.sh index b8c73c1..c4604e1 100755 --- a/build-images.sh +++ b/build-images.sh @@ -1,19 +1,20 @@ #!/bin/bash -set -ex +set -eo pipefail [[ "$1" == "" ]] && echo "You must specify the LLVM version as an argument, e.g. 17.0.6" && exit LLVM_TAG=$1 -build_image() { - ARCH="$1" - docker build \ - --tag "ghcr.io/halide/manylinux2014_$ARCH-llvm:$LLVM_TAG" \ - --build-arg "LLVM_TAG=llvmorg-$LLVM_TAG" \ - --build-arg "ARCH=$ARCH" \ - . -} +docker build \ + --tag "ghcr.io/halide/manylinux_2_28_aarch64-llvm:$LLVM_TAG" \ + --build-arg "LLVM_TAG=llvmorg-$LLVM_TAG" \ + --build-arg "ARCH=aarch64" \ + . + +docker build \ + --tag "ghcr.io/halide/manylinux_2_28_x86_64-llvm:$LLVM_TAG" \ + --build-arg "LLVM_TAG=llvmorg-$LLVM_TAG" \ + --build-arg "ARCH=x86_64" \ + . -#build_image aarch64 -build_image x86_64