Skip to content

Commit 3f30e63

Browse files
committed
Use separated image
1 parent 177d0c7 commit 3f30e63

File tree

7 files changed

+172
-26
lines changed

7 files changed

+172
-26
lines changed

.env

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ DOCKER_BUILDKIT=1
3737
ARCH=amd64
3838
ARCH_ALIAS=x86_64
3939
ARCH_SHORT=amd64
40+
# For aarch64
41+
# ARCH=aarch64v8
42+
# ARCH_ALIAS=aarch64
43+
# ARCH_SHORT=arm64
4044

4145
# Default repository to pull and push images from
4246
REPO=apache/arrow-dev

.github/workflows/cpp_extra.yml

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ jobs:
166166

167167
jni-linux:
168168
needs: check-labels
169-
name: JNI ${{ matrix.platform.runs-on }} ${{ matrix.platform.archery-arch }}
169+
name: JNI ${{ matrix.platform.runs-on }} ${{ matrix.platform.arch }}
170170
runs-on: ${{ matrix.platform.runs-on }}
171171
if: >-
172172
needs.check-labels.outputs.force == 'true' ||
@@ -180,15 +180,19 @@ jobs:
180180
fail-fast: false
181181
matrix:
182182
platform:
183-
- archery-arch: "amd64"
183+
- arch: "amd64"
184+
arch-alias: "x86_64"
185+
arch-short: "amd64"
184186
runs-on: ubuntu-latest
185-
vcpkg-arch: "amd64"
186-
- archery-arch: "arm64v8"
187+
- arch: "aarch64v8"
188+
arch-alias: "aarch64"
189+
arch-short: "arm64"
187190
runs-on: ubuntu-24.04-arm
188-
vcpkg-arch: "arm64"
189191
env:
190-
ARCH: ${{ matrix.platform.archery-arch }}
191-
VCPKG_ARCH: ${{ matrix.platform.vcpkg-arch }}
192+
ARCH: ${{ matrix.platform.arch }}
193+
ARCH_ALIAS: ${{ matrix.platform.arch-alias }}
194+
ARCH_SHORT: ${{ matrix.platform.arch-short }}
195+
REPO: ghcr.io/${{ github.repository }}-dev
192196
steps:
193197
- name: Checkout Arrow
194198
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
@@ -209,21 +213,13 @@ jobs:
209213
run: python3 -m pip install -e dev/archery[docker]
210214
- name: Execute Docker Build
211215
env:
212-
ARCHERY_DOCKER_USER: ${{ secrets.DOCKERHUB_USER }}
213-
ARCHERY_DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}
216+
ARCHERY_DOCKER_USER: ${{ github.actor }}
217+
ARCHERY_DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
214218
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
215219
VCPKG_BINARY_SOURCES: "clear;nuget,GitHub,readwrite"
216220
run: |
217221
source ci/scripts/util_enable_core_dumps.sh
218-
archery docker run \
219-
-e ARROW_BUILD_TESTS=ON \
220-
-e ARROW_CMAKE_ARGS="-DARROW_BUILD_TESTS=ON" \
221-
-e CMAKE_PRESET=ninja-release-jni-linux \
222-
-e VCPKG_ROOT=/opt/vcpkg \
223-
-e VCPKG_TARGET_TRIPLET=${VCPKG_ARCH}-linux-static-release \
224-
python-wheel-manylinux-2-28 \
225-
'/arrow/ci/scripts/cpp_build.sh /arrow /build && \
226-
/arrow/ci/scripts/cpp_test.sh /arrow /build'
222+
archery docker run cpp-jni
227223
228224
jni-macos:
229225
needs: check-labels

ci/docker/cpp-jni.dockerfile

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
ARG base
19+
FROM ${base}
20+
21+
ARG arch
22+
ARG arch_short
23+
24+
SHELL ["/bin/bash", "-i", "-c"]
25+
ENTRYPOINT ["/bin/bash", "-i", "-c"]
26+
27+
# Install basic dependencies
28+
RUN dnf install -y \
29+
autoconf \
30+
curl \
31+
flex \
32+
gdb \
33+
git \
34+
perl-IPC-Cmd \
35+
wget \
36+
zip
37+
38+
# A system Python is required for Ninja and vcpkg in this Dockerfile.
39+
# On manylinux_2_28 base images, no system Python is installed.
40+
# We therefore override the PATH with Python 3.10 in /opt/python
41+
# so that we have a consistent Python version across base images.
42+
ENV CPYTHON_VERSION=cp310
43+
ENV PATH=/opt/python/${CPYTHON_VERSION}-${CPYTHON_VERSION}/bin:${PATH}
44+
45+
# Install CMake
46+
ARG cmake=3.29.2
47+
COPY ci/scripts/install_cmake.sh arrow/ci/scripts/
48+
RUN /arrow/ci/scripts/install_cmake.sh ${cmake} /usr/local
49+
50+
# Install Ninja
51+
ARG ninja=1.10.2
52+
COPY ci/scripts/install_ninja.sh arrow/ci/scripts/
53+
RUN /arrow/ci/scripts/install_ninja.sh ${ninja} /usr/local
54+
55+
# Install ccache
56+
ARG ccache=4.1
57+
COPY ci/scripts/install_ccache.sh arrow/ci/scripts/
58+
RUN /arrow/ci/scripts/install_ccache.sh ${ccache} /usr/local
59+
60+
# Install vcpkg
61+
ARG vcpkg
62+
COPY ci/vcpkg/*.patch \
63+
ci/vcpkg/*linux*.cmake \
64+
ci/vcpkg/vcpkg.json \
65+
arrow/ci/vcpkg/
66+
COPY ci/scripts/install_vcpkg.sh \
67+
arrow/ci/scripts/
68+
ENV VCPKG_ROOT=/opt/vcpkg
69+
ARG build_type=release
70+
ENV CMAKE_BUILD_TYPE=${build_type} \
71+
PATH="${PATH}:${VCPKG_ROOT}" \
72+
VCPKG_DEFAULT_TRIPLET=${arch_short}-linux-static-${build_type} \
73+
VCPKG_FEATURE_FLAGS="manifests" \
74+
VCPKG_FORCE_SYSTEM_BINARIES=1 \
75+
VCPKG_OVERLAY_TRIPLETS=/arrow/ci/vcpkg
76+
# For --mount=type=secret: The GITHUB_TOKEN is the only real secret but we use
77+
# --mount=type=secret for GITHUB_REPOSITORY_OWNER and
78+
# VCPKG_BINARY_SOURCES too because we don't want to store them
79+
# into the built image in order to easily reuse the built image cache.
80+
#
81+
# For vcpkg install: cannot use the S3 feature here because while
82+
# aws-sdk-cpp=1.9.160 contains ssl related fixes as well as we can
83+
# patch the vcpkg portfile to support arm machines it hits ARROW-15141
84+
# where we would need to fall back to 1.8.186 but we cannot patch
85+
# those portfiles since vcpkg-tool handles the checkout of previous
86+
# versions => use bundled S3 build
87+
RUN --mount=type=secret,id=github_repository_owner \
88+
--mount=type=secret,id=github_token \
89+
--mount=type=secret,id=vcpkg_binary_sources \
90+
export GITHUB_REPOSITORY_OWNER=$(cat /run/secrets/github_repository_owner); \
91+
export GITHUB_TOKEN=$(cat /run/secrets/github_token); \
92+
export VCPKG_BINARY_SOURCES=$(cat /run/secrets/vcpkg_binary_sources); \
93+
arrow/ci/scripts/install_vcpkg.sh ${VCPKG_ROOT} ${vcpkg} && \
94+
vcpkg install \
95+
--clean-after-build \
96+
--x-install-root=${VCPKG_ROOT}/installed \
97+
--x-manifest-root=/arrow/ci/vcpkg \
98+
--x-feature=azure \
99+
--x-feature=dev \
100+
--x-feature=flight \
101+
--x-feature=gandiva \
102+
--x-feature=gcs \
103+
--x-feature=json \
104+
--x-feature=orc \
105+
--x-feature=parquet \
106+
--x-feature=s3 && \
107+
rm -rf ~/.config/NuGet/
108+
109+
ENV ARROW_BUILD_TESTS=ON \
110+
ARROW_CMAKE_ARGS="-DARROW_BUILD_TESTS=ON" \
111+
CMAKE_PRESET=ninja-${CMAKE_BUILD_TYPE}-jni-linux

ci/docker/python-wheel-manylinux.dockerfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,7 @@ RUN --mount=type=secret,id=github_repository_owner \
8989
--x-install-root=${VCPKG_ROOT}/installed \
9090
--x-manifest-root=/arrow/ci/vcpkg \
9191
--x-feature=azure \
92-
--x-feature=dev \
9392
--x-feature=flight \
94-
--x-feature=gandiva \
9593
--x-feature=gcs \
9694
--x-feature=json \
9795
--x-feature=orc \

ci/scripts/cpp_test.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,13 @@ else
120120
"$@"
121121
fi
122122

123+
# This is for testing find_package(Arrow).
124+
#
125+
# Note that this is not a perfect solution. We should improve this
126+
# later.
127+
#
128+
# * This is ad-hoc
129+
# * This doesn't test other CMake packages such as ArrowDataset
123130
if [ "${ARROW_USE_MESON:-OFF}" = "OFF" ] && \
124131
[ "${ARROW_EMSCRIPTEN:-OFF}" = "OFF" ] && \
125132
[ "${ARROW_USE_ASAN:-OFF}" = "OFF" ]; then
@@ -133,8 +140,8 @@ if [ "${ARROW_USE_MESON:-OFF}" = "OFF" ] && \
133140
CMAKE_PREFIX_PATH+="/lib/cmake/"
134141
;;
135142
esac
136-
if [ -n "${VCPKG_ROOT}" ] && [ -n "${VCPKG_TARGET_TRIPLET}" ]; then
137-
CMAKE_PREFIX_PATH+=";${VCPKG_ROOT}/installed/${VCPKG_TARGET_TRIPLET}"
143+
if [ -n "${VCPKG_ROOT}" ] && [ -n "${VCPKG_DEFAULT_TRIPLET}" ]; then
144+
CMAKE_PREFIX_PATH+=";${VCPKG_ROOT}/installed/${VCPKG_DEFAULT_TRIPLET}"
138145
fi
139146
cmake \
140147
-S "${source_dir}/examples/minimal_build" \

ci/vcpkg/vcpkg.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@
4040
"boost-crc",
4141
"boost-filesystem",
4242
"boost-process",
43-
{
44-
"name": "gdb",
45-
"platform": "!windows"
46-
},
4743
"gtest"
4844
]
4945
},

docker-compose.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ x-hierarchy:
130130
- conda-python-spark
131131
- conda-verify-rc
132132
- conan
133+
- cpp-jni
133134
- debian-cpp:
134135
- debian-c-glib:
135136
- debian-ruby
@@ -187,6 +188,8 @@ volumes:
187188
name: ${ARCH}-alpine-linux-ccache
188189
conda-ccache:
189190
name: ${ARCH}-conda-ccache
191+
cpp-jni-ccache:
192+
name: ${ARCH}-cpp-jni-ccache
190193
debian-ccache:
191194
name: ${ARCH}-debian-${DEBIAN}-ccache
192195
fedora-ccache:
@@ -765,6 +768,37 @@ services:
765768
/arrow/ci/scripts/conan_setup.sh &&
766769
/arrow/ci/scripts/conan_build.sh /arrow /build"
767770
771+
cpp-jni:
772+
# Test for the build configuration for JNI.
773+
#
774+
# Usage:
775+
# docker compose run --rm cpp-jni
776+
# Parameters:
777+
# ARCH: amd64, aarch64v8
778+
# ARCH_ALIAS: x86_64, aarch64
779+
# ARCH_SHORT: amd64, arm64
780+
image: ${REPO}:${ARCH}-cpp-jni-${VCPKG}
781+
build:
782+
args:
783+
arch: ${ARCH}
784+
arch_short: ${ARCH_SHORT}
785+
# See available versions at:
786+
# https://quay.io/repository/pypa/manylinux_2_28_x86_64?tab=tags
787+
# https://quay.io/repository/pypa/manylinux_2_28_aarch64?tab=tags
788+
base: quay.io/pypa/manylinux_2_28_${ARCH_ALIAS}:2025.10.09-1
789+
vcpkg: ${VCPKG}
790+
context: .
791+
dockerfile: ci/docker/cpp-jni.dockerfile
792+
cache_from:
793+
- ${REPO}:${ARCH}-cpp-jni-${VCPKG}
794+
secrets: *vcpkg-build-secrets
795+
environment:
796+
<<: [*common, *ccache]
797+
volumes:
798+
- .:/arrow:delegated
799+
- ${DOCKER_VOLUME_PREFIX}cpp-jni-ccache:/ccache:delegated
800+
command: *cpp-command
801+
768802
############################### C GLib ######################################
769803

770804
debian-c-glib:

0 commit comments

Comments
 (0)