Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion dev/release/binary-recover.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,26 @@ fi
# To deactivate one category, deactivate the category and all of its dependents.
# To explicitly select one category, set RECOVER_DEFAULT=0 RECOVER_X=1.
: "${RECOVER_DEFAULT:=1}"
: "${RECOVER_ALMALINUX:=${RECOVER_DEFAULT}}"
: "${RECOVER_AMAZON_LINUX:=${RECOVER_DEFAULT}}"
: "${RECOVER_CENTOS:=${RECOVER_DEFAULT}}"
: "${RECOVER_DEBIAN:=${RECOVER_DEFAULT}}"
: "${RECOVER_UBUNTU:=${RECOVER_DEFAULT}}"

rake_tasks=()
apt_targets=()
if [ "${RECOVER_ALMALINUX}" -gt 0 ]; then
rake_tasks+=(yum:recover)
yum_targets+=(almalinux)
fi
if [ "${RECOVER_AMAZON_LINUX}" -gt 0 ]; then
rake_tasks+=(yum:recover)
yum_targets+=(amazon-linux)
fi
if [ "${RECOVER_CENTOS}" -gt 0 ]; then
rake_tasks+=(yum:recover)
yum_targets+=(centos)
fi
if [ "${RECOVER_DEBIAN}" -gt 0 ]; then
rake_tasks+=(apt:recover)
apt_targets+=(debian)
Expand All @@ -74,4 +89,8 @@ docker_run \
RC="" \
STAGING="${STAGING:-no}" \
VERBOSE="${VERBOSE:-no}" \
VERSION=""
VERSION="" \
YUM_TARGETS="$(
IFS=,
echo "${yum_targets[*]}"
)"
79 changes: 77 additions & 2 deletions dev/release/binary-task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1771,7 +1771,6 @@ def define_apt_rc_tasks
end

def define_apt_release_tasks

namespace :apt do
desc "Release APT repository"
task :release do
Expand All @@ -1796,7 +1795,7 @@ def define_apt_recover_tasks
download_distribution(:artifactory,
distribution,
code_name_dir,
:base,
:all,
pattern: pattern,
prefix: "pool/#{code_name}")
end
Expand Down Expand Up @@ -1854,6 +1853,10 @@ def yum_release_repositories_dir
"#{release_dir}/yum/repositories"
end

def yum_recover_repositories_dir
"#{recover_dir}/yum/repositories"
end

def available_yum_targets
[
["almalinux", "10"],
Expand Down Expand Up @@ -2189,10 +2192,82 @@ def define_yum_release_tasks
end
end

def define_yum_recover_tasks
namespace :yum do
namespace :recover do
desc "Download repositories"
task :download do
yum_targets.each do |distribution, version|
not_checksum_pattern = /.+(?<!\.asc|\.sha512)\z/
target_dir = File.join(yum_recover_repositories_dir,
distribution,
version)
pattern = not_checksum_pattern
download_distribution(:artifactory,
distribution,
target_dir,
:all,
pattern: pattern,
prefix: version)
end
end

desc "Update repositories"
task :update do
yum_targets.each do |distribution, version|
version_dir = File.join(yum_recover_repositories_dir,
distribution,
version)
next if File.symlink?(version_dir)
next unless File.exist?(version_dir)
Dir.glob("#{version_dir}/*") do |arch_dir|
next unless File.directory?(arch_dir)
sh("createrepo_c",
arch_dir,
out: default_output,
verbose: verbose?)
end
end
end

desc "Upload repositories"
task :upload do
yum_targets.each do |distribution, version|
version_dir = File.join(yum_recover_repositories_dir,
distribution,
version)
next if File.symlink?(version_dir)
next unless File.exist?(version_dir)
Dir.glob("#{version_dir}/*/repodata") do |repodata_dir|
next unless File.directory?(repodata_dir)
arch = File.basename(File.dirname(repodata_dir))
prefix = "#{version}/#{arch}/repodata"
uploader = ArtifactoryUploader.new(api_key: artifactory_api_key,
destination_prefix: prefix,
distribution: distribution,
source: repodata_dir,
staging: staging?)
uploader.upload
end
end
end
end

desc "Recover Yum repositories"
yum_recover_tasks = [
"yum:recover:download",
"yum:recover:update",
"yum:recover:upload",
]
task :recover => yum_recover_tasks
end
end

def define_yum_tasks
define_yum_staging_tasks
define_yum_rc_tasks
define_yum_release_tasks
define_yum_recover_tasks
end

def define_summary_tasks
Expand Down
17 changes: 17 additions & 0 deletions docs/source/developers/release.rst
Original file line number Diff line number Diff line change
Expand Up @@ -714,3 +714,20 @@ Be sure to go through on the following checklist:
dev/release/post-07-remove-old-artifacts.sh

Note: This step must be done by a PMC member.

Trouble shooting
================

How to recover broken metadata of APT/Yum repositories
------------------------------------------------------

Our release system has only one RC space for APT/Yum
repositories. apache/arrow and apache/arrow-adbc shares the RC
space. So metadata APT/Yum repositories may be broken when we cut an
RC for apache/arrow and apache/arrow-adbc at the same time.

We can re-generate and upload metadata by the following command line:

.. code-block:: shell

dev/release/binary-recover.sh
Loading