Skip to content

Apache DataFusion SQL Query Engine

ARROW-6639: [Packaging][RPM] Add support for CentOS 7 on aarch64

Sutou Kouhei1f3acf57e8b7
diff --git a/dev/tasks/linux-packages/azure.linux.arm64.yml b/dev/tasks/linux-packages/azure.linux.arm64.yml
index 3b61474752..080c9dbc53 100644
--- a/dev/tasks/linux-packages/azure.linux.arm64.yml
+++ b/dev/tasks/linux-packages/azure.linux.arm64.yml
@@ -43,8 +43,8 @@ jobs:
rm *.deb
pushd qemu-user-static*
unar data.*
- for docker_context in ../arrow/dev/tasks/linux-packages/apt/*/; do
- cp data/usr/bin/qemu-aarch64-static ${docker_context}
+ for dockerfile in ../arrow/dev/tasks/linux-packages/*/*/Dockerfile; do
+ cp data/usr/bin/qemu-aarch64-static $(dirname ${dockerfile})
done
popd
displayName: Prepare qemu-user-static
diff --git a/dev/tasks/linux-packages/package-task.rb b/dev/tasks/linux-packages/package-task.rb
index e0f70cd3cb..f9173ac828 100644
--- a/dev/tasks/linux-packages/package-task.rb
+++ b/dev/tasks/linux-packages/package-task.rb
@@ -154,7 +154,6 @@ class PackageTask
def define_yum_task
namespace :yum do
- distribution = "centos"
yum_dir = "yum"
repositories_dir = "#{yum_dir}/repositories"
@@ -179,9 +178,7 @@ RELEASE=#{@rpm_release}
ENV
end
- tmp_distribution_dir = "#{tmp_dir}/#{distribution}"
- mkdir_p(tmp_distribution_dir)
- spec = "#{tmp_distribution_dir}/#{@rpm_package}.spec"
+ spec = "#{tmp_dir}/#{@rpm_package}.spec"
spec_in = "#{yum_dir}/#{@rpm_package}.spec.in"
spec_in_data = File.read(spec_in)
spec_data = spec_in_data.gsub(/@(.+?)@/) do |matched|
@@ -201,16 +198,27 @@ RELEASE=#{@rpm_release}
end
cd(yum_dir) do
- distribution_versions = (ENV["CENTOS_VERSIONS"] || "6,7").split(",")
threads = []
- distribution_versions.each do |version|
+ targets = (ENV["YUM_TARGETS"] || "").split(",")
+ if targets.empty?
+ # Disable aarch64 targets by default for now
+ # because they require some setups on host.
+ targets = [
+ "centos-6",
+ "centos-7",
+ # "centos-7-aarch64",
+ ]
+ end
+ targets.each do |target|
+ next unless Dir.exist?(target)
+ distribution, version, architecture = target.split("-", 3)
os = "#{distribution}-#{version}"
if parallel_build?
- threads << Thread.new(os) do |local_os|
- run_docker(local_os)
+ threads << Thread.new(os, architecture) do |*local_values|
+ run_docker(*local_values)
end
else
- run_docker(os)
+ run_docker(os, architecture)
end
end
threads.each(&:join)
@@ -276,8 +284,8 @@ VERSION=#{@deb_upstream_version}
distribution, version, architecture = target.split("-", 3)
os = "#{distribution}-#{version}"
if parallel_build?
- threads << Thread.new(os) do |local_os|
- run_docker(local_os, architecture)
+ threads << Thread.new(os, architecture) do |*local_values|
+ run_docker(*local_values)
end
else
run_docker(os, architecture)
diff --git a/dev/tasks/linux-packages/yum/build.sh b/dev/tasks/linux-packages/yum/build.sh
index 1d15d9d330..1ada8782a4 100755
--- a/dev/tasks/linux-packages/yum/build.sh
+++ b/dev/tasks/linux-packages/yum/build.sh
@@ -90,7 +90,7 @@ else
run cp /host/tmp/${PACKAGE}-${VERSION}.* rpmbuild/SOURCES/
fi
run cp \
- /host/tmp/${distribution}/${PACKAGE}.spec \
+ /host/tmp/${PACKAGE}.spec \
rpmbuild/SPECS/
run cat <<BUILD > build.sh
diff --git a/dev/tasks/linux-packages/yum/centos-7-aarch64/from b/dev/tasks/linux-packages/yum/centos-7-aarch64/from
new file mode 100644
index 0000000000..0a2ae2b83a
--- /dev/null
+++ b/dev/tasks/linux-packages/yum/centos-7-aarch64/from
@@ -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.
+
+arm64v8/centos:7
diff --git a/dev/tasks/linux-packages/yum/centos-7/Dockerfile b/dev/tasks/linux-packages/yum/centos-7/Dockerfile
index 10208442a6..72bb7134ba 100644
--- a/dev/tasks/linux-packages/yum/centos-7/Dockerfile
+++ b/dev/tasks/linux-packages/yum/centos-7/Dockerfile
@@ -15,7 +15,10 @@
# specific language governing permissions and limitations
# under the License.
-FROM centos:7
+ARG FROM=centos:7
+FROM ${FROM}
+
+COPY qemu-* /usr/bin/
ARG DEBUG
diff --git a/dev/tasks/linux-packages/yum/centos-7/qemu-dummy-static b/dev/tasks/linux-packages/yum/centos-7/qemu-dummy-static
new file mode 100755
index 0000000000..c42e0962de
--- /dev/null
+++ b/dev/tasks/linux-packages/yum/centos-7/qemu-dummy-static
@@ -0,0 +1,33 @@
+#!/bin/sh
+#
+# 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.
+
+# Do nothing. This exists only for not requiring qemu-aarch64-static copy.
+# Recent Debian (buster or later) and Ubuntu (18.10 or later) on amd64 hosts or
+# arm64 host don't require qemu-aarch64-static in Docker image. But old Debian
+# and Ubuntu hosts on amd64 require qemu-aarch64-static in Docker image.
+#
+# We use "COPY qemu* /usr/bin/" in Dockerfile. If we don't put any "qemnu*",
+# the "COPY" is failed. It means that we always require "qemu*" even if we
+# use recent Debian/Ubuntu or arm64 host. If we have this dummy "qemu*" file,
+# the "COPY" isn't failed. It means that we can copy "qemu*" only when we
+# need.
+#
+# See also "script" in dev/tasks/linux-packages/azure.linux.arm64.yml.
+# Azure Pipelines uses old Ubuntu (18.04).
+# So we need to put "qemu-aarch64-static" into this directory.
diff --git a/dev/tasks/tasks.yml b/dev/tasks/tasks.yml
index a6720f05a7..0d66f6f566 100644
--- a/dev/tasks/tasks.yml
+++ b/dev/tasks/tasks.yml
@@ -63,6 +63,7 @@ groups:
- ubuntu-disco-arm64
- centos-6
- centos-7
+ - centos-7-aarch64
gandiva:
- gandiva-jar-trusty
@@ -161,6 +162,7 @@ groups:
- ubuntu-disco-arm64
- centos-6
- centos-7
+ - centos-7-aarch64
- homebrew-cpp
- homebrew-cpp-autobrew
- gandiva-jar-trusty
@@ -1041,51 +1043,82 @@ tasks:
platform: linux
template: linux-packages/azure.linux.yml
params:
- build_command: rake yum:build CENTOS_VERSIONS=6
+ build_command: rake yum:build YUM_TARGETS=centos-6
upload_extensions:
- .rpm
artifacts:
- arrow-{no_rc_version}-1.el6.src.rpm
- - arrow-debuginfo-{no_rc_version}-1.el6.x86_64.rpm
- - arrow-devel-{no_rc_version}-1.el6.x86_64.rpm
- - arrow-libs-{no_rc_version}-1.el6.x86_64.rpm
- - arrow-dataset-devel-{no_rc_version}-1.el6.x86_64.rpm
- - arrow-dataset-libs-{no_rc_version}-1.el6.x86_64.rpm
- - arrow-python-devel-{no_rc_version}-1.el6.x86_64.rpm
- - arrow-python-libs-{no_rc_version}-1.el6.x86_64.rpm
- - plasma-devel-{no_rc_version}-1.el6.x86_64.rpm
- - plasma-libs-{no_rc_version}-1.el6.x86_64.rpm
+ - arrow-debuginfo-{no_rc_version}-1.el6.[a-z0-9_]+.rpm
+ - arrow-devel-{no_rc_version}-1.el6.[a-z0-9_]+.rpm
+ - arrow-libs-{no_rc_version}-1.el6.[a-z0-9_]+.rpm
+ - arrow-dataset-devel-{no_rc_version}-1.el6.[a-z0-9_]+.rpm
+ - arrow-dataset-libs-{no_rc_version}-1.el6.[a-z0-9_]+.rpm
+ - arrow-python-devel-{no_rc_version}-1.el6.[a-z0-9_]+.rpm
+ - arrow-python-libs-{no_rc_version}-1.el6.[a-z0-9_]+.rpm
+ - plasma-devel-{no_rc_version}-1.el6.[a-z0-9_]+.rpm
+ - plasma-libs-{no_rc_version}-1.el6.[a-z0-9_]+.rpm
centos-7:
ci: azure
platform: linux
template: linux-packages/azure.linux.yml
params:
- build_command: rake yum:build CENTOS_VERSIONS=7
+ build_command: rake yum:build YUM_TARGETS=centos-7
upload_extensions:
- .rpm
artifacts:
- arrow-{no_rc_version}-1.el7.src.rpm
- - arrow-debuginfo-{no_rc_version}-1.el7.x86_64.rpm
- - arrow-devel-{no_rc_version}-1.el7.x86_64.rpm
- - arrow-glib-devel-{no_rc_version}-1.el7.x86_64.rpm
- - arrow-glib-doc-{no_rc_version}-1.el7.x86_64.rpm
- - arrow-glib-libs-{no_rc_version}-1.el7.x86_64.rpm
- - arrow-libs-{no_rc_version}-1.el7.x86_64.rpm
- - arrow-dataset-devel-{no_rc_version}-1.el7.x86_64.rpm
- - arrow-dataset-libs-{no_rc_version}-1.el7.x86_64.rpm
- - arrow-python-devel-{no_rc_version}-1.el7.x86_64.rpm
- - arrow-python-libs-{no_rc_version}-1.el7.x86_64.rpm
- - parquet-devel-{no_rc_version}-1.el7.x86_64.rpm
- - parquet-glib-devel-{no_rc_version}-1.el7.x86_64.rpm
- - parquet-glib-doc-{no_rc_version}-1.el7.x86_64.rpm
- - parquet-glib-libs-{no_rc_version}-1.el7.x86_64.rpm
- - parquet-libs-{no_rc_version}-1.el7.x86_64.rpm
- - plasma-devel-{no_rc_version}-1.el7.x86_64.rpm
- - plasma-glib-devel-{no_rc_version}-1.el7.x86_64.rpm
- - plasma-glib-doc-{no_rc_version}-1.el7.x86_64.rpm
- - plasma-glib-libs-{no_rc_version}-1.el7.x86_64.rpm
- - plasma-libs-{no_rc_version}-1.el7.x86_64.rpm
+ - arrow-debuginfo-{no_rc_version}-1.el7.[a-z0-9_]+.rpm
+ - arrow-devel-{no_rc_version}-1.el7.[a-z0-9_]+.rpm
+ - arrow-glib-devel-{no_rc_version}-1.el7.[a-z0-9_]+.rpm
+ - arrow-glib-doc-{no_rc_version}-1.el7.[a-z0-9_]+.rpm
+ - arrow-glib-libs-{no_rc_version}-1.el7.[a-z0-9_]+.rpm
+ - arrow-libs-{no_rc_version}-1.el7.[a-z0-9_]+.rpm
+ - arrow-dataset-devel-{no_rc_version}-1.el7.[a-z0-9_]+.rpm
+ - arrow-dataset-libs-{no_rc_version}-1.el7.[a-z0-9_]+.rpm
+ - arrow-python-devel-{no_rc_version}-1.el7.[a-z0-9_]+.rpm
+ - arrow-python-libs-{no_rc_version}-1.el7.[a-z0-9_]+.rpm
+ - parquet-devel-{no_rc_version}-1.el7.[a-z0-9_]+.rpm
+ - parquet-glib-devel-{no_rc_version}-1.el7.[a-z0-9_]+.rpm
+ - parquet-glib-doc-{no_rc_version}-1.el7.[a-z0-9_]+.rpm
+ - parquet-glib-libs-{no_rc_version}-1.el7.[a-z0-9_]+.rpm
+ - parquet-libs-{no_rc_version}-1.el7.[a-z0-9_]+.rpm
+ - plasma-devel-{no_rc_version}-1.el7.[a-z0-9_]+.rpm
+ - plasma-glib-devel-{no_rc_version}-1.el7.[a-z0-9_]+.rpm
+ - plasma-glib-doc-{no_rc_version}-1.el7.[a-z0-9_]+.rpm
+ - plasma-glib-libs-{no_rc_version}-1.el7.[a-z0-9_]+.rpm
+ - plasma-libs-{no_rc_version}-1.el7.[a-z0-9_]+.rpm
+
+ centos-7-aarch64:
+ ci: azure
+ platform: linux
+ template: linux-packages/azure.linux.arm64.yml
+ params:
+ build_command: rake yum:build YUM_TARGETS=centos-7-aarch64
+ upload_extensions:
+ - .rpm
+ artifacts:
+ - arrow-{no_rc_version}-1.el7.src.rpm
+ - arrow-debuginfo-{no_rc_version}-1.el7.[a-z0-9_]+.rpm
+ - arrow-devel-{no_rc_version}-1.el7.[a-z0-9_]+.rpm
+ - arrow-glib-devel-{no_rc_version}-1.el7.[a-z0-9_]+.rpm
+ - arrow-glib-doc-{no_rc_version}-1.el7.[a-z0-9_]+.rpm
+ - arrow-glib-libs-{no_rc_version}-1.el7.[a-z0-9_]+.rpm
+ - arrow-libs-{no_rc_version}-1.el7.[a-z0-9_]+.rpm
+ - arrow-dataset-devel-{no_rc_version}-1.el7.[a-z0-9_]+.rpm
+ - arrow-dataset-libs-{no_rc_version}-1.el7.[a-z0-9_]+.rpm
+ - arrow-python-devel-{no_rc_version}-1.el7.[a-z0-9_]+.rpm
+ - arrow-python-libs-{no_rc_version}-1.el7.[a-z0-9_]+.rpm
+ - parquet-devel-{no_rc_version}-1.el7.[a-z0-9_]+.rpm
+ - parquet-glib-devel-{no_rc_version}-1.el7.[a-z0-9_]+.rpm
+ - parquet-glib-doc-{no_rc_version}-1.el7.[a-z0-9_]+.rpm
+ - parquet-glib-libs-{no_rc_version}-1.el7.[a-z0-9_]+.rpm
+ - parquet-libs-{no_rc_version}-1.el7.[a-z0-9_]+.rpm
+ - plasma-devel-{no_rc_version}-1.el7.[a-z0-9_]+.rpm
+ - plasma-glib-devel-{no_rc_version}-1.el7.[a-z0-9_]+.rpm
+ - plasma-glib-doc-{no_rc_version}-1.el7.[a-z0-9_]+.rpm
+ - plasma-glib-libs-{no_rc_version}-1.el7.[a-z0-9_]+.rpm
+ - plasma-libs-{no_rc_version}-1.el7.[a-z0-9_]+.rpm
############################## Homebrew Tasks ################################