3 # Licensed to the Apache Software Foundation (ASF) under one
4 # or more contributor license agreements. See the NOTICE file
5 # distributed with this work for additional information
6 # regarding copyright ownership. The ASF licenses this file
7 # to you under the Apache License, Version 2.0 (the
8 # "License"); you may not use this file except in compliance
9 # with the License. You may obtain a copy of the License at
11 # http://www.apache.org/licenses/LICENSE-2.0
13 # Unless required by applicable law or agreed to in writing,
14 # software distributed under the License is distributed on an
15 # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 # KIND, either express or implied. See the License for the
17 # specific language governing permissions and limitations
26 # - Node.js >= 11.12 (best way is to use nvm)
29 # If using a non-system Boost, set BOOST_ROOT and add Boost libraries to
32 # To reuse build artifacts between runs set ARROW_TMPDIR environment variable to
33 # a directory where the temporary files should be placed to, note that this
34 # directory is not cleaned up automatically.
41 source|binaries|wheels
) ;;
42 *) echo "Invalid argument: '${ARTIFACT}', valid options are \
43 'source', 'binaries', or 'wheels'"
48 *) echo "Usage: $0 source|binaries X.Y.Z RC_NUMBER"
57 SOURCE_DIR
="$(cd "$
(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"
58 ARROW_DIR
="$(dirname $(dirname ${SOURCE_DIR}))"
61 if ! (which nvcc
&& which nvidia-smi
) > /dev
/null
; then
65 local n_gpus
=$
(nvidia-smi
--list-gpus |
wc -l)
66 return $
((${n_gpus} < 1))
69 # Build options for the C++ library
71 if [ -z "${ARROW_CUDA:-}" ] && detect_cuda
; then
76 : ${ARROW_GANDIVA:=ON}
78 ARROW_DIST_URL
='https://dist.apache.org/repos/dist/dev/arrow'
80 download_dist_file
() {
86 --remote-name $ARROW_DIST_URL/$1
90 download_dist_file apache-arrow-
${VERSION}-rc${RC_NUMBER}/$1
94 download_dist_file KEYS
100 download_rc_file
${dist_name}.
tar.gz
101 download_rc_file
${dist_name}.
tar.gz.asc
102 download_rc_file
${dist_name}.
tar.gz.sha256
103 download_rc_file
${dist_name}.
tar.gz.sha512
104 gpg
--verify ${dist_name}.
tar.gz.asc
${dist_name}.
tar.gz
105 shasum
-a 256 -c ${dist_name}.
tar.gz.sha256
106 shasum
-a 512 -c ${dist_name}.
tar.gz.sha512
109 verify_dir_artifact_signatures
() {
110 # verify the signature and the checksums of each artifact
111 find $1 -name '*.asc' |
while read sigfile
; do
112 artifact
=${sigfile/.asc/}
113 gpg
--verify $sigfile $artifact ||
exit 1
115 # go into the directory because the checksum files contain only the
116 # basename of the artifact
117 pushd $
(dirname $artifact)
118 base_artifact
=$
(basename $artifact)
119 if [ -f $base_artifact.sha256
]; then
120 shasum
-a 256 -c $base_artifact.sha256 ||
exit 1
122 shasum
-a 512 -c $base_artifact.sha512 ||
exit 1
128 local download_dir
=binaries
129 mkdir
-p ${download_dir}
131 ${PYTHON:-python} $SOURCE_DIR/download_rc_binaries.py
$VERSION $RC_NUMBER \
132 --dest=${download_dir}
134 verify_dir_artifact_signatures
${download_dir}
138 for target
in "debian:buster" \
139 "arm64v8/debian:buster" \
141 "arm64v8/debian:bullseye" \
143 "arm64v8/debian:bookworm" \
145 "arm64v8/ubuntu:bionic" \
147 "arm64v8/ubuntu:focal" \
149 "arm64v8/ubuntu:hirsute" \
151 "arm64v8/ubuntu:impish"; do \
154 if [ "$(arch)" = "aarch64" -o -e /usr
/bin
/qemu-aarch64-static
]; then
156 arm64v
8/debian
:buster|arm64v
8/ubuntu
:bionic|arm64v
8/ubuntu
:focal
)
159 # qemu-user-static in Ubuntu 20.04 has a crash bug:
160 # https://bugs.launchpad.net/qemu/+bug/1749393
169 if ! docker run
--rm -v "${SOURCE_DIR}"/..
/..
:/arrow
:delegated \
171 /arrow
/dev
/release
/verify-apt.sh \
174 echo "Failed to verify the APT repository for ${target}"
181 for target
in "almalinux:8" \
182 "arm64v8/almalinux:8" \
186 "arm64v8/centos:8"; do
189 if [ "$(arch)" = "aarch64" -o -e /usr
/bin
/qemu-aarch64-static
]; then
196 if ! docker run
--rm -v "${SOURCE_DIR}"/..
/..
:/arrow
:delegated \
198 /arrow
/dev
/release
/verify-yum.sh \
201 echo "Failed to verify the Yum repository for ${target}"
210 if [ "${TEST_SUCCESS}" = "yes" ]; then
211 rm -fr "${ARROW_TMPDIR}"
213 echo "Failed to verify release candidate. See ${ARROW_TMPDIR} for details."
217 if [ -z "${ARROW_TMPDIR}" ]; then
218 # clean up automatically if ARROW_TMPDIR is not defined
219 ARROW_TMPDIR
=$
(mktemp
-d -t "$1.XXXXX")
222 # don't clean up automatically
223 mkdir
-p "${ARROW_TMPDIR}"
228 # Setup short-lived miniconda for Python and integration tests
230 if [ "${OS}" == "Darwin" ]; then
234 MINICONDA_URL
="https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-${OS}-${ARCH}.sh"
236 MINICONDA
=$PWD/test-miniconda
238 if [ ! -d "${MINICONDA}" ]; then
239 # Setup miniconda only if the directory doesn't exist yet
240 wget
-O miniconda.sh
$MINICONDA_URL
241 bash miniconda.sh
-b -p $MINICONDA
244 echo "Installed miniconda at ${MINICONDA}"
246 .
$MINICONDA/etc
/profile.d
/conda.sh
248 conda create
-n arrow-test
-y -q -c conda-forge \
254 conda activate arrow-test
255 echo "Using conda environment ${CONDA_PREFIX}"
258 # Build and test Java (Requires newer Maven -- I used 3.3.9)
260 test_package_java
() {
271 test_and_install_cpp
() {
275 ARROW_CMAKE_OPTIONS
="
276 ${ARROW_CMAKE_OPTIONS:-}
277 -DCMAKE_INSTALL_PREFIX=$ARROW_HOME
278 -DCMAKE_INSTALL_LIBDIR=lib
279 -DARROW_FLIGHT=${ARROW_FLIGHT}
283 -DARROW_GANDIVA=${ARROW_GANDIVA}
286 -DPARQUET_REQUIRE_ENCRYPTION=ON
287 -DARROW_VERBOSE_THIRDPARTY_BUILD=ON
292 -DARROW_WITH_SNAPPY=ON
293 -DARROW_WITH_BROTLI=ON
294 -DARROW_BOOST_USE_SHARED=ON
295 -DCMAKE_BUILD_TYPE=release
296 -DARROW_BUILD_TESTS=ON
297 -DARROW_BUILD_INTEGRATION=ON
298 -DARROW_CUDA=${ARROW_CUDA}
299 -DARROW_DEPENDENCY_SOURCE=AUTO
301 cmake
$ARROW_CMAKE_OPTIONS ..
303 make -j$NPROC install
305 # TODO: ARROW-5036: plasma-serialization_tests broken
306 # TODO: ARROW-5054: libgtest.so link failure in flight-server-test
307 LD_LIBRARY_PATH
=$PWD/release
:$LD_LIBRARY_PATH ctest \
308 --exclude-regex "plasma-serialization_tests" \
310 --output-on-failure \
318 local csharp_bin
=${PWD}/bin
319 mkdir
-p ${csharp_bin}
321 if which dotnet
> /dev
/null
2>&1; then
322 if ! which sourcelink
> /dev
/null
2>&1; then
323 local dotnet_tools_dir
=$HOME/.dotnet
/tools
324 if [ -d "${dotnet_tools_dir}" ]; then
325 PATH
="${dotnet_tools_dir}:$PATH"
329 local dotnet_version
=3.1.405
330 local dotnet_platform
=
333 dotnet_platform
=linux
336 dotnet_platform
=macos
339 local dotnet_download_thank_you_url
=https
://dotnet.microsoft.com
/download
/thank-you
/dotnet-sdk-
${dotnet_version}-${dotnet_platform}-x64-binaries
340 local dotnet_download_url
=$
( \
341 curl
--location ${dotnet_download_thank_you_url} | \
342 grep 'window\.open' | \
343 grep -E -o '[^"]+' | \
345 curl
${dotnet_download_url} | \
346 tar xzf
- -C ${csharp_bin}
347 PATH
=${csharp_bin}:${PATH}
352 dotnet pack
-c Release
355 if ! which sourcelink
> /dev
/null
2>&1; then
356 dotnet tool
install --tool-path ${csharp_bin} sourcelink
357 PATH
=${csharp_bin}:${PATH}
358 if ! sourcelink
--help > /dev
/null
2>&1; then
359 export DOTNET_ROOT
=${csharp_bin}
363 sourcelink
test artifacts
/Apache.Arrow
/Release
/netstandard1.3
/Apache.Arrow.pdb
364 sourcelink
test artifacts
/Apache.Arrow
/Release
/netcoreapp2.1
/Apache.Arrow.pdb
369 # Build and test Python
374 pip
install -r requirements-build.txt
-r requirements-test.txt
376 export PYARROW_WITH_DATASET
=1
377 export PYARROW_WITH_PARQUET
=1
378 export PYARROW_WITH_PLASMA
=1
379 if [ "${ARROW_CUDA}" = "ON" ]; then
380 export PYARROW_WITH_CUDA
=1
382 if [ "${ARROW_FLIGHT}" = "ON" ]; then
383 export PYARROW_WITH_FLIGHT
=1
385 if [ "${ARROW_GANDIVA}" = "ON" ]; then
386 export PYARROW_WITH_GANDIVA
=1
389 python setup.py build_ext
--inplace
390 pytest pyarrow
-v --pdb
400 meson build
--prefix=$ARROW_HOME --libdir=lib
402 ninja
-C build
install
404 export GI_TYPELIB_PATH
=$ARROW_HOME/lib
/girepository-1.0
:$GI_TYPELIB_PATH
406 if ! bundle
--version; then
407 gem
install --no-document bundler
410 bundle
install --path vendor
/bundle
411 bundle
exec ruby test
/run-test.rb
419 if [ "${INSTALL_NODE}" -gt 0 ]; then
420 export NVM_DIR
="`pwd`/.nvm"
422 curl
-o- https
://raw.githubusercontent.com
/nvm-sh
/nvm
/v0.35
.3/install.sh | \
423 PROFILE
=/dev
/null bash
424 [ -s "$NVM_DIR/nvm.sh" ] && \.
"$NVM_DIR/nvm.sh"
430 yarn
--frozen-lockfile
431 yarn run-s clean
:all lint build
439 local modules
="red-arrow red-arrow-dataset red-plasma red-parquet"
440 if [ "${ARROW_CUDA}" = "ON" ]; then
441 modules
="${modules} red-arrow-cuda"
443 if [ "${ARROW_FLIGHT}" = "ON" ]; then
444 modules
="${modules} red-arrow-flight"
446 if [ "${ARROW_GANDIVA}" = "ON" ]; then
447 modules
="${modules} red-gandiva"
450 for module
in ${modules}; do
452 bundle
install --path vendor
/bundle
453 bundle
exec ruby test
/run-test.rb
461 local VERSION
=1.15.14
464 if [ "$(uname)" == "Darwin" ]; then
470 local GO_ARCHIVE
=go
$VERSION.
$OS-$ARCH.
tar.gz
471 wget https
://dl.google.com
/go
/$GO_ARCHIVE
474 tar -xzf $GO_ARCHIVE -C local-go
477 export GOROOT
=`pwd`/local-go
/go
478 export GOPATH
=`pwd`/local-go
/gopath
479 export PATH
=$GOROOT/bin
:$GOPATH/bin
:$PATH
490 # Run integration tests
493 CPP_BUILD_DIR
=$PWD/cpp
/build
495 export ARROW_JAVA_INTEGRATION_JAR
=$JAVA_DIR/tools
/target
/arrow-tools-
$VERSION-jar-with-dependencies.jar
496 export ARROW_CPP_EXE_PATH
=$CPP_BUILD_DIR/release
498 pip
install -e dev
/archery
500 INTEGRATION_TEST_ARGS
=""
502 if [ "${ARROW_FLIGHT}" = "ON" ]; then
503 INTEGRATION_TEST_ARGS
="${INTEGRATION_TEST_ARGS} --run-flight"
506 # Flight integration test executable have runtime dependency on
507 # release/libgtest.so
508 LD_LIBRARY_PATH
=$ARROW_CPP_EXE_PATH:$LD_LIBRARY_PATH \
509 archery integration \
510 --with-cpp=${TEST_INTEGRATION_CPP} \
511 --with-java=${TEST_INTEGRATION_JAVA} \
512 --with-js=${TEST_INTEGRATION_JS} \
513 --with-go=${TEST_INTEGRATION_GO} \
514 $INTEGRATION_TEST_ARGS
517 clone_testing_repositories
() {
518 # Clone testing repositories if not cloned already
519 if [ ! -d "arrow-testing" ]; then
520 git clone https
://github.com
/apache
/arrow-testing.git
522 if [ ! -d "parquet-testing" ]; then
523 git clone https
://github.com
/apache
/parquet-testing.git
525 export ARROW_TEST_DATA
=$PWD/arrow-testing
/data
526 export PARQUET_TEST_DATA
=$PWD/parquet-testing
/data
529 test_source_distribution
() {
530 export ARROW_HOME
=$ARROW_TMPDIR/install
531 export PARQUET_HOME
=$ARROW_TMPDIR/install
532 export LD_LIBRARY_PATH
=$ARROW_HOME/lib
:${LD_LIBRARY_PATH:-}
533 export PKG_CONFIG_PATH
=$ARROW_HOME/lib
/pkgconfig
:${PKG_CONFIG_PATH:-}
535 if [ "$(uname)" == "Darwin" ]; then
536 NPROC
=$
(sysctl
-n hw.ncpu
)
541 clone_testing_repositories
543 if [ ${TEST_JAVA} -gt 0 ]; then
546 if [ ${TEST_CPP} -gt 0 ]; then
549 if [ ${TEST_CSHARP} -gt 0 ]; then
552 if [ ${TEST_PYTHON} -gt 0 ]; then
555 if [ ${TEST_GLIB} -gt 0 ]; then
558 if [ ${TEST_RUBY} -gt 0 ]; then
561 if [ ${TEST_JS} -gt 0 ]; then
564 if [ ${TEST_GO} -gt 0 ]; then
567 if [ ${TEST_INTEGRATION} -gt 0 ]; then
572 test_binary_distribution
() {
573 if [ ${TEST_BINARY} -gt 0 ]; then
576 if [ ${TEST_APT} -gt 0 ]; then
579 if [ ${TEST_YUM} -gt 0 ]; then
584 test_linux_wheels
() {
585 if [ "$(uname -m)" = "aarch64" ]; then
591 local py_arches
="3.6m 3.7m 3.8 3.9"
592 local platform_tags
="manylinux_2_12_${arch}.manylinux2010_${arch} manylinux_2_17_${arch}.manylinux2014_${arch}"
594 for py_arch
in ${py_arches}; do
595 local env
=_verify_wheel-
${py_arch}
596 conda create
-yq -n ${env} python
=${py_arch//[mu]/}
597 conda activate
${env}
600 for tag
in ${platform_tags}; do
601 # check the mandatory and optional imports
602 pip
install python-rc
/${VERSION}-rc${RC_NUMBER}/pyarrow-${VERSION}-cp${py_arch//[mu.]/}-cp${py_arch//./}-${tag}.whl
603 INSTALL_PYARROW
=OFF
${ARROW_DIR}/ci
/scripts
/python_wheel_unix_test.sh
${ARROW_DIR}
610 test_macos_wheels
() {
611 local py_arches
="3.6m 3.7m 3.8 3.9"
612 local macos_version
=$
(sw_vers
-productVersion)
613 local macos_short_version
=${macos_version:0:5}
616 local check_flight
=ON
618 # macOS version <= 10.13
619 if [ $
(echo "${macos_short_version}\n10.14" |
sort -V |
head -n1) == "${macos_short_version}" ]; then
622 # apple silicon processor
623 if [ "$(uname -m)" = "arm64" ]; then
624 local py_arches
="3.8 3.9"
625 local check_flight
=OFF
628 # verify arch-native wheels inside an arch-native conda environment
629 for py_arch
in ${py_arches}; do
630 local env
=_verify_wheel-
${py_arch}
631 conda create
-yq -n ${env} python
=${py_arch//m/}
632 conda activate
${env}
635 # check the mandatory and optional imports
636 pip
install --find-links python-rc
/${VERSION}-rc${RC_NUMBER} pyarrow==${VERSION}
637 INSTALL_PYARROW
=OFF ARROW_FLIGHT
=${check_flight} ARROW_S3
=${check_s3} \
638 ${ARROW_DIR}/ci
/scripts
/python_wheel_unix_test.sh
${ARROW_DIR}
643 # verify arm64 and universal2 wheels using an universal2 python binary
644 # the interpreter should be installed from python.org:
645 # https://www.python.org/ftp/python/3.9.6/python-3.9.6-macosx10.9.pkg
646 if [ "$(uname -m)" = "arm64" ]; then
647 for py_arch
in "3.9"; do
648 local pyver
=${py_arch//m/}
649 local python
="/Library/Frameworks/Python.framework/Versions/${pyver}/bin/python${pyver}"
651 # create and activate a virtualenv for testing as arm64
652 for arch
in "arm64" "x86_64"; do
653 local venv
="${ARROW_TMPDIR}/test-${arch}-virtualenv"
654 $python -m virtualenv
$venv
655 source $venv/bin
/activate
658 # install pyarrow's universal2 wheel
660 --find-links python-rc
/${VERSION}-rc${RC_NUMBER} \
661 --target $
(python
-c 'import site; print(site.getsitepackages()[0])') \
662 --platform macosx_11_0_universal2 \
663 --only-binary=:all
: \
665 # check the imports and execute the unittests
666 INSTALL_PYARROW
=OFF ARROW_FLIGHT
=${check_flight} ARROW_S3
=${check_s3} \
667 arch
-${arch} ${ARROW_DIR}/ci/scripts/python_wheel_unix_test.sh ${ARROW_DIR}
676 clone_testing_repositories
678 local download_dir
=binaries
679 mkdir
-p ${download_dir}
681 if [ "$(uname)" == "Darwin" ]; then
682 local filter_regex
=.
*macosx.
*
684 local filter_regex
=.
*manylinux.
*
687 python
$SOURCE_DIR/download_rc_binaries.py
$VERSION $RC_NUMBER \
688 --package_type python \
689 --regex=${filter_regex} \
690 --dest=${download_dir}
692 verify_dir_artifact_signatures
${download_dir}
694 pushd ${download_dir}
696 if [ "$(uname)" == "Darwin" ]; then
705 # By default test all functionalities.
706 # To deactivate one test, deactivate the test and all of its dependents
707 # To explicitly select one test, set TEST_DEFAULT=0 TEST_X=1
709 # Install NodeJS locally for running the JavaScript tests rather than using the
710 # system Node installation, which may be too old.
713 if [ "${ARTIFACT}" == "source" ]; then
715 elif [ "${ARTIFACT}" == "wheels" ]; then
718 TEST_BINARY_DISTRIBUTIONS
=1
722 : ${TEST_BINARY_DISTRIBUTIONS:=0}
725 : ${TEST_JAVA:=${TEST_DEFAULT}}
726 : ${TEST_CPP:=${TEST_DEFAULT}}
727 : ${TEST_CSHARP:=${TEST_DEFAULT}}
728 : ${TEST_GLIB:=${TEST_DEFAULT}}
729 : ${TEST_RUBY:=${TEST_DEFAULT}}
730 : ${TEST_PYTHON:=${TEST_DEFAULT}}
731 : ${TEST_JS:=${TEST_DEFAULT}}
732 : ${TEST_GO:=${TEST_DEFAULT}}
733 : ${TEST_INTEGRATION:=${TEST_DEFAULT}}
734 if [ ${TEST_BINARY_DISTRIBUTIONS} -gt 0 ]; then
735 TEST_BINARY_DISTRIBUTIONS_DEFAULT
=${TEST_DEFAULT}
737 TEST_BINARY_DISTRIBUTIONS_DEFAULT
=0
739 : ${TEST_BINARY:=${TEST_BINARY_DISTRIBUTIONS_DEFAULT}}
740 : ${TEST_APT:=${TEST_BINARY_DISTRIBUTIONS_DEFAULT}}
741 : ${TEST_YUM:=${TEST_BINARY_DISTRIBUTIONS_DEFAULT}}
743 # For selective Integration testing, set TEST_DEFAULT=0 TEST_INTEGRATION_X=1 TEST_INTEGRATION_Y=1
744 : ${TEST_INTEGRATION_CPP:=${TEST_INTEGRATION}}
745 : ${TEST_INTEGRATION_JAVA:=${TEST_INTEGRATION}}
746 : ${TEST_INTEGRATION_JS:=${TEST_INTEGRATION}}
747 : ${TEST_INTEGRATION_GO:=${TEST_INTEGRATION}}
749 # Automatically test if its activated by a dependent
750 TEST_GLIB
=$
((${TEST_GLIB} + ${TEST_RUBY}))
751 TEST_CPP
=$
((${TEST_CPP} + ${TEST_GLIB} + ${TEST_PYTHON} + ${TEST_INTEGRATION_CPP}))
752 TEST_JAVA
=$
((${TEST_JAVA} + ${TEST_INTEGRATION_JAVA}))
753 TEST_JS
=$
((${TEST_JS} + ${TEST_INTEGRATION_JS}))
754 TEST_GO
=$
((${TEST_GO} + ${TEST_INTEGRATION_GO}))
755 TEST_INTEGRATION
=$
((${TEST_INTEGRATION} + ${TEST_INTEGRATION_CPP} + ${TEST_INTEGRATION_JAVA} + ${TEST_INTEGRATION_JS} + ${TEST_INTEGRATION_GO}))
757 if [ "${ARTIFACT}" == "source" ]; then
758 NEED_MINICONDA
=$
((${TEST_CPP} + ${TEST_INTEGRATION}))
759 elif [ "${ARTIFACT}" == "wheels" ]; then
760 NEED_MINICONDA
=$
((${TEST_WHEELS}))
762 if [ -z "${PYTHON:-}" ]; then
763 NEED_MINICONDA
=$
((${TEST_BINARY}))
769 : ${TEST_ARCHIVE:=apache-arrow-${VERSION}.tar.gz}
770 case "${TEST_ARCHIVE}" in
774 TEST_ARCHIVE
=${PWD}/${TEST_ARCHIVE}
780 setup_tempdir
"arrow-${VERSION}"
781 echo "Working in sandbox ${ARROW_TMPDIR}"
784 if [ ${NEED_MINICONDA} -gt 0 ]; then
788 if [ "${ARTIFACT}" == "source" ]; then
789 dist_name
="apache-arrow-${VERSION}"
790 if [ ${TEST_SOURCE} -gt 0 ]; then
792 if [ ! -d "${dist_name}" ]; then
793 fetch_archive
${dist_name}
794 tar xf
${dist_name}.
tar.gz
797 mkdir
-p ${dist_name}
798 if [ ! -f ${TEST_ARCHIVE} ]; then
799 echo "${TEST_ARCHIVE} not found"
802 tar xf
${TEST_ARCHIVE} -C ${dist_name} --strip-components=1
805 test_source_distribution
807 elif [ "${ARTIFACT}" == "wheels" ]; then
812 test_binary_distribution
816 echo 'Release candidate looks good!'