|
| 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 |
0 commit comments