@@ -39,7 +39,7 @@ RUN --mount=type=cache,target=/var/cache/dnf \
39
39
PACKAGES="$PACKAGES gcc gcc-c++ make openssl-devel autoconf automake libtool cmake python3-devel pybind11-devel openblas-devel unixODBC-devel openssl zlib-devel"; \
40
40
fi && \
41
41
if [ "$TARGETARCH" = "ppc64le" ]; then \
42
- PACKAGES="$PACKAGES git gcc-toolset-13 make wget unzip unixODBC-devel cmake ninja-build"; \
42
+ PACKAGES="$PACKAGES git gcc-toolset-13 make wget unzip rust cargo unixODBC-devel cmake ninja-build"; \
43
43
fi && \
44
44
if [ -n "$PACKAGES" ]; then \
45
45
echo "Installing: $PACKAGES" && \
@@ -52,6 +52,7 @@ RUN if [ "$TARGETARCH" = "ppc64le" ]; then \
52
52
echo 'export LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib:/usr/lib64:/usr/lib:$LD_LIBRARY_PATH' >> /etc/profile.d/ppc64le.sh && \
53
53
echo 'export OPENBLAS_VERSION=0.3.30' >> /etc/profile.d/ppc64le.sh && \
54
54
echo 'export ONNX_VERSION=1.19.0' >> /etc/profile.d/ppc64le.sh && \
55
+ echo 'export PYARROW_VERSION=17.0.0' >> /etc/profile.d/ppc64le.sh && \
55
56
echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> /etc/profile.d/ppc64le.sh && \
56
57
echo 'export GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1' >> /etc/profile.d/ppc64le.sh; \
57
58
fi
@@ -199,6 +200,62 @@ RUN if [ "$TARGETARCH" = "ppc64le" ]; then \
199
200
echo "Not ppc64le, skipping ONNX build" && mkdir -p /onnx_wheels; \
200
201
fi
201
202
203
+ ###################################
204
+ # pyarrow builder stage for ppc64le
205
+ ##################################
206
+
207
+ FROM cpu-base AS arrow-builder
208
+ USER root
209
+ WORKDIR /root
210
+
211
+ ARG TARGETARCH
212
+ ENV PYARROW_VERSION=17.0.0
213
+
214
+ RUN echo "arrow-builder stage TARGETARCH: ${TARGETARCH}"
215
+
216
+ RUN if [ "$TARGETARCH" = "ppc64le" ]; then \
217
+ git clone -b apache-arrow-${PYARROW_VERSION} https://github.com/apache/arrow.git --recursive && \
218
+ cd arrow && rm -rf .git && mkdir dist && \
219
+ pip3 install -r python/requirements-build.txt && \
220
+ export ARROW_HOME=$(pwd)/dist && \
221
+ export LD_LIBRARY_PATH=$(pwd)/dist/lib:$LD_LIBRARY_PATH && \
222
+ export CMAKE_PREFIX_PATH=$ARROW_HOME:$CMAKE_PREFIX_PATH && \
223
+ export PARQUET_TEST_DATA="${PWD}/cpp/submodules/parquet-testing/data" && \
224
+ export ARROW_TEST_DATA="${PWD}/testing/data" && \
225
+ cmake -S cpp -B cpp/build \
226
+ -DCMAKE_INSTALL_PREFIX=$ARROW_HOME \
227
+ -DCMAKE_BUILD_TYPE=release \
228
+ -DARROW_WITH_BZ2=ON \
229
+ -DARROW_WITH_ZLIB=ON \
230
+ -DARROW_WITH_ZSTD=ON \
231
+ -DARROW_WITH_LZ4=ON \
232
+ -DARROW_WITH_SNAPPY=ON \
233
+ -DARROW_WITH_BROTLI=ON \
234
+ -DARROW_DATASET=ON \
235
+ -DARROW_FILESYSTEM=ON \
236
+ -DARROW_COMPUTE=ON \
237
+ -DARROW_JSON=ON \
238
+ -DARROW_CSV=ON \
239
+ -DARROW_PYTHON=ON \
240
+ -DARROW_PARQUET=ON \
241
+ -DARROW_BUILD_SHARED=ON \
242
+ -DARROW_BUILD_TESTS=OFF && \
243
+ cd cpp/build && \
244
+ make -j20 install && \
245
+ export PYARROW_PARALLEL=20 && \
246
+ export PYARROW_WITH_PARQUET=1 && \
247
+ export PYARROW_WITH_DATASET=1 && \
248
+ export PYARROW_BUNDLE_ARROW_CPP=1 && \
249
+ pip3 install wheel && \
250
+ cd ../../python && \
251
+ python setup.py build_ext \
252
+ --build-type=release \
253
+ --bundle-arrow-cpp \
254
+ bdist_wheel --dist-dir /arrowwheels; \
255
+ else \
256
+ echo "Not ppc64le, skipping pyarrow build" && mkdir -p /arrowwheels; \
257
+ fi
258
+
202
259
#######################
203
260
# runtime-datascience #
204
261
#######################
@@ -223,16 +280,17 @@ USER 0
223
280
# Install ppc64le-built wheels if available
224
281
COPY --from=openblas-builder /root/OpenBLAS-* /openblas
225
282
COPY --from=onnx-builder /onnx_wheels /tmp/onnx_wheels
283
+ COPY --from=arrow-builder /arrowwheels /tmp/arrowwheels
226
284
227
285
RUN if [ "$TARGETARCH" = "ppc64le" ]; then \
228
- echo "Installing ppc64le ONNX wheels and OpenBLAS..." && \
229
- HOME=/root pip install /tmp/onnx_wheels/*.whl && \
286
+ echo "Installing ppc64le ONNX, pyarrow wheels and OpenBLAS..." && \
287
+ HOME=/root pip install /tmp/onnx_wheels/*.whl /tmp/arrowwheels/*.whl && \
230
288
if [ -d "/openblas" ] && [ "$(ls -A /openblas 2>/dev/null)" ]; then \
231
289
PREFIX=/usr/local make -C /openblas install; \
232
- fi && rm -rf /openblas /tmp/onnx_wheels; \
290
+ fi && rm -rf /openblas /tmp/onnx_wheels /tmp/arrowwheels ; \
233
291
else \
234
292
echo "Skipping architecture-specific wheel installs for (${TARGETARCH})" && \
235
- rm -rf /tmp/wheels /openblas /tmp/onnx_wheels; \
293
+ rm -rf /tmp/wheels /openblas /tmp/onnx_wheels /tmp/arrowwheels ; \
236
294
fi
237
295
238
296
USER 0
0 commit comments