Skip to content

Apache DataFusion SQL Query Engine

ARROW-3070: [Packaging] Use Bintray

Kouhei Sutoub6c760ba21f1
diff --git a/dev/release/02-source.sh b/dev/release/02-source.sh
index f74fd81115..e224584223 100755
--- a/dev/release/02-source.sh
+++ b/dev/release/02-source.sh
@@ -21,34 +21,13 @@ set -e
SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-if [ "$#" -ne 3 ]; then
- echo "Usage: $0 <version> <rc-num> <artifact_dir>"
+if [ "$#" -ne 2 ]; then
+ echo "Usage: $0 <version> <rc-num>"
exit
fi
version=$1
rc=$2
-artifact_dir=$3
-
-if [ -d tmp/ ]; then
- echo "Cannot run: tmp/ exists"
- exit
-fi
-
-if [ -z "$artifact_dir" ]; then
- echo "artifact_dir is empty"
- exit 1
-fi
-
-if [ ! -e "$artifact_dir" ]; then
- echo "$artifact_dir does not exist"
- exit 1
-fi
-
-if [ ! -d "$artifact_dir" ]; then
- echo "$artifact_dir is not a directory"
- exit 1
-fi
tag=apache-arrow-${version}
tagrc=${tag}-rc${rc}
@@ -122,14 +101,11 @@ shasum -a 512 $tarball > ${tarball}.sha512
svn co --depth=empty https://dist.apache.org/repos/dist/dev/arrow tmp
# add the release candidate for the tag
-mkdir -p tmp/${tagrc}/binaries
+mkdir -p tmp/${tagrc}
# copy the rc tarball into the tmp dir
cp ${tarball}* tmp/${tagrc}
-# copy binary artifacts into a subdirectory of the rc dir
-cp -rf "$artifact_dir"/* tmp/${tagrc}/binaries/
-
# commit to svn
svn add tmp/${tagrc}
svn ci -m "Apache Arrow ${version} RC${rc}" tmp/${tagrc}
diff --git a/dev/release/03-binary.sh b/dev/release/03-binary.sh
index 465b819c21..976b317db0 100755
--- a/dev/release/03-binary.sh
+++ b/dev/release/03-binary.sh
@@ -1,4 +1,5 @@
#!/bin/bash
+# -*- indent-tabs-mode: nil; sh-indentation: 2; sh-basic-offset: 2 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
@@ -18,22 +19,31 @@
# under the License.
#
set -e
+set -o pipefail
SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-if [ "$#" -ne 3 ]; then
- echo "Usage: $0 <version> <rc-num> <artifact_dir>"
+if [ "$#" -ne 4 ]; then
+ echo "Usage: $0 <version> <rc-num> <gpg-key-id> <artifact-dir>"
exit
fi
version=$1
rc=$2
-artifact_dir=$3
+gpg_key_id=$3
+artifact_dir=$4
-if [ -d tmp/ ]; then
- echo "Cannot run: tmp/ exists"
- exit
+docker_image_name=apache-arrow/release-binary
+docker_gpg_ssh_port=10022
+gpg_agent_extra_socket="$(gpgconf --list-dirs agent-extra-socket)"
+if [ $(uname) = "Darwin" ]; then
+ docker_uid=10000
+ docker_gid=10000
+else
+ docker_uid=$(id -u)
+ docker_gid=$(id -g)
fi
+docker_ssh_key="${SOURCE_DIR}/binary/id_rsa"
if [ -z "$artifact_dir" ]; then
echo "artifact_dir is empty"
@@ -50,26 +60,484 @@ if [ ! -d "$artifact_dir" ]; then
exit 1
fi
-tag=apache-arrow-${version}
-tagrc=${tag}-rc${rc}
+if [ -z "${BINTRAY_PASSWORD}" ]; then
+ echo "BINTRAY_PASSWORD is empty"
+ exit 1
+fi
+
+: ${BINTRAY_REPOSITORY:=apache/arrow}
+
+docker_run() {
+ docker \
+ run \
+ --rm \
+ --tty \
+ --interactive \
+ --user ${docker_uid}:${docker_gid} \
+ --volume "$PWD":/host \
+ ${docker_image_name} \
+ bash -c "cd /host && $*"
+}
+
+docker_gpg_ssh() {
+ ssh \
+ -o StrictHostKeyChecking=no \
+ -i "${docker_ssh_key}" \
+ -p ${docker_gpg_ssh_port} \
+ -R "/home/arrow/.gnupg/S.gpg-agent:${gpg_agent_extra_socket}" \
+ "$@"
+}
+
+docker_run_gpg_ready() {
+ local docker_container_id_file=/tmp/arrow-binary-gpg-container-id
+ if [ -f ${docker_container_id_file} ]; then
+ docker kill $(cat ${docker_container_id_file}) || :
+ rm -rf ${docker_container_id_file}
+ fi
+ docker \
+ run \
+ --rm \
+ --detach \
+ --cidfile ${docker_container_id_file} \
+ --publish ${docker_gpg_ssh_port}:22 \
+ --volume "$PWD":/host \
+ ${docker_image_name} \
+ bash -c "
+if [ \$(id -u) -ne ${docker_uid} ]; then
+ usermod --uid ${docker_uid} arrow
+ chown -R arrow: ~arrow
+fi
+/usr/sbin/sshd -D
+"
+ sleep 1 # Wait for sshd available
+ gpg --export ${gpg_key_id} | docker_gpg_ssh gpg --import
+ docker_gpg_ssh "cd /host && $@"
+ docker kill $(cat ${docker_container_id_file})
+ rm -f ${docker_container_id_file}
+}
+
+jq() {
+ docker \
+ run \
+ --rm \
+ --interactive \
+ ${docker_image_name} \
+ jq "$@"
+}
+
+bintray() {
+ local command=$1
+ shift
+ local path=$1
+ shift
+ local url=https://bintray.com/api/v1${path}
+ echo "${command} ${url}" 1>&2
+ curl \
+ --fail \
+ --basic \
+ --user "${BINTRAY_USER:-$USER}:${BINTRAY_PASSWORD}" \
+ --header "Content-Type: application/json" \
+ --request ${command} \
+ ${url} \
+ "$@" | \
+ jq .
+}
+
+ensure_version() {
+ local version=$1
+ local rc=$2
+ local target=$3
+
+ local version_name=${version}-rc${rc}
+
+ if ! bintray \
+ GET \
+ /packages/${BINTRAY_REPOSITORY}/${target}-rc/versions/${version_name}; then
+ bintray \
+ POST /packages/${BINTRAY_REPOSITORY}/${target}-rc/versions \
+ --data-binary "
+{
+ \"name\": \"${version_name}\",
+ \"desc\": \"Apache Arrow ${version} RC${rc}.\"
+}
+"
+ fi
+}
+
+download_files() {
+ local version=$1
+ local rc=$2
+ local target=$3
+
+ local version_name=${version}-rc${rc}
+
+ local files=$(
+ bintray \
+ GET /packages/${BINTRAY_REPOSITORY}/${target}-rc/versions/${version_name}/files | \
+ jq -r ".[].path")
+
+ for file in ${files}; do
+ mkdir -p "$(dirname ${file})"
+ curl \
+ --fail \
+ --location \
+ --output ${file} \
+ https://dl.bintray.com/${BINTRAY_REPOSITORY}/${file}
+ done
+}
+
+delete_file() {
+ local version=$1
+ local rc=$2
+ local target=$3
+ local upload_path=$4
+
+ local version_name=${version}-rc${rc}
+
+ bintray \
+ DELETE /content/${BINTRAY_REPOSITORY}/${target}-rc/${upload_path}
+}
+
+upload_file() {
+ local version=$1
+ local rc=$2
+ local target=$3
+ local local_path=$4
+ local upload_path=$5
+
+ local version_name=${version}-rc${rc}
+
+ local sha256=$(shasum -a 256 ${local_path} | awk '{print $1}')
+ local request_path=/content/${BINTRAY_REPOSITORY}/${target}-rc/${version_name}/${target}-rc/${upload_path}
+ if ! bintray \
+ PUT ${request_path} \
+ --header "X-Bintray-Publish: 1" \
+ --header "X-Bintray-Override: 1" \
+ --header "X-Checksum-Sha2: ${sha256}" \
+ --data-binary "@${local_path}"; then
+ delete_file ${version} ${rc} ${target} ${upload_path}
+ bintray \
+ PUT ${request_path} \
+ --header "X-Bintray-Publish: 1" \
+ --header "X-Bintray-Override: 1" \
+ --header "X-Checksum-Sha2: ${sha256}" \
+ --data-binary "@${local_path}"
+ fi
+}
+
+sign_and_upload_file() {
+ local version=$1
+ local rc=$2
+ local target=$3
+ local local_path=$4
+ local upload_path=$5
+
+ upload_file ${version} ${rc} ${target} ${local_path} ${upload_path}
+
+ for suffix in asc sha256 sha512; do
+ pushd $(dirname ${local_path})
+ local local_path_base=$(basename ${local_path})
+ local output=tmp.${suffix}
+ case $suffix in
+ asc)
+ docker_run_gpg_ready gpg \
+ --local-user ${gpg_key_id} \
+ --detach-sig \
+ --output ${output} \
+ ${local_path_base}
+ ;;
+ sha*)
+ shasum \
+ --algorithm $(echo $suffix | sed -e 's/^sha//') \
+ ${local_path_base} > ${output}
+ ;;
+ esac
+ upload_file ${version} ${rc} ${target} ${output} ${upload_path}.${suffix}
+ rm -f ${output}
+ popd
+ done
+}
+
+upload_deb() {
+ local version=$1
+ local rc=$2
+ local distribution=$3
+ local code_name=$4
+
+ ensure_version ${version} ${rc} ${distribution}
+
+ for base_path in *; do
+ case ${base_path} in
+ *.dsc|*.changes)
+ docker_run_gpg_ready debsign -k${gpg_key_id} --re-sign ${base_path}
+ ;;
+ *.asc|*.sha256|*.sha512)
+ continue
+ ;;
+ esac
+ sign_and_upload_file \
+ ${version} \
+ ${rc} \
+ ${distribution} \
+ ${base_path} \
+ pool/${code_name}/main/a/apache-arrow/${base_path}
+ done
+}
-# check out the arrow RC folder
-svn co https://dist.apache.org/repos/dist/dev/arrow/${tagrc} tmp
+upload_apt() {
+ local version=$1
+ local rc=$2
+ local distribution=$3
-# ensure directories for binary artifacts
-mkdir -p tmp/binaries
+ local tmp_dir=tmp/${distribution}
+ rm -rf ${tmp_dir}
+ mkdir -p ${tmp_dir}
+ pushd ${tmp_dir}
-# copy binary artifacts
-cp -rf "$artifact_dir"/* tmp/binaries/
+ download_files ${version} ${rc} ${distribution}
-# commit to svn
-for dir in "$artifact_dir"/*; do
- svn add tmp/binaries/$(basename $dir)
+ pushd ${distribution}-rc
+
+ local keyring_name=apache-arrow-keyring.gpg
+ rm -f ${keyring_name}
+ curl --fail https://dist.apache.org/repos/dist/dev/arrow/KEYS | \
+ gpg \
+ --no-default-keyring \
+ --keyring ./${keyring_name} \
+ --import - || : # XXX: Ignore gpg error
+ sign_and_upload_file \
+ ${version} \
+ ${rc} \
+ ${distribution} \
+ ${keyring_name} \
+ ${keyring_name}
+
+ for pool_code_name in pool/*; do
+ local code_name=$(basename ${pool_code_name})
+ local dist=dists/${code_name}/main
+ rm -rf dists
+ mkdir -p ${dist}/{source,binary-amd64}
+ docker_run apt-ftparchive \
+ sources pool/${code_name} > \
+ dists/${code_name}/main/source/Sources
+ gzip --keep dists/${code_name}/main/source/Sources
+ xz --keep dists/${code_name}/main/source/Sources
+ docker_run apt-ftparchive \
+ packages pool/${code_name} > \
+ dists/${code_name}/main/binary-amd64/Packages
+ gzip --keep dists/${code_name}/main/binary-amd64/Packages
+ xz --keep dists/${code_name}/main/binary-amd64/Packages
+ docker_run apt-ftparchive \
+ contents pool/${code_name} > \
+ dists/${code_name}/main/Contents-amd64
+ gzip --keep dists/${code_name}/main/Contents-amd64
+ docker_run apt-ftparchive \
+ release \
+ -o "APT::FTPArchive::Release::Origin=Apache\\ Arrow" \
+ -o "APT::FTPArchive::Release::Label=Apache\\ Arrow" \
+ -o APT::FTPArchive::Release::Codename=${code_name} \
+ -o APT::FTPArchive::Release::Architectures=amd64 \
+ -o APT::FTPArchive::Release::Components=main \
+ dists/${code_name} > \
+ dists/${code_name}/Release
+ gpg \
+ --local-user ${gpg_key_id} \
+ --sign \
+ --detach-sign \
+ --armor \
+ --output dists/${code_name}/Release.gpg \
+ dists/${code_name}/Release
+
+ for path in $(find dists/${code_name}/ -type f); do
+ sign_and_upload_file \
+ ${version} \
+ ${rc} \
+ ${distribution} \
+ ${path} \
+ ${path}
+ done
+ done
+
+ popd
+
+ popd
+ rm -rf ${tmp_dir}
+}
+
+upload_rpm() {
+ local version=$1
+ local rc=$2
+ local distribution=$3
+ local distribution_version=$4
+
+ local version_name=${version}-rc${rc}
+
+ ensure_version ${version} ${rc} ${distribution}
+
+ for rpm_path in *.rpm; do
+ local upload_path=${distribution_version}
+ case ${base_path} in
+ *.src.rpm)
+ upload_path=${upload_path}/Source/SPackages
+ ;;
+ *)
+ upload_path=${upload_path}/x86_64/Packages
+ ;;
+ esac
+ upload_path=${upload_path}/${rpm_path}
+ docker_run_gpg_ready rpm \
+ -D "_gpg_name\\ ${gpg_key_id}" \
+ --addsign \
+ ${rpm_path}
+ sign_and_upload_file \
+ ${version} \
+ ${rc} \
+ ${distribution} \
+ ${rpm_path} \
+ ${upload_path}
+ done
+}
+
+upload_yum() {
+ local version=$1
+ local rc=$2
+ local distribution=$3
+
+ local version_name=${version}-rc${rc}
+
+ local tmp_dir=tmp/${distribution}
+ rm -rf ${tmp_dir}
+ mkdir -p ${tmp_dir}
+ pushd ${tmp_dir}
+
+ download_files ${version} ${rc} ${distribution}
+
+ pushd ${distribution}-rc
+ local keyring_name=RPM-GPG-KEY-apache-arrow
+ curl -o ${keyring_name} https://dist.apache.org/repos/dist/dev/arrow/KEYS
+ sign_and_upload_file \
+ ${version} \
+ ${rc} \
+ ${distribution} \
+ ${keyring_name} \
+ ${keyring_name}
+ for version_dir in $(find . -mindepth 1 -maxdepth 1 -type d); do
+ for arch_dir in ${version_dir}/*; do
+ mkdir -p ${arch_dir}/repodata/
+ docker_run createrepo ${arch_dir}
+ for repo_path in ${arch_dir}/repodata/*; do
+ sign_and_upload_file \
+ ${version} \
+ ${rc} \
+ ${distribution} \
+ ${repo_path} \
+ ${repo_path}
+ done
+ done
+ done
+ popd
+
+ popd
+ rm -rf ${tmp_dir}
+}
+
+upload_python() {
+ local version=$1
+ local rc=$2
+ local target=python
+
+ ensure_version ${version} ${rc} ${target}
+
+ for base_path in *; do
+ case ${base_path} in
+ *.asc|*.sha256|*.sha512)
+ continue
+ ;;
+ esac
+ sign_and_upload_file \
+ ${version} \
+ ${rc} \
+ ${target} \
+ ${base_path} \
+ ${version}-rc${rc}/${base_path}
+ done
+}
+
+docker build -t ${docker_image_name} ${SOURCE_DIR}/binary
+
+chmod go-rwx "${docker_ssh_key}"
+
+have_debian=no
+have_ubuntu=no
+have_centos=no
+have_python=no
+pushd "${artifact_dir}"
+for dir in *; do
+ is_deb=no
+ is_rpm=no
+ is_python=no
+ case ${dir} in
+ debian-*)
+ distribution=debian
+ code_name=$(echo ${dir} | sed -e 's/^debian-//')
+ is_deb=yes
+ have_debian=yes
+ ;;
+ ubuntu-*)
+ distribution=ubuntu
+ code_name=$(echo ${dir} | sed -e 's/^ubuntu-//')
+ is_deb=yes
+ have_ubuntu=yes
+ ;;
+ centos-*)
+ distribution=centos
+ distribution_version=$(echo ${dir} | sed -e 's/^centos-//')
+ is_rpm=yes
+ have_centos=yes
+ ;;
+ conda-*|wheel-*)
+ is_python=yes
+ have_python=yes
+ ;;
+ esac
+
+ if [ ${is_deb} = "yes" ]; then
+ pushd ${dir}
+ upload_deb ${version} ${rc} ${distribution} ${code_name}
+ popd
+ elif [ ${is_rpm} = "yes" ]; then
+ pushd ${dir}
+ upload_rpm ${version} ${rc} ${distribution} ${distribution_version}
+ popd
+ elif [ ${is_python} = "yes" ]; then
+ pushd ${dir}
+ upload_python ${version} ${rc}
+ popd
+ fi
done
-svn ci -m "Apache Arrow ${version} RC${rc} binaries" tmp/
+popd
-# clean up
-rm -rf tmp
+if [ ${have_debian} = "yes" ]; then
+ upload_apt ${version} ${rc} debian
+fi
+if [ ${have_ubuntu} = "yes" ]; then
+ upload_apt ${version} ${rc} ubuntu
+fi
+if [ ${have_centos} = "yes" ]; then
+ upload_yum ${version} ${rc} centos
+fi
echo "Success! The release candidate binaries are available here:"
-echo " https://dist.apache.org/repos/dist/dev/arrow/${tagrc}/binaries"
+if [ ${have_debian} = "yes" ]; then
+ echo " https://bintray.com/${BINTRAY_REPOSITORY}/debian-rc/${version}-rc${rc}"
+fi
+if [ ${have_ubuntu} = "yes" ]; then
+ echo " https://bintray.com/${BINTRAY_REPOSITORY}/ubuntu-rc/${version}-rc${rc}"
+fi
+if [ ${have_centos} = "yes" ]; then
+ echo " https://bintray.com/${BINTRAY_REPOSITORY}/centos-rc/${version}-rc${rc}"
+fi
+if [ ${have_python} = "yes" ]; then
+ echo " https://bintray.com/${BINTRAY_REPOSITORY}/python-rc/${version}-rc${rc}"
+fi
diff --git a/dev/release/binary/Dockerfile b/dev/release/binary/Dockerfile
new file mode 100644
index 0000000000..047020640c
--- /dev/null
+++ b/dev/release/binary/Dockerfile
@@ -0,0 +1,55 @@
+# 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.
+
+FROM ubuntu:18.04
+
+ENV DEBIAN_FRONTEND noninteractive
+
+ARG DEBUG
+
+RUN \
+ quiet=$([ "${DEBUG}" = "yes" ] || echo "-qq") && \
+ apt update ${quiet} && \
+ apt install -y -V ${quiet} \
+ apt-utils \
+ createrepo \
+ devscripts \
+ gpg \
+ jq \
+ openssh-server \
+ rpm \
+ sudo && \
+ apt clean && \
+ rm -rf /var/lib/apt/lists/*
+
+RUN mkdir -p /run/sshd
+RUN echo "StreamLocalBindUnlink yes" >> /etc/ssh/sshd_config
+
+ENV ARROW_USER arrow
+ENV ARROW_UID 10000
+
+RUN \
+ groupadd --gid ${ARROW_UID} ${ARROW_USER} && \
+ useradd --uid ${ARROW_UID} --gid ${ARROW_UID} --create-home ${ARROW_USER} && \
+ mkdir -p /home/arrow/.gnupg /home/arrow/.ssh && \
+ chown -R arrow: /home/arrow/.gnupg /home/arrow/.ssh && \
+ chmod -R og-rwx /home/arrow/.gnupg /home/arrow/.ssh
+
+COPY id_rsa.pub /home/arrow/.ssh/authorized_keys
+RUN \
+ chown -R arrow: /home/arrow/.ssh && \
+ chmod -R og-rwx /home/arrow/.ssh
diff --git a/dev/release/binary/id_rsa b/dev/release/binary/id_rsa
new file mode 100644
index 0000000000..e0fb3dddf0
--- /dev/null
+++ b/dev/release/binary/id_rsa
@@ -0,0 +1,44 @@
+-----BEGIN OPENSSH PRIVATE KEY-----
+b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABFwAAAAdzc2gtcn
+NhAAAAAwEAAQAAAQEArqq7sMjiHbD5d3DlMgHqH7xor9KF7jbihKSiNeQ8rYgMZjuKEYnA
+Uw445fISgoDnlAyOymLsir4Bu6tu8BPOvXTkKXhS5JQJ7tMPTxaa2Im4+O0uo6qxYn5+Xr
+riK9h4c5TAs701s3NmFMcFoBbrtfpeyARuRE5j5ApC7/g2Rvnpm7IQ6rEr0snSThKeLPBo
+qzI6tBwD8wRkSiF6WvoV7HiHwndAD7Hwo33LaYP+TrReV0xg/09MU7JNRdGIZbj4mM/dAX
+27Tt9WM/NBx2PTdZreqBcxf428f1QHf+mm8q58YQJkjuv/ZeaYMuaVKot5DjEXp5QB2P5i
+7HnXuBf1TQAAA8imbngXpm54FwAAAAdzc2gtcnNhAAABAQCuqruwyOIdsPl3cOUyAeofvG
+iv0oXuNuKEpKI15DytiAxmO4oRicBTDjjl8hKCgOeUDI7KYuyKvgG7q27wE869dOQpeFLk
+lAnu0w9PFprYibj47S6jqrFifn5euuIr2HhzlMCzvTWzc2YUxwWgFuu1+l7IBG5ETmPkCk
+Lv+DZG+embshDqsSvSydJOEp4s8GirMjq0HAPzBGRKIXpa+hXseIfCd0APsfCjfctpg/5O
+tF5XTGD/T0xTsk1F0YhluPiYz90BfbtO31Yz80HHY9N1mt6oFzF/jbx/VAd/6abyrnxhAm
+SO6/9l5pgy5pUqi3kOMRenlAHY/mLsede4F/VNAAAAAwEAAQAAAQBKCG/ZdKvyrcpvR9i9
+o3Ya0X8F1xORbo4Abs+aTA0z+FBZHK9e06ZDDeor/Li/u+dsJw521gswm2ycoQM6mwqr3t
+m+ghOQcvbq1WbNvOURFv7h85YrJPRerQLfIBMxRmV3h/tNs8sJLsZ71AecXVq3HVIDMW2T
+Yi6Qv5Czqd9HoX6MnNJ6uPUsCKNjwCc7/Sfaa+ETC6a5dRPIOLnG7ZEqoSDJ+kcJxCq/Nz
+m2AKuEWSVyVOKm0Iv+eK0nrwX8Eg/nxi8Jiw/q74xNixAQSgjm1Mh6YZ9wF/bF+dQXUDkr
+vmtQIpaBnwEXKmfDX4C4Ivi3bfnxB4+ge0W6uBXzv5g5AAAAgQDGa/I1KK7HBbAsdDp6Sb
+eVAqnhzSYCYJrlzErBCqhzS4XYTmN/kc/hMVSD7F/uZSh2w0lcggEKClJZzDTAiX4c5zgH
+iBdezdKxqgZdk1doeReg95jXf6ytdRndPitsa8T0OE4PMI/S5B3AklrMQG/5ltrmp6rSNM
+V+qqf2105+zAAAAIEA1wRNf/JUPTzrPL3UFJK0iSIdiGH40/sOMXpSVtxrzt/QEBVWxIgm
+tuqFyPqT3tc87fCmXC1LVOWLcxuBvNXWO8iQf5JuotJIVgxA0pwtkDryP7tOlpzNDhiJUm
+5x/VTHpjguBzMR7+l+sD0RzdcYN/XC8talgXvaINUAipH7bd8AAACBAM/1kSSTnqR68Tlh
+1kvaveSW9mY1C5jDC7Jwu6NEZBFWU9Vyha623aEq8507LYYasWQFAw3DONvF6waenXOdFR
+yt1Z0sdrl4cpYWj6znLdjCPwytBuNOnxJuhxSI4m8PIeHp9ZweCS8mezIYYRS+OpGHQS0H
+CKG5n9eAGEBgi2pTAAAAC2tvdUBtb3VzaWFuAQIDBAUGBw==
+-----END OPENSSH PRIVATE KEY-----
+
+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.
diff --git a/dev/release/binary/id_rsa.pub b/dev/release/binary/id_rsa.pub
new file mode 100644
index 0000000000..11120e8536
--- /dev/null
+++ b/dev/release/binary/id_rsa.pub
@@ -0,0 +1,18 @@
+# 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.
+
+ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCuqruwyOIdsPl3cOUyAeofvGiv0oXuNuKEpKI15DytiAxmO4oRicBTDjjl8hKCgOeUDI7KYuyKvgG7q27wE869dOQpeFLklAnu0w9PFprYibj47S6jqrFifn5euuIr2HhzlMCzvTWzc2YUxwWgFuu1+l7IBG5ETmPkCkLv+DZG+embshDqsSvSydJOEp4s8GirMjq0HAPzBGRKIXpa+hXseIfCd0APsfCjfctpg/5OtF5XTGD/T0xTsk1F0YhluPiYz90BfbtO31Yz80HHY9N1mt6oFzF/jbx/VAd/6abyrnxhAmSO6/9l5pgy5pUqi3kOMRenlAHY/mLsede4F/VN kou@mousian
diff --git a/dev/release/post-02-binary.sh b/dev/release/post-02-binary.sh
new file mode 100755
index 0000000000..1a61c9a187
--- /dev/null
+++ b/dev/release/post-02-binary.sh
@@ -0,0 +1,168 @@
+#!/bin/bash
+# -*- indent-tabs-mode: nil; sh-indentation: 2; sh-basic-offset: 2 -*-
+#
+# 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.
+#
+set -e
+set -o pipefail
+
+SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+
+if [ "$#" -ne 2 ]; then
+ echo "Usage: $0 <version> <rc-num>"
+ exit
+fi
+
+version=$1
+rc=$2
+
+if [ -z "${BINTRAY_PASSWORD}" ]; then
+ echo "BINTRAY_PASSWORD is empty"
+ exit 1
+fi
+
+: ${BINTRAY_REPOSITORY:=apache/arrow}
+
+docker_image_name=apache-arrow/release-binary
+
+jq() {
+ docker \
+ run \
+ --rm \
+ --interactive \
+ ${docker_image_name} \
+ jq "$@"
+}
+
+bintray() {
+ local command=$1
+ shift
+ local path=$1
+ shift
+ local url=https://bintray.com/api/v1${path}
+ echo "${command} ${url}" 1>&2
+ curl \
+ --fail \
+ --basic \
+ --user "${BINTRAY_USER:-$USER}:${BINTRAY_PASSWORD}" \
+ --header "Content-Type: application/json" \
+ --request ${command} \
+ ${url} \
+ "$@" | \
+ jq .
+}
+
+ensure_version() {
+ local version=$1
+ local target=$2
+
+ if ! bintray \
+ GET \
+ /packages/${BINTRAY_REPOSITORY}/${target}/versions/${version}; then
+ bintray \
+ POST /packages/${BINTRAY_REPOSITORY}/${target}/versions \
+ --data-binary "
+{
+ \"name\": \"${version}\",
+ \"desc\": \"Apache Arrow ${version}.\"
+}
+"
+ fi
+}
+
+download_files() {
+ local version=$1
+ local rc=$2
+ local target=$3
+
+ local version_name=${version}-rc${rc}
+
+ local files=$(
+ bintray \
+ GET /packages/${BINTRAY_REPOSITORY}/${target}-rc/versions/${version_name}/files | \
+ jq -r ".[].path")
+
+ for file in ${files}; do
+ mkdir -p "$(dirname ${file})"
+ curl \
+ --fail \
+ --location \
+ --output ${file} \
+ https://dl.bintray.com/${BINTRAY_REPOSITORY}/${file}
+ done
+}
+
+delete_file() {
+ local version=$1
+ local target=$2
+ local path=$3
+
+ bintray \
+ DELETE /content/${BINTRAY_REPOSITORY}/${target}/${path}
+}
+
+upload_file() {
+ local version=$1
+ local target=$2
+ local path=$3
+
+ local sha256=$(shasum -a 256 ${path} | awk '{print $1}')
+ local request_path=/content/${BINTRAY_REPOSITORY}/${target}/${version}/${target}/${path}
+ if ! bintray \
+ PUT ${request_path} \
+ --header "X-Bintray-Publish: 1" \
+ --header "X-Bintray-Override: 1" \
+ --header "X-Checksum-Sha2: ${sha256}" \
+ --data-binary "@${path}"; then
+ delete_file ${version} ${target} ${path}
+ bintray \
+ PUT ${request_path} \
+ --header "X-Bintray-Publish: 1" \
+ --header "X-Bintray-Override: 1" \
+ --header "X-Checksum-Sha2: ${sha256}" \
+ --data-binary "@${path}"
+ fi
+}
+
+docker build -t ${docker_image_name} ${SOURCE_DIR}/binary
+
+for target in debian ubuntu centos python; do
+ tmp_dir=tmp/${target}
+ rm -rf ${tmp_dir}
+ mkdir -p ${tmp_dir}
+ pushd ${tmp_dir}
+ ensure_version ${version} ${target}
+ download_files ${version} ${rc} ${target}
+ mv ${target}-rc ${target}
+ pushd ${target}
+ if [ ${target} = "python" ]; then
+ mv ${version}-rc${rc} ${version}
+ fi
+ for file in $(find . -type f); do
+ upload_file ${version} ${target} ${file}
+ done
+ popd
+ popd
+ rm -rf ${tmp_dir}
+done
+
+echo "Success! The release binaries are available here:"
+echo " https://bintray.com/${BINTRAY_REPOSITORY}/debian/${version}"
+echo " https://bintray.com/${BINTRAY_REPOSITORY}/ubuntu/${version}"
+echo " https://bintray.com/${BINTRAY_REPOSITORY}/centos/${version}"
+echo " https://bintray.com/${BINTRAY_REPOSITORY}/python/${version}"
diff --git a/site/install.md b/site/install.md
index 39e69d4149..d72323d6dd 100644
--- a/site/install.md
+++ b/site/install.md
@@ -69,7 +69,7 @@ in `requirements.txt` to install the latest patch release.
These include the Apache Arrow and Apache Parquet C++ binary libraries bundled
with the wheel.
-### C++ and GLib (C) Packages for Debian GNU/Linux, Ubuntu and CentOS (Unofficial)
+### C++ and GLib (C) Packages for Debian GNU/Linux, Ubuntu and CentOS
We have provided APT and Yum repositories for Apache Arrow C++ and
Apache Arrow GLib (C). Here are supported platforms:
@@ -81,50 +81,19 @@ Apache Arrow GLib (C). Here are supported platforms:
* CentOS 6
* CentOS 7
-Debian GNU/Linux:
+Debian GNU/Linux and Ubuntu:
```shell
-sudo apt install -y -V apt-transport-https
-sudo apt install -y -V lsb-release
-sudo wget -O /usr/share/keyrings/red-data-tools-keyring.gpg https://packages.red-data-tools.org/$(lsb_release --id --short | tr 'A-Z' 'a-z')/red-data-tools-keyring.gpg
-sudo tee /etc/apt/sources.list.d/red-data-tools.list <<APT_LINE
-deb [signed-by=/usr/share/keyrings/red-data-tools-keyring.gpg] https://packages.red-data-tools.org/$(lsb_release --id --short | tr 'A-Z' 'a-z')/ $(lsb_release --codename --short) main
-deb-src [signed-by=/usr/share/keyrings/red-data-tools-keyring.gpg] https://packages.red-data-tools.org/$(lsb_release --id --short | tr 'A-Z' 'a-z')/ $(lsb_release --codename --short) main
-APT_LINE
sudo apt update
-sudo apt install -y -V libarrow-dev # For C++
-sudo apt install -y -V libarrow-glib-dev # For GLib (C)
-```
-
-Ubuntu:
-
-```shell
-sudo apt install -y -V apt-transport-https
-sudo apt install -y -V lsb-release
-sudo wget -O /usr/share/keyrings/red-data-tools-keyring.gpg https://packages.red-data-tools.org/$(lsb_release --id --short | tr 'A-Z' 'a-z')/red-data-tools-keyring.gpg
-sudo tee /etc/apt/sources.list.d/red-data-tools.list <<APT_LINE
-deb [signed-by=/usr/share/keyrings/red-data-tools-keyring.gpg] https://packages.red-data-tools.org/$(lsb_release --id --short | tr 'A-Z' 'a-z')/ $(lsb_release --codename --short) universe
-deb-src [signed-by=/usr/share/keyrings/red-data-tools-keyring.gpg] https://packages.red-data-tools.org/$(lsb_release --id --short | tr 'A-Z' 'a-z')/ $(lsb_release --codename --short) universe
+sudo apt install -y -V apt-transport-https lsb-release
+sudo wget -O /usr/share/keyrings/apache-arrow-keyring.gpg https://dl.bintray.com/apache/arrow/$(lsb_release --id --short | tr 'A-Z' 'a-z')/apache-arrow-keyring.gpg
+sudo tee /etc/apt/sources.list.d/apache-arrow.list <<APT_LINE
+deb [arch=amd64 signed-by=/usr/share/keyrings/apache-arrow-keyring.gpg] https://dl.bintray.com/apache/arrow/$(lsb_release --id --short | tr 'A-Z' 'a-z')/ $(lsb_release --codename --short) main
+deb-src [signed-by=/usr/share/keyrings/apache-arrow-keyring.gpg] https://dl.bintray.com/apache/arrow/$(lsb_release --id --short | tr 'A-Z' 'a-z')/ $(lsb_release --codename --short) main
APT_LINE
sudo apt update
sudo apt install -y -V libarrow-dev # For C++
sudo apt install -y -V libarrow-glib-dev # For GLib (C)
-```
-
-CentOS:
-
-```shell
-sudo yum install -y https://packages.red-data-tools.org/centos/red-data-tools-release-latest.noarch.rpm
-sudo yum install -y --enablerepo=epel arrow-devel # For C++
-sudo yum install -y --enablerepo=epel arrow-glib-devel # For GLib (C)
-```
-
-These repositories also provide Apache Parquet C++ and
-Apache Parquet GLib. You can install them by the followings:
-
-Debian GNU/Linux and Ubuntu:
-
-```shell
sudo apt install -y -V libparquet-dev # For Apache Parquet C++
sudo apt install -y -V libparquet-glib-dev # For Parquet GLib (C)
```
@@ -132,21 +101,26 @@ sudo apt install -y -V libparquet-glib-dev # For Parquet GLib (C)
CentOS:
```shell
+sudo tee /etc/yum.repos.d/Apache-Arrow.repo <<REPO
+[apache-arrow]
+name=Apache Arrow
+baseurl=https://dl.bintray.com/apache/arrow/centos/\$releasever/\$basearch/
+gpgcheck=1
+enabled=1
+gpgkey=https://dl.bintray.com/apache/arrow/centos/RPM-GPG-KEY-apache-arrow
+REPO
+sudo yum install -y epel-release
+sudo yum install -y --enablerepo=epel arrow-devel # For C++
+sudo yum install -y --enablerepo=epel arrow-glib-devel # For GLib (C)
sudo yum install -y --enablerepo=epel parquet-devel # For Apache Parquet C++
sudo yum install -y --enablerepo=epel parquet-glib-devel # For Parquet GLib (C)
```
-These repositories are managed at
-[red-data-tools/packages.red-data-tools.org][9]. If you have any
-feedback, please send it to the project instead of Apache Arrow
-project.
-
[1]: {{site.data.versions['current'].mirrors}}
[2]: {{site.data.versions['current'].github-tag-link}}
[4]: {{site.data.versions['current'].java-artifacts}}
[5]: http://conda-forge.github.io
[6]: {{site.data.versions['current'].mirrors-tar}}
-[9]: https://github.com/red-data-tools/packages.red-data-tools.org
[10]: {{site.data.versions['current'].release-notes}}
[11]: http://www.apache.org/dist/arrow/KEYS
[12]: https://www.apache.org/dyn/closer.cgi#verify