From 03673e7f1b96005902d7ffd0836d681070bbedb3 Mon Sep 17 00:00:00 2001 From: changbao zhan Date: Tue, 16 Jun 2026 08:14:52 +0800 Subject: [PATCH 1/3] ORC-2179: Add RISC-V Docker image and GitHub Actions support This patch adds a riscv64 Ubuntu 24.04 Docker image and a corresponding GitHub Actions job to build ORC on RISC-V. --- .github/workflows/build_and_test.yml | 32 ++++++++++++++ docker/os-list.txt | 1 + docker/riscv64-ubuntu24/Dockerfile | 64 ++++++++++++++++++++++++++++ 3 files changed, 97 insertions(+) create mode 100644 docker/riscv64-ubuntu24/Dockerfile diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 078dbfc6ad..723ab4c1ff 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -63,6 +63,38 @@ jobs: cd docker ./run-one.sh local main ${{ matrix.os }} + riscv64: + name: "RISC-V ${{ matrix.os }}" + needs: [license-check] + runs-on: ubuntu-latest + timeout-minutes: 180 + strategy: + fail-fast: false + max-parallel: 20 + matrix: + os: + - riscv64-ubuntu24 + steps: + - name: Checkout + uses: actions/checkout@v6 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: linux/riscv64 + - name: Set up Buildx + uses: docker/setup-buildx-action@v3 + - name: Build Docker image + run: | + cd docker/${{ matrix.os }} + docker buildx build --platform linux/riscv64 --load \ + --cache-from type=gha,scope=riscv64-ubuntu24 \ + --cache-to type=gha,mode=max,scope=riscv64-ubuntu24 \ + -t orc-riscv64 . + - name: Build ORC with RVV + run: | + docker run --platform linux/riscv64 --rm -v $(pwd):/root/orc orc-riscv64 /bin/bash -c \ + "mkdir -p build && cd build && cmake -DBUILD_JAVA=OFF -DBUILD_ENABLE_RVV=ON -DCMAKE_BUILD_TYPE=Release ../orc && make -j\$(nproc) package" + build: name: "Java ${{ matrix.java }} and ${{ matrix.cxx }} on ${{ matrix.os }}" needs: [license-check] diff --git a/docker/os-list.txt b/docker/os-list.txt index 7b9d7cafeb..01170f8cf9 100644 --- a/docker/os-list.txt +++ b/docker/os-list.txt @@ -6,3 +6,4 @@ oraclelinux9 oraclelinux10 amazonlinux23 ubi10 +riscv64-ubuntu24 diff --git a/docker/riscv64-ubuntu24/Dockerfile b/docker/riscv64-ubuntu24/Dockerfile new file mode 100644 index 0000000000..b214be9452 --- /dev/null +++ b/docker/riscv64-ubuntu24/Dockerfile @@ -0,0 +1,64 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# ORC compile for RISC-V Ubuntu 24 +# + +FROM --platform=linux/riscv64 ubuntu:24.04 +LABEL org.opencontainers.image.authors="Apache ORC project " +LABEL org.opencontainers.image.licenses="Apache-2.0" +LABEL org.opencontainers.image.ref.name="Apache ORC on RISC-V Ubuntu 24" +LABEL org.opencontainers.image.version="" +ARG jdk=21 +ARG cc=gcc + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + ca-certificates \ + cmake \ + git \ + libsasl2-dev \ + libssl-dev \ + make \ + curl \ + maven \ + openjdk-${jdk}-jdk-headless \ + tzdata \ + $( [ "${cc}" = "gcc" ] && echo "gcc g++" || echo "clang" ) && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* && \ + if [ "${cc}" != "gcc" ] ; then \ + update-alternatives --set cc /usr/bin/clang && \ + update-alternatives --set c++ /usr/bin/clang++; \ + fi +RUN update-alternatives --set java \ + $(update-alternatives --list java | grep "java-${jdk}-openjdk") && \ + update-alternatives --set javac \ + $(update-alternatives --list javac | grep "java-${jdk}-openjdk") + +ENV CC=cc +ENV CXX=c++ + +RUN ln -fs /usr/share/zoneinfo/America/Los_Angeles /etc/localtime && \ + mkdir -p /usr/share/zoneinfo/US && \ + ln -fs /usr/share/zoneinfo/America/Los_Angeles /usr/share/zoneinfo/US/Pacific + +WORKDIR /root +VOLUME /root/.m2/repository + +CMD ["/bin/bash", "-c", "if [ ! -d orc ]; then echo \"No volume provided, building from apache main.\"; echo \"Pass '-v\`pwd\`:/root/orc' to docker run to build local source.\"; git clone https://github.com/apache/orc.git -b main; fi && mkdir build && cd build && cmake ../orc && make package test-out"] From 8fba229ffbfd2f904d490ba7620d7b2adcf3f19e Mon Sep 17 00:00:00 2001 From: changbao zhan Date: Wed, 17 Jun 2026 10:40:15 +0800 Subject: [PATCH 2/3] ORC-2179: Update RISC-V Docker image to Ubuntu 26.04 --- .github/workflows/build_and_test.yml | 6 +++--- docker/os-list.txt | 2 +- docker/{riscv64-ubuntu24 => riscv64-ubuntu26}/Dockerfile | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) rename docker/{riscv64-ubuntu24 => riscv64-ubuntu26}/Dockerfile (96%) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 723ab4c1ff..e192037a3d 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -73,7 +73,7 @@ jobs: max-parallel: 20 matrix: os: - - riscv64-ubuntu24 + - riscv64-ubuntu26 steps: - name: Checkout uses: actions/checkout@v6 @@ -87,8 +87,8 @@ jobs: run: | cd docker/${{ matrix.os }} docker buildx build --platform linux/riscv64 --load \ - --cache-from type=gha,scope=riscv64-ubuntu24 \ - --cache-to type=gha,mode=max,scope=riscv64-ubuntu24 \ + --cache-from type=gha,scope=riscv64-ubuntu26 \ + --cache-to type=gha,mode=max,scope=riscv64-ubuntu26 \ -t orc-riscv64 . - name: Build ORC with RVV run: | diff --git a/docker/os-list.txt b/docker/os-list.txt index 01170f8cf9..6c8e97a9ab 100644 --- a/docker/os-list.txt +++ b/docker/os-list.txt @@ -6,4 +6,4 @@ oraclelinux9 oraclelinux10 amazonlinux23 ubi10 -riscv64-ubuntu24 +riscv64-ubuntu26 diff --git a/docker/riscv64-ubuntu24/Dockerfile b/docker/riscv64-ubuntu26/Dockerfile similarity index 96% rename from docker/riscv64-ubuntu24/Dockerfile rename to docker/riscv64-ubuntu26/Dockerfile index b214be9452..41c3b33717 100644 --- a/docker/riscv64-ubuntu24/Dockerfile +++ b/docker/riscv64-ubuntu26/Dockerfile @@ -14,13 +14,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -# ORC compile for RISC-V Ubuntu 24 +# ORC compile for RISC-V Ubuntu 26 # -FROM --platform=linux/riscv64 ubuntu:24.04 +FROM --platform=linux/riscv64 ubuntu:26.04 LABEL org.opencontainers.image.authors="Apache ORC project " LABEL org.opencontainers.image.licenses="Apache-2.0" -LABEL org.opencontainers.image.ref.name="Apache ORC on RISC-V Ubuntu 24" +LABEL org.opencontainers.image.ref.name="Apache ORC on RISC-V Ubuntu 26" LABEL org.opencontainers.image.version="" ARG jdk=21 ARG cc=gcc From 7903deb596ee7cfdfcf0f2bfecb203e73d75c737 Mon Sep 17 00:00:00 2001 From: changbao zhan Date: Thu, 18 Jun 2026 09:51:06 +0800 Subject: [PATCH 3/3] ORC-2179: Enable RISC-V Vector extension in GitHub Actions CI. Set QEMU_CPU=rv64,v=on,vlen=128,vext_spec=v1.0 in the riscv64 CI job and pass it into the Docker container via -e QEMU_CPU. This ensures the emulated RISC-V CPU has the V extension enabled so that ORC's RVV code path can be exercised in CI. --- .github/workflows/build_and_test.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index e192037a3d..74908e4a2b 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -91,8 +91,10 @@ jobs: --cache-to type=gha,mode=max,scope=riscv64-ubuntu26 \ -t orc-riscv64 . - name: Build ORC with RVV + env: + QEMU_CPU: rv64,v=on,vlen=128,vext_spec=v1.0 run: | - docker run --platform linux/riscv64 --rm -v $(pwd):/root/orc orc-riscv64 /bin/bash -c \ + docker run --platform linux/riscv64 --rm -e QEMU_CPU -v $(pwd):/root/orc orc-riscv64 /bin/bash -c \ "mkdir -p build && cd build && cmake -DBUILD_JAVA=OFF -DBUILD_ENABLE_RVV=ON -DCMAKE_BUILD_TYPE=Release ../orc && make -j\$(nproc) package" build: