Apache DataFusion SQL Query Engine
ARROW-11493: [CI][Packaging][deb][RPM] Test built packages
Sutou Kouhei0a0dee695a6a
diff --git a/dev/release/binary-task.rb b/dev/release/binary-task.rbindex 095996220b..b4ed42a1d1 100644--- a/dev/release/binary-task.rb+++ b/dev/release/binary-task.rb@@ -1047,7 +1047,7 @@ class BinaryTaskelseavailable_apt_targets.select do |distribution, code_name, component|env_apt_targets.any? do |env_apt_target|- "#{distribution}-#{code_name}".start_with?(env_apt_target)+ env_apt_target.start_with?("#{distribution}-#{code_name}")endendend@@ -1233,6 +1233,73 @@ APT::FTPArchive::Release::Description "#{apt_repository_description}";CONFend+ def apt_update(repositories_dir)+ apt_targets.each do |distribution, code_name, component|+ base_dir = "#{repositories_dir}/#{distribution}"+ pool_dir = "#{base_dir}/pool/#{code_name}"+ next unless File.exist?(pool_dir)+ dists_dir = "#{base_dir}/dists/#{code_name}"+ rm_rf(dists_dir, verbose: verbose?)+ generate_apt_release(dists_dir, code_name, component, "source")+ apt_architectures.each do |architecture|+ generate_apt_release(dists_dir, code_name, component, architecture)+ end++ generate_conf_file = Tempfile.new("apt-ftparchive-generate.conf")+ File.open(generate_conf_file.path, "w") do |conf|+ conf.puts(generate_apt_ftp_archive_generate_conf(code_name,+ component))+ end+ cd(base_dir, verbose: verbose?) do+ sh("apt-ftparchive",+ "generate",+ generate_conf_file.path,+ out: default_output,+ verbose: verbose?)+ end++ Dir.glob("#{dists_dir}/Release*") do |release|+ rm_f(release, verbose: verbose?)+ end+ Dir.glob("#{base_dir}/*.db") do |db|+ rm_f(db, verbose: verbose?)+ end+ release_conf_file = Tempfile.new("apt-ftparchive-release.conf")+ File.open(release_conf_file.path, "w") do |conf|+ conf.puts(generate_apt_ftp_archive_release_conf(code_name,+ component))+ end+ release_file = Tempfile.new("apt-ftparchive-release")+ sh("apt-ftparchive",+ "-c", release_conf_file.path,+ "release",+ dists_dir,+ out: release_file.path,+ verbose: verbose?)+ release_path = "#{dists_dir}/Release"+ signed_release_path = "#{release_path}.gpg"+ in_release_path = "#{dists_dir}/InRelease"+ mv(release_file.path, release_path, verbose: verbose?)+ chmod(0644, release_path, verbose: verbose?)+ sh("gpg",+ "--sign",+ "--detach-sign",+ "--armor",+ "--local-user", gpg_key_id,+ "--output", signed_release_path,+ release_path,+ out: default_output,+ verbose: verbose?)+ sh("gpg",+ "--clear-sign",+ "--local-user", gpg_key_id,+ "--output", in_release_path,+ release_path,+ out: default_output,+ verbose: verbose?)+ end+ end+def define_apt_rc_tasksdirectory apt_rc_repositories_dir@@ -1249,70 +1316,11 @@ APT::FTPArchive::Release::Description "#{apt_repository_description}";desc "Update RC APT repositories"task :update do+ apt_update(apt_rc_repositiries_dir)apt_targets.each do |distribution, code_name, component|base_dir = "#{apt_rc_repositories_dir}/#{distribution}"- pool_dir = "#{base_dir}/pool/#{code_name}"- next unless File.exist?(pool_dir)dists_dir = "#{base_dir}/dists/#{code_name}"- rm_rf(dists_dir, verbose: verbose?)- generate_apt_release(dists_dir, code_name, component, "source")- apt_architectures.each do |architecture|- generate_apt_release(dists_dir, code_name, component, architecture)- end-- generate_conf_file = Tempfile.new("apt-ftparchive-generate.conf")- File.open(generate_conf_file.path, "w") do |conf|- conf.puts(generate_apt_ftp_archive_generate_conf(code_name,- component))- end- cd(base_dir, verbose: verbose?) do- sh("apt-ftparchive",- "generate",- generate_conf_file.path,- out: default_output,- verbose: verbose?)- end-- Dir.glob("#{dists_dir}/Release*") do |release|- rm_f(release, verbose: verbose?)- end- Dir.glob("#{base_dir}/*.db") do |db|- rm_f(db, verbose: verbose?)- end- release_conf_file = Tempfile.new("apt-ftparchive-release.conf")- File.open(release_conf_file.path, "w") do |conf|- conf.puts(generate_apt_ftp_archive_release_conf(code_name,- component))- end- release_file = Tempfile.new("apt-ftparchive-release")- sh("apt-ftparchive",- "-c", release_conf_file.path,- "release",- dists_dir,- out: release_file.path,- verbose: verbose?)- release_path = "#{dists_dir}/Release"- signed_release_path = "#{release_path}.gpg"- in_release_path = "#{dists_dir}/InRelease"- mv(release_file.path, release_path, verbose: verbose?)- chmod(0644, release_path, verbose: verbose?)- sh("gpg",- "--sign",- "--detach-sign",- "--armor",- "--local-user", gpg_key_id,- "--output", signed_release_path,- release_path,- out: default_output,- verbose: verbose?)- sh("gpg",- "--clear-sign",- "--local-user", gpg_key_id,- "--output", in_release_path,- release_path,- out: default_output,- verbose: verbose?)-+ next unless File.exist?(dists_dir)sign_dir("#{distribution} #{code_name}",dists_dir)end@@ -1427,7 +1435,7 @@ APT::FTPArchive::Release::Description "#{apt_repository_description}";elseavailable_yum_targets.select do |distribution, distribution_version|env_yum_targets.any? do |env_yum_target|- "#{distribution}-#{distribution_version}".start_with?(env_yum_target)+ env_yum_target.start_with?("#{distribution}-#{distribution_version}")endendend@@ -1471,6 +1479,33 @@ APT::FTPArchive::Release::Description "#{apt_repository_description}";thread_pool.joinend+ def rpm_sign(directory)+ unless system("rpm", "-q",+ rpm_gpg_key_package_name(gpg_key_id),+ out: IO::NULL)+ gpg_key = Tempfile.new(["apache-arrow-binary", ".asc"])+ sh("gpg",+ "--armor",+ "--export", gpg_key_id,+ out: gpg_key.path,+ verbose: verbose?)+ sh("rpm",+ "--import", gpg_key.path,+ out: default_output,+ verbose: verbose?)+ gpg_key.close!+ end++ yum_targets.each do |distribution, distribution_version|+ source_dir = [+ directory,+ distribution,+ distribution_version,+ ].join("/")+ sign_rpms(source_dir)+ end+ end+def define_rpm_tasksdirectory rpm_dir@@ -1542,31 +1577,15 @@ APT::FTPArchive::Release::Description "#{apt_repository_description}";desc "Sign RPM packages"task :sign do- unless system("rpm", "-q",- rpm_gpg_key_package_name(gpg_key_id),- out: IO::NULL)- gpg_key = Tempfile.new(["apache-arrow-binary", ".asc"])- sh("gpg",- "--armor",- "--export", gpg_key_id,- out: gpg_key.path,- verbose: verbose?)- sh("rpm",- "--import", gpg_key.path,- out: default_output,- verbose: verbose?)- gpg_key.close!- end-+ rpm_sign(rpm_dir)yum_targets.each do |distribution, distribution_version|source_dir = [rpm_dir,distribution,distribution_version,].join("/")- sign_rpms(source_dir)sign_dir("#{distribution}-#{distribution_version}",- rpm_dir)+ source_dir)endend@@ -1597,6 +1616,33 @@ APT::FTPArchive::Release::Description "#{apt_repository_description}";task :rpm => rpm_tasksend+ def yum_update(repositories_dir)+ yum_distributions.each do |distribution|+ distribution_dir = "#{repositories_dir}/#{distribution}"+ Dir.glob("#{distribution_dir}/**/repodata") do |repodata|+ rm_rf(repodata, verbose: verbose?)+ end+ end++ yum_targets.each do |distribution, distribution_version|+ base_dir = [+ repositories_dir,+ distribution,+ distribution_version,+ ].join("/")+ base_dir = Pathname(base_dir)+ next unless base_dir.directory?+ base_dir.glob("*") do |arch_dir|+ next unless arch_dir.directory?+ sh(ENV["CREATEREPO"] || "createrepo",+ "--update",+ arch_dir.to_s,+ out: default_output,+ verbose: verbose?)+ end+ end+ end+def define_yum_rc_tasksdirectory yum_rc_repositories_dir@@ -1614,13 +1660,7 @@ APT::FTPArchive::Release::Description "#{apt_repository_description}";desc "Update RC Yum repositories"task :update => yum_rc_repositories_dir do- yum_distributions.each do |distribution|- distribution_dir = "#{yum_rc_repositories_dir}/#{distribution}"- Dir.glob("#{distribution_dir}/**/repodata") do |repodata|- rm_rf(repodata, verbose: verbose?)- end- end-+ yum_update(yum_rc_repositories_dir)yum_targets.each do |distribution, distribution_version|base_dir = [yum_rc_repositories_dir,@@ -1631,11 +1671,6 @@ APT::FTPArchive::Release::Description "#{apt_repository_description}";next unless base_dir.directory?base_dir.glob("*") do |arch_dir|next unless arch_dir.directory?- sh("createrepo",- "--update",- arch_dir.to_s,- out: default_output,- verbose: verbose?)sign_label ="#{distribution}-#{distribution_version} #{arch_dir.basename}"sign_dir(sign_label,diff --git a/dev/release/verify-apt.sh b/dev/release/verify-apt.shindex 3ca5ec45ec..43b05f7ada 100755--- a/dev/release/verify-apt.sh+++ b/dev/release/verify-apt.sh@@ -20,19 +20,23 @@set -exuif [ $# -lt 2 ]; then- echo "Usage: $0 X.Y.Z IS_RC"- echo " $0 X.Y.Z IS_RC BINTRAY_REPOSITORY"- echo " e.g.: $0 0.13.0 yes # Verify 0.13.0 RC"- echo " e.g.: $0 0.13.0 no # Verify 0.13.0"- echo " e.g.: $0 0.13.0 yes kou/arrow # Verify 0.13.0 RC at https://bintray.com/kou/arrow"+ echo "Usage: $0 VERSION rc"+ echo " $0 VERSION rc BINTRAY_REPOSITORY"+ echo " $0 VERSION release"+ echo " $0 VERSION release BINTRAY_REPOSITORY"+ echo " $0 VERSION local"+ echo " e.g.: $0 0.13.0 rc # Verify 0.13.0 RC"+ echo " e.g.: $0 0.13.0 release # Verify 0.13.0"+ echo " e.g.: $0 0.13.0 rc kou/arrow # Verify 0.13.0 RC at https://bintray.com/kou/arrow"+ echo " e.g.: $0 0.13.0-dev20210203 local # Verify 0.13.0-dev20210203 on local"exit 1fiVERSION="$1"-IS_RC="$2"+TYPE="$2"BINTRAY_REPOSITORY="${3:-apache/arrow}"-deb_version="${VERSION}-1"+local_prefix="/arrow/dev/tasks/linux-packages"export DEBIAN_FRONTEND=noninteractive@@ -44,7 +48,7 @@ apt install -y -V \code_name="$(lsb_release --codename --short)"distribution="$(lsb_release --id --short | tr 'A-Z' 'a-z')"bintray_base_url="https://dl.bintray.com/${BINTRAY_REPOSITORY}/${distribution}"-if [ "${IS_RC}" = "yes" ]; then+if [ "${TYPE}" = "rc" ]; thenbintray_base_url="${bintray_base_url}-rc"fi@@ -60,7 +64,6 @@ case "${distribution}-${code_name}" in;;ubuntu-xenial)have_flight=no- workaround_missing_packages+=(libprotobuf-dev);;ubuntu-groovy)workaround_missing_packages+=(libgrpc++-dev protobuf-compiler-grpc)@@ -70,33 +73,74 @@ if [ "$(arch)" = "aarch64" ]; thenhave_plasma=nofi-keyring_archive_base_name="apache-arrow-archive-keyring-latest-${code_name}.deb"-curl \- --output "${keyring_archive_base_name}" \- "${bintray_base_url}/${keyring_archive_base_name}"-apt install -y -V "./${keyring_archive_base_name}"-if [ "${BINTRAY_REPOSITORY}" = "apache/arrow" ]; then- if [ "${IS_RC}" = "yes" ]; then- sed \- -i"" \- -e "s,^URIs: \\(.*\\)/,URIs: \\1-rc/,g" \- /etc/apt/sources.list.d/apache-arrow.sources- fi+if [ "${TYPE}" = "local" ]; then+ case "${VERSION}" in+ *-dev*)+ package_version="$(echo "${VERSION}" | sed -e 's/-dev\(.*\)$/~dev\1/g')"+ ;;+ *-rc*)+ package_version="$(echo "${VERSION}" | sed -e 's/-rc.*$//g')"+ ;;+ *)+ package_version="${VERSION}"+ ;;+ esac+ package_version+="-1"+ keyring_archive_path="${local_prefix}/apt/repositories"+ keyring_archive_path+="/${distribution}/pool/${code_name}/main"+ keyring_archive_path+="/a/apache-arrow-archive-keyring"+ keyring_archive_path+="/apache-arrow-archive-keyring_${package_version}_all.deb"+ apt install -y -V "${keyring_archive_path}"else+ package_version="${VERSION}-1"+ keyring_archive_base_name="apache-arrow-archive-keyring-latest-${code_name}.deb"+ curl \+ --output "${keyring_archive_base_name}" \+ "${bintray_base_url}/${keyring_archive_base_name}"+ apt install -y -V "./${keyring_archive_base_name}"+fi++if [ "${TYPE}" = "local" ]; thensed \-i"" \- -e "s,^URIs: .*,URIs: ${bintray_base_url}/,g" \+ -e "s,^URIs: .*$,URIs: file://${local_prefix}/apt/repositories/${distribution},g" \/etc/apt/sources.list.d/apache-arrow.sources+ keys="${local_prefix}/KEYS"+ if [ -f "${keys}" ]; then+ gpg \+ --no-default-keyring \+ --keyring /usr/share/keyrings/apache-arrow-archive-keyring.gpg \+ --import "${keys}"+ fi+else+ if [ "${BINTRAY_REPOSITORY}" = "apache/arrow" ]; then+ if [ "${TYPE}" = "rc" ]; then+ sed \+ -i"" \+ -e "s,^URIs: \\(.*\\)/,URIs: \\1-rc/,g" \+ /etc/apt/sources.list.d/apache-arrow.sources+ fi+ else+ sed \+ -i"" \+ -e "s,^URIs: .*,URIs: ${bintray_base_url}/,g" \+ /etc/apt/sources.list.d/apache-arrow.sources+ fifiapt update-apt install -y -V libarrow-glib-dev=${deb_version}-apt install -y -V \- cmake \- g++ \- git \- ${workaround_missing_packages[@]}+apt install -y -V libarrow-glib-dev=${package_version}+required_packages=()+required_packages+=(cmake)+required_packages+=(g++)+required_packages+=(git)+# Bash on Ubuntu Xenial reports unbound variable for+# ${workaround_missing_packages[@]} with empty workaround_missing_packages.+if [ ${#workaround_missing_packages[@]} -gt 0 ]; then+ required_packages+=(${workaround_missing_packages[@]})+fi+apt install -y -V ${required_packages[@]}mkdir -p buildcp -a /arrow/cpp/examples/minimal_build buildpushd build/minimal_build@@ -105,23 +149,23 @@ make -j$(nproc)./arrow_examplepopd-apt install -y -V libarrow-glib-dev=${deb_version}-apt install -y -V libarrow-glib-doc=${deb_version}+apt install -y -V libarrow-glib-dev=${package_version}+apt install -y -V libarrow-glib-doc=${package_version}if [ "${have_flight}" = "yes" ]; then- apt install -y -V libarrow-flight-dev=${deb_version}+ apt install -y -V libarrow-flight-dev=${package_version}fi-apt install -y -V libarrow-python-dev=${deb_version}+apt install -y -V libarrow-python-dev=${package_version}if [ "${have_plasma}" = "yes" ]; then- apt install -y -V libplasma-glib-dev=${deb_version}- apt install -y -V libplasma-glib-doc=${deb_version}- apt install -y -V plasma-store-server=${deb_version}+ apt install -y -V libplasma-glib-dev=${package_version}+ apt install -y -V libplasma-glib-doc=${package_version}+ apt install -y -V plasma-store-server=${package_version}fi-apt install -y -V libgandiva-glib-dev=${deb_version}-apt install -y -V libgandiva-glib-doc=${deb_version}+apt install -y -V libgandiva-glib-dev=${package_version}+apt install -y -V libgandiva-glib-doc=${package_version}-apt install -y -V libparquet-glib-dev=${deb_version}-apt install -y -V libparquet-glib-doc=${deb_version}+apt install -y -V libparquet-glib-dev=${package_version}+apt install -y -V libparquet-glib-doc=${package_version}diff --git a/dev/release/verify-release-candidate.sh b/dev/release/verify-release-candidate.shindex ad25e2e841..346d0961ab 100755--- a/dev/release/verify-release-candidate.sh+++ b/dev/release/verify-release-candidate.sh@@ -158,7 +158,7 @@ test_apt() {"${target}" \/arrow/dev/release/verify-apt.sh \"${VERSION}" \- "yes" \+ "rc" \"${BINTRAY_REPOSITORY}"; thenecho "Failed to verify the APT repository for ${target}"exit 1@@ -184,7 +184,7 @@ test_yum() {"${target}" \/arrow/dev/release/verify-yum.sh \"${VERSION}" \- "yes" \+ "rc" \"${BINTRAY_REPOSITORY}"; thenecho "Failed to verify the Yum repository for ${target}"exit 1diff --git a/dev/release/verify-yum.sh b/dev/release/verify-yum.shindex 89432d5561..0bde804c3c 100755--- a/dev/release/verify-yum.sh+++ b/dev/release/verify-yum.sh@@ -20,20 +20,26 @@set -exuif [ $# -lt 2 ]; then- echo "Usage: $0 X.Y.Z IS_RC"- echo " $0 X.Y.Z IS_RC BINTRAY_REPOSITORY"- echo " e.g.: $0 0.13.0 yes # Verify 0.13.0 RC"- echo " e.g.: $0 0.13.0 no # Verify 0.13.0"- echo " e.g.: $0 0.13.0 yes kou/arrow # Verify 0.13.0 RC at https://bintray.com/kou/arrow"+ echo "Usage: $0 VERSION rc"+ echo " $0 VERSION rc BINTRAY_REPOSITORY"+ echo " $0 VERSION release"+ echo " $0 VERSION release BINTRAY_REPOSITORY"+ echo " $0 VERSION local"+ echo " e.g.: $0 0.13.0 rc # Verify 0.13.0 RC"+ echo " e.g.: $0 0.13.0 release # Verify 0.13.0"+ echo " e.g.: $0 0.13.0 rc kou/arrow # Verify 0.13.0 RC at https://bintray.com/kou/arrow"+ echo " e.g.: $0 0.13.0-dev20210203 local # Verify 0.13.0-dev20210203 on local"exit 1fiVERSION="$1"-IS_RC="$2"+TYPE="$2"BINTRAY_REPOSITORY="${3:-apache/arrow}"+local_prefix="/arrow/dev/tasks/linux-packages"+bintray_base_url="https://dl.bintray.com/${BINTRAY_REPOSITORY}/centos"-if [ "${IS_RC}" = "yes" ]; then+if [ "${TYPE}" = "rc" ]; thenbintray_base_url="${bintray_base_url}-rc"fi@@ -60,23 +66,56 @@ if [ "$(arch)" = "aarch64" ]; thenhave_gandiva=nofi-${install_command} \- ${bintray_base_url}/${distribution_version}/apache-arrow-release-latest.rpm-if [ "${BINTRAY_REPOSITORY}" = "apache/arrow" ]; then- if [ "${IS_RC}" = "yes" ]; then- sed \- -i"" \- -e "s,/centos/,/centos-rc/,g" \- /etc/yum.repos.d/Apache-Arrow.repo- fi+if [ "${TYPE}" = "local" ]; then+ case "${VERSION}" in+ *-dev*)+ package_version="$(echo "${VERSION}" | sed -e 's/-dev\(.*\)$/-0.dev\1/g')"+ ;;+ *-rc*)+ package_version="$(echo "${VERSION}" | sed -e 's/-rc.*$//g')"+ package_version+="-1"+ ;;+ *)+ package_version="${VERSION}-1"+ ;;+ esac+ package_version+=".el${distribution_version}"+ release_path="${local_prefix}/yum/repositories"+ release_path+="/centos/${distribution_version}/$(arch)/Packages"+ release_path+="/apache-arrow-release-${package_version}.noarch.rpm"+ ${install_command} "${release_path}"else+ package_version="${VERSION}"+ ${install_command} \+ ${bintray_base_url}/${distribution_version}/apache-arrow-release-latest.rpm+fi++if [ "${TYPE}" = "local" ]; thensed \-i"" \- -e "s,baseurl=https://apache.bintray.com/arrow/centos,baseurl=${bintray_base_url},g" \+ -e "s,baseurl=https://apache.bintray.com/arrow/,baseurl=file://${local_prefix}/yum/repositories/,g" \/etc/yum.repos.d/Apache-Arrow.repo+ keys="${local_prefix}/KEYS"+ if [ -f "${keys}" ]; then+ cp "${keys}" /etc/pki/rpm-gpg/RPM-GPG-KEY-Apache-Arrow+ fi+else+ if [ "${BINTRAY_REPOSITORY}" = "apache/arrow" ]; then+ if [ "${TYPE}" = "rc" ]; then+ sed \+ -i"" \+ -e "s,/centos/,/centos-rc/,g" \+ /etc/yum.repos.d/Apache-Arrow.repo+ fi+ else+ sed \+ -i"" \+ -e "s,baseurl=https://apache.bintray.com/arrow/centos,baseurl=${bintray_base_url},g" \+ /etc/yum.repos.d/Apache-Arrow.repo+ fifi-${install_command} --enablerepo=epel arrow-devel-${VERSION}+${install_command} --enablerepo=epel arrow-devel-${package_version}${install_command} \${cmake_package} \gcc-c++ \@@ -91,36 +130,36 @@ make -j$(nproc)popdif [ "${have_glib}" = "yes" ]; then- ${install_command} --enablerepo=epel arrow-glib-devel-${VERSION}- ${install_command} --enablerepo=epel arrow-glib-doc-${VERSION}+ ${install_command} --enablerepo=epel arrow-glib-devel-${package_version}+ ${install_command} --enablerepo=epel arrow-glib-doc-${package_version}fi-${install_command} --enablerepo=epel arrow-python-devel-${VERSION}+${install_command} --enablerepo=epel arrow-python-devel-${package_version}if [ "${have_glib}" = "yes" ]; then- ${install_command} --enablerepo=epel plasma-glib-devel-${VERSION}- ${install_command} --enablerepo=epel plasma-glib-doc-${VERSION}+ ${install_command} --enablerepo=epel plasma-glib-devel-${package_version}+ ${install_command} --enablerepo=epel plasma-glib-doc-${package_version}else- ${install_command} --enablerepo=epel plasma-devel-${VERSION}+ ${install_command} --enablerepo=epel plasma-devel-${package_version}fiif [ "${have_flight}" = "yes" ]; then- ${install_command} --enablerepo=epel arrow-flight-devel-${VERSION}+ ${install_command} --enablerepo=epel arrow-flight-devel-${package_version}fiif [ "${have_gandiva}" = "yes" ]; thenif [ "${have_glib}" = "yes" ]; then- ${install_command} --enablerepo=epel gandiva-glib-devel-${VERSION}- ${install_command} --enablerepo=epel gandiva-glib-doc-${VERSION}+ ${install_command} --enablerepo=epel gandiva-glib-devel-${package_version}+ ${install_command} --enablerepo=epel gandiva-glib-doc-${package_version}else- ${install_command} --enablerepo=epel gandiva-devel-${VERSION}+ ${install_command} --enablerepo=epel gandiva-devel-${package_version}fifiif [ "${have_parquet}" = "yes" ]; thenif [ "${have_glib}" = "yes" ]; then- ${install_command} --enablerepo=epel parquet-glib-devel-${VERSION}- ${install_command} --enablerepo=epel parquet-glib-doc-${VERSION}+ ${install_command} --enablerepo=epel parquet-glib-devel-${package_version}+ ${install_command} --enablerepo=epel parquet-glib-doc-${package_version}else- ${install_command} --enablerepo=epel parquet-devel-${VERSION}+ ${install_command} --enablerepo=epel parquet-devel-${package_version}fifidiff --git a/dev/tasks/linux-packages/.gitignore b/dev/tasks/linux-packages/.gitignoreindex a731d1846d..0e49a90c1e 100644--- a/dev/tasks/linux-packages/.gitignore+++ b/dev/tasks/linux-packages/.gitignore@@ -24,3 +24,5 @@/*/yum/tmp//*/yum/build.sh/*/yum/env.sh+/apt/repositories/+/yum/repositories/diff --git a/dev/tasks/linux-packages/Rakefile b/dev/tasks/linux-packages/Rakefileindex cd9c6387a8..36bb0f80ff 100644--- a/dev/tasks/linux-packages/Rakefile+++ b/dev/tasks/linux-packages/Rakefile@@ -17,12 +17,18 @@# specific language governing permissions and limitations# under the License.+require "English"++require_relative "../../release/binary-task"+require_relative "helper"+packages = ["apache-arrow","apache-arrow-archive-keyring","apache-arrow-release",]+namespace :apt dodesc "Build deb packages"task :build do@@ -75,3 +81,153 @@ namespace :docker doendendend+++class LocalBinaryTask < BinaryTask+ include Helper::ApacheArrow++ def initialize(packages)+ @packages = packages+ super()+ end++ def define+ define_apt_test_task+ define_yum_test_task+ end++ private+ def latest_commit_time(git_directory)+ cd(git_directory) do+ return Time.iso8601(`git log -n 1 --format=%aI`.chomp).utc+ end+ end++ def version+ @version ||= detect_version(detect_release_time)+ end++ def resolve_docker_image(target)+ image = ""+ case target+ when /-(?:arm64|aarch64)\z/+ target = $PREMATCH+ image << "arm64v8/"+ end+ image << target.gsub(/-/, ":")+ end++ def verify(target)+ verify_command_line = [+ "docker",+ "run",+ "--rm",+ "--log-driver", "none",+ "--volume", "#{File.expand_path(arrow_source_dir)}:/arrow:delegated",+ ]+ if $stdin.tty?+ verify_command_line << "--interactive"+ verify_command_line << "--tty"+ else+ verify_command_line.concat(["--attach", "STDOUT"])+ verify_command_line.concat(["--attach", "STDERR"])+ end+ verify_command_line << resolve_docker_image(target)+ case target+ when /\Adebian-/, /\Aubuntu-/+ verify_command_line << "/arrow/dev/release/verify-apt.sh"+ else+ verify_command_line << "/arrow/dev/release/verify-yum.sh"+ end+ verify_command_line << version+ verify_command_line << "local"+ sh(*verify_command_line)+ end++ def apt_test_targets+ targets = (ENV["APT_TARGETS"] || "").split(",")+ targets = apt_test_targets_default if targets.empty?+ targets+ end++ def apt_test_targets_default+ # Disable arm64 targets by default for now+ # because they require some setups on host.+ [+ "debian-buster",+ # "debian-stretch-arm64",+ "ubuntu-xenial",+ # "ubuntu-xenial-arm64",+ "ubuntu-bionic",+ # "ubuntu-bionic-arm64",+ "ubuntu-focal",+ # "ubuntu-focal-arm64",+ "ubuntu-groovy",+ # "ubuntu-groovy-arm64",+ ]+ end++ def define_apt_test_task+ namespace :apt do+ desc "Test deb packages"+ task :test do+ repositories_dir = "apt/repositories"+ rm_rf(repositories_dir)+ @packages.each do |package|+ package_repositories = "#{package}/apt/repositories"+ next unless File.exist?(package_repositories)+ sh("rsync", "-a", "#{package_repositories}/", repositories_dir)+ end+ Dir.glob("#{repositories_dir}/ubuntu/pool/*") do |code_name_dir|+ universe_dir = "#{code_name_dir}/universe"+ next unless File.exist?(universe_dir)+ mv(universe_dir, "#{code_name_dir}/main")+ end+ apt_update(repositories_dir)+ apt_test_targets.each do |target|+ verify(target)+ end+ end+ end+ end++ def yum_test_targets+ targets = (ENV["YUM_TARGETS"] || "").split(",")+ targets = yum_test_targets_default if targets.empty?+ targets+ end++ def yum_test_targets_default+ # Disable aarch64 targets by default for now+ # because they require some setups on host.+ [+ "centos-7",+ # "centos-7-aarch64",+ "centos-8",+ # "centos-8-aarch64",+ ]+ end++ def define_yum_test_task+ namespace :yum do+ desc "Test RPM packages"+ task :test do+ repositories_dir = "yum/repositories"+ rm_rf(repositories_dir)+ @packages.each do |package|+ package_repositories = "#{package}/yum/repositories"+ next unless File.exist?(package_repositories)+ sh("rsync", "-a", "#{package_repositories}/", repositories_dir)+ end+ rpm_sign(repositories_dir)+ yum_update(repositories_dir)+ yum_test_targets.each do |target|+ verify(target)+ end+ end+ end+ end+end++local_binary_task = LocalBinaryTask.new(packages)+local_binary_task.definediff --git a/dev/tasks/linux-packages/github.linux.amd64.yml b/dev/tasks/linux-packages/github.linux.amd64.ymlindex cff107f29d..8e0c5018cb 100644--- a/dev/tasks/linux-packages/github.linux.amd64.yml+++ b/dev/tasks/linux-packages/github.linux.amd64.yml@@ -27,7 +27,7 @@ on:jobs:package:name: Package- runs-on: ubuntu-20.04+ runs-on: ubuntu-18.04steps:- name: Set up Rubyuses: actions/setup-ruby@v1@@ -46,7 +46,7 @@ jobs:pushd arrow/dev/tasks/linux-packagesrake version:updaterake docker:pull || :- rake BUILD_DIR=build {{ build_task }}+ rake --trace {{ task_namespace }}:build BUILD_DIR=buildsudo rm -rf */*/buildpopdenv:@@ -55,7 +55,6 @@ jobs:REPO: {{ '${{ secrets.REPO }}' }}YUM_TARGETS: {{ target }}- name: Docker Push- if: success()continue-on-error: trueshell: bashrun: |@@ -68,6 +67,36 @@ jobs:APT_TARGETS: {{ target }}REPO: {{ '${{ secrets.REPO }}' }}YUM_TARGETS: {{ target }}+ - name: Set up test+ run: |+ set -e+ sudo apt update+ sudo apt install -y \+ apt-utils \+ createrepo \+ devscripts \+ gpg \+ rpm+ (echo "Key-Type: RSA"; \+ echo "Key-Length: 4096"; \+ echo "Name-Real: Test"; \+ echo "Name-Email: [email protected]"; \+ echo "%no-protection") | \+ gpg --full-generate-key --batch+ GPG_KEY_ID=$(gpg --list-keys --with-colon [email protected] | grep fpr | cut -d: -f10)+ echo "GPG_KEY_ID=${GPG_KEY_ID}" >> ${GITHUB_ENV}+ gpg --export --armor [email protected] > arrow/dev/tasks/linux-packages/KEYS+ - name: Test+ run: |+ set -e+ pushd arrow/dev/tasks/linux-packages+ rake --trace {{ task_namespace }}:test+ rm -rf {{ task_namespace }}/repositories+ popd+ env:+ APT_TARGETS: {{ target }}+ ARROW_VERSION: {{ arrow.version }}+ YUM_TARGETS: {{ target }}# Using GitHub release tries to find a common ancestor between the# currently pushed tag and the latest tag of the GitHub repository# (don't know why).@@ -79,15 +108,7 @@ jobs:python-version: 3.8- name: Set up Crossbowrun: |- pip install \- click \- github3.py \- jinja2 \- jira \- pygit2 \- ruamel.yaml \- setuptools_scm \- toolz+ pip install --requirement arrow/dev/tasks/requirements-crossbow.txt- name: Upload artifactsrun: |python arrow/dev/tasks/crossbow.py \@@ -95,7 +116,7 @@ jobs:--queue-remote {{ queue_remote_url }} \upload-artifacts \{%- for extension in upload_extensions %}- --pattern "**/*{{ extension }}" \+ --pattern "arrow/dev/tasks/linux-packages/**/*{{ extension }}" \{%- endfor %}--sha {{ task.branch }} \--tag {{ task.tag }}diff --git a/dev/tasks/linux-packages/travis.linux.arm64.yml b/dev/tasks/linux-packages/travis.linux.arm64.ymlindex e67e1f71d3..4221db2789 100644--- a/dev/tasks/linux-packages/travis.linux.arm64.yml+++ b/dev/tasks/linux-packages/travis.linux.arm64.yml@@ -23,9 +23,14 @@ language: minimaladdons:apt:packages:+ - apt-utils+ - createrepo+ - devscripts+ - gpg- libgit2-dev- python3-pip- rake+ - rpmservices:- docker@@ -47,45 +52,66 @@ before_script:- git -C arrow checkout FETCH_HEADscript:+ # Build packages- pushd arrow/dev/tasks/linux-packages- rake version:update- |- rake docker:pull || :+ rake docker:pull || :+ - pushd apache-arrow-archive-keyring/apt+ - |+ for target in debian-* ubuntu-*; do+ cp -a ${target} ${target}-arm64+ done+ - popd+ - pushd apache-arrow-release/yum+ - |+ for target in centos-*; do+ cp -a ${target} ${target}-aarch64+ done+ - popd- |- stdbuf --output=0 \rake \+ --trace \+ {{ task_namespace }}:build \BUILD_DIR=build \- DEB_BUILD_OPTIONS=parallel=8 \- RPM_BUILD_NCPUS=8 \- {{ build_task }}+ DEB_BUILD_OPTIONS=parallel=2 \+ RPM_BUILD_NCPUS=2- sudo rm -rf */*/build- popd--after_success:+ # Push Docker image- pushd arrow/dev/tasks/linux-packages- |- docker login -u "${DOCKERHUB_USER}" \- -p "${DOCKERHUB_TOKEN}" || :+ docker login -u "${DOCKERHUB_USER}" \+ -p "${DOCKERHUB_TOKEN}" || :- |- rake docker:push || :+ rake docker:push || :- popd+ # Test built packages- |- sudo -H pip3 install \- "click>=7.1" \- github3.py \- jinja2 \- jira \- pygit2==0.26.4 \- ruamel.yaml \- setuptools_scm \- toolz+ (echo "Key-Type: RSA"; \+ echo "Key-Length: 4096"; \+ echo "Name-Real: Test"; \+ echo "Name-Email: [email protected]"; \+ echo "%no-protection") | \+ gpg --full-generate-key --batch+ - |+ GPG_KEY_ID=$(gpg --list-keys --with-colon [email protected] | grep fpr | cut -d: -f10)+ - gpg --export --armor [email protected] > arrow/dev/tasks/linux-packages/KEYS+ - pushd arrow/dev/tasks/linux-packages+ - |+ rake --trace {{ task_namespace }}:test GPG_KEY_ID=${GPG_KEY_ID}+ - rm -rf {{ task_namespace }}/repositories+ - popd++after_success:+ - sudo -H pip3 install --requirement arrow/dev/tasks/requirements-crossbow.txt- |python3 arrow/dev/tasks/crossbow.py \--queue-path . \--queue-remote {{ queue_remote_url }} \upload-artifacts \{%- for extension in upload_extensions %}- --pattern "**/*{{ extension }}" \+ --pattern "arrow/dev/tasks/linux-packages/**/*{{ extension }}" \{%- endfor %}--sha {{ task.branch }} \--tag {{ task.tag }}diff --git a/dev/tasks/tasks.yml b/dev/tasks/tasks.ymlindex 144c236776..b443070075 100644--- a/dev/tasks/tasks.yml+++ b/dev/tasks/tasks.yml@@ -546,8 +546,8 @@ tasks:ci: githubtemplate: linux-packages/github.linux.amd64.ymlparams:- build_task: "apt:build"target: "debian-buster"+ task_namespace: "apt"upload_extensions:- .ddeb- .deb@@ -621,8 +621,8 @@ tasks:ci: travistemplate: linux-packages/travis.linux.arm64.ymlparams:- build_task: "apt:build"target: "debian-buster-arm64"+ task_namespace: "apt"upload_extensions:- .ddeb- .deb@@ -676,8 +676,8 @@ tasks:ci: githubtemplate: linux-packages/github.linux.amd64.ymlparams:- build_task: "apt:build"target: "ubuntu-xenial"+ task_namespace: "apt"upload_extensions:- .ddeb- .deb@@ -734,8 +734,8 @@ tasks:ci: travistemplate: linux-packages/travis.linux.arm64.ymlparams:- build_task: "apt:build"target: "ubuntu-xenial-arm64"+ task_namespace: "apt"upload_extensions:- .ddeb- .deb@@ -777,8 +777,8 @@ tasks:ci: githubtemplate: linux-packages/github.linux.amd64.ymlparams:- build_task: "apt:build"target: "ubuntu-bionic"+ task_namespace: "apt"upload_extensions:- .ddeb- .deb@@ -838,8 +838,8 @@ tasks:ci: travistemplate: linux-packages/travis.linux.arm64.ymlparams:- build_task: "apt:build"target: "ubuntu-bionic-arm64"+ task_namespace: "apt"upload_extensions:- .ddeb- .deb@@ -883,8 +883,8 @@ tasks:ci: githubtemplate: linux-packages/github.linux.amd64.ymlparams:- build_task: "apt:build"target: "ubuntu-focal"+ task_namespace: "apt"upload_extensions:- .ddeb- .deb@@ -944,8 +944,8 @@ tasks:ci: travistemplate: linux-packages/travis.linux.arm64.ymlparams:- build_task: "apt:build"target: "ubuntu-focal-arm64"+ task_namespace: "apt"upload_extensions:- .ddeb- .deb@@ -989,8 +989,8 @@ tasks:ci: githubtemplate: linux-packages/github.linux.amd64.ymlparams:- build_task: "apt:build"target: "ubuntu-groovy"+ task_namespace: "apt"upload_extensions:- .ddeb- .deb@@ -1050,8 +1050,8 @@ tasks:ci: travistemplate: linux-packages/travis.linux.arm64.ymlparams:- build_task: "apt:build"target: "ubuntu-groovy-arm64"+ task_namespace: "apt"upload_extensions:- .ddeb- .deb@@ -1095,8 +1095,8 @@ tasks:ci: githubtemplate: linux-packages/github.linux.amd64.ymlparams:- build_task: "yum:build"target: "centos-7"+ task_namespace: yumupload_extensions:- .rpmartifacts:@@ -1132,8 +1132,8 @@ tasks:ci: travistemplate: linux-packages/travis.linux.arm64.ymlparams:- build_task: "yum:build"target: "centos-7-aarch64"+ task_namespace: yumupload_extensions:- .rpmartifacts:@@ -1167,8 +1167,8 @@ tasks:ci: githubtemplate: linux-packages/github.linux.amd64.ymlparams:- build_task: "yum:build"target: "centos-8"+ task_namespace: yumupload_extensions:- .rpmartifacts:@@ -1226,8 +1226,8 @@ tasks:ci: travistemplate: linux-packages/travis.linux.arm64.ymlparams:- build_task: "yum:build"target: "centos-8-aarch64"+ task_namespace: yumupload_extensions:- .rpmartifacts: