Skip to content

Commit

Permalink
update docker images
Browse files Browse the repository at this point in the history
  • Loading branch information
alexreinking committed Aug 27, 2024
1 parent c487e17 commit 0b252d1
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 28 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,29 @@ jobs:
matrix:
arch: [
x86_64,
aarch64
aarch64,
]
version: [
17.0.6,
18.1.8,
]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3.0.0
uses: docker/login-action@v3.3.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
uses: docker/setup-qemu-action@v3.2.0
with:
platforms: "arm64"

- name: Build and push image
uses: docker/build-push-action@v5.1.0
uses: docker/build-push-action@v6.7.0
with:
context: .
push: true
Expand Down
59 changes: 40 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,50 @@ FROM quay.io/pypa/manylinux2014_$ARCH

WORKDIR /ws

## Install wget
RUN yum -y install wget

## Install Ninja
RUN \
git clone --depth 1 --branch v1.11.1 https://github.com/ninja-build/ninja.git && \
cmake -S ninja -B build -DCMAKE_BUILD_TYPE=Release && \
RUN git clone --depth 1 --branch v1.12.1 https://github.com/ninja-build/ninja.git && \
cmake -S ninja -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF && \
cmake --build build --target install -j "$(nproc)" && \
rm -rf ninja build

## Install ZLIB
ARG ZLIB_TAG=v1.3
RUN git clone --depth 1 --branch "$ZLIB_TAG" https://github.com/madler/zlib.git && \
cmake -G Ninja -S zlib -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_POSITION_INDEPENDENT_CODE=ON && \
## Install flatbuffers
ARG FB_VERSION=23.5.26
RUN wget -q https://github.com/google/flatbuffers/archive/refs/tags/v${FB_VERSION}.tar.gz && \
tar xvf v${FB_VERSION}.tar.gz && \
rm v${FB_VERSION}.tar.gz && \
cmake -G Ninja -S flatbuffers-${FB_VERSION} -B build \
-DCMAKE_BUILD_TYPE=Release \
-DFLATBUFFERS_BUILD_TESTS=OFF \
&& \
cmake --build build --target install && \
rm -rf flatbuffers-${FB_VERSION} build

## Install flatbuffers
ARG WABT_VERSION=1.0.36
RUN git clone --recursive --depth 1 --branch ${WABT_VERSION} https://github.com/WebAssembly/wabt.git && \
cmake -G Ninja -S wabt -B build \
-DCMAKE_BUILD_TYPE=Release \
-DWITH_EXCEPTIONS=ON \
-DBUILD_TESTS=OFF \
-DBUILD_TOOLS=OFF \
-DBUILD_LIBWASM=OFF \
-DUSE_INTERNAL_SHA256=ON \
&& \
cmake --build build --target install && \
rm -rf zlib build && \
rm -f /usr/local/lib/libz.so*
rm -rf wabt build

## Install LLVM
ARG LLVM_TAG=llvmorg-17.0.6
RUN git clone --depth 1 --branch "$LLVM_TAG" https://github.com/llvm/llvm-project.git
RUN cmake \
-G Ninja \
-S llvm-project/llvm \
-B build \
ARG LLVM_TAG=llvmorg-18.1.8
RUN wget -q https://github.com/llvm/llvm-project/archive/refs/tags/${LLVM_TAG}.tar.gz && \
tar xf ${LLVM_TAG}.tar.gz && \
rm ${LLVM_TAG}.tar.gz && \
cmake -G Ninja -S llvm-project-${LLVM_TAG}/llvm -B build \
"-DLLVM_ENABLE_PROJECTS=clang;lld" \
"-DLLVM_ENABLE_RUNTIMES=compiler-rt" \
"-DLLVM_TARGETS_TO_BUILD=WebAssembly;X86;AArch64;ARM;Hexagon;NVPTX;PowerPC;RISCV" \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_BUILD_32_BITS=OFF \
-DLLVM_ENABLE_ASSERTIONS=ON \
Expand All @@ -34,18 +56,17 @@ RUN cmake \
-DLLVM_ENABLE_EH=ON \
-DLLVM_ENABLE_HTTPLIB=OFF \
-DLLVM_ENABLE_IDE=OFF \
-DLLVM_ENABLE_LIBEDIT=OFF \
-DLLVM_ENABLE_LIBXML2=OFF \
-DLLVM_ENABLE_OCAMLDOC=OFF \
-DLLVM_ENABLE_PROJECTS="clang;lld" \
-DLLVM_ENABLE_RTTI=ON \
-DLLVM_ENABLE_TERMINFO=OFF \
-DLLVM_ENABLE_WARNINGS=OFF \
-DLLVM_ENABLE_ZLIB=ON \
-DLLVM_ENABLE_ZLIB=OFF \
-DLLVM_ENABLE_ZSTD=OFF \
-DLLVM_INCLUDE_BENCHMARKS=OFF \
-DLLVM_INCLUDE_EXAMPLES=OFF \
-DLLVM_INCLUDE_TESTS=OFF \
-DLLVM_TARGETS_TO_BUILD="X86;ARM;NVPTX;AArch64;Hexagon;PowerPC;WebAssembly" \
&& \
cmake --build build --target install && \
rm -rf llvm-project build
rm -rf llvm-project-${LLVM_TAG} build
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ already, the following:
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
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:17.0.6
docker push ghcr.io/halide/manylinux2014_x86_64-llvm:17.0.6

See the docs for more details: https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry

Expand Down
2 changes: 1 addition & 1 deletion build-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ build_image() {
.
}

build_image aarch64
#build_image aarch64
build_image x86_64

0 comments on commit 0b252d1

Please sign in to comment.