Skip to content

Commit

Permalink
use manylinux_2_28-cross images
Browse files Browse the repository at this point in the history
  • Loading branch information
alexreinking committed Aug 27, 2024
1 parent 0b252d1 commit fcdeecd
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 21 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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 }}
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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 && \
Expand All @@ -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 \
Expand Down
24 changes: 20 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
23 changes: 12 additions & 11 deletions build-images.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit fcdeecd

Please sign in to comment.