From ac5acbca9237bec75f01095ed8979ffb0f1943f4 Mon Sep 17 00:00:00 2001 From: Marcin Juszkiewicz Date: Mon, 3 Jun 2019 11:40:47 +0200 Subject: [PATCH] centos-mirror-update: handle non-x86 architectures CentOS keeps non-x86 architectures in /altarch/ directory (contrary to /centos/ one for x86-64). We have aarch64 (arm64) machines in infra and they fail due to lack of CentOS altarch mirror. List of wanted alternative architectures is controlled by ALTARCHS variable (aarch64 and ppc64le enabled). As CentOS has several other architectures too they are listed in ALTARCHS_IGNORED so we do not fetch them. Current CentOS mirror lands in same /mirror/centos/7/ directory. Altarch mirrors goes to /mirror/centos/altarch/7/ one. Change-Id: I0e110ef51c8ed301fd8280ae7fc039e3b01db92c --- .../files/mirror/centos-mirror-update.sh | 42 ++++++++++++++----- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/modules/openstack_project/files/mirror/centos-mirror-update.sh b/modules/openstack_project/files/mirror/centos-mirror-update.sh index 647b96b612..541bcfcf6b 100755 --- a/modules/openstack_project/files/mirror/centos-mirror-update.sh +++ b/modules/openstack_project/files/mirror/centos-mirror-update.sh @@ -24,28 +24,50 @@ fi BASE="/afs/.openstack.org/mirror/centos" MIRROR="rsync://mirror.lstn.net" +MIRROR_ALTARCH="rsync://mirror.freethought-internet.co.uk/centos-altarch/" K5START="k5start -t -f /etc/centos.keytab service/centos-mirror -- $TIMEOUT" -REPO=7 -if ! [ -f $BASE/$REPO ]; then - $K5START mkdir -p $BASE/$REPO -fi +REPOS="7 altarch/7" +ALTARCHS="aarch64 ppc64le" +ALTARCHS_IGNORED="armhfp i386 power9 ppc64 x86_64" # altarch/kernel/ has x86_64 dir we do not want -date --iso-8601=ns -echo "Running rsync..." -$K5START rsync -rlptDvz \ +for REPO in $REPOS; do + if ! [ -f $BASE/$REPO ]; then + $K5START mkdir -p $BASE/$REPO + fi + + MIRROR_PATH=$MIRROR/$REPO/ + EXTRA_OPTS="--links" # -l + if [[ $REPO == "altarch"* ]]; then + MIRROR_PATH=$MIRROR_ALTARCH/7/ + EXTRA_OPTS="--copy-links" # copy because altarch has symlinks to ../7.6.1810/ + + for arch in $ALTARCHS_IGNORED; do + EXTRA_OPTS="$EXTRA_OPTS --exclude=$arch" + done + for arch in $ALTARCHS; do + EXTRA_OPTS="$EXTRA_OPTS --include *.${arch}.rpm" + done + fi + + date --iso-8601=ns + echo "Running rsync..." + $K5START rsync -rptDvz \ --delete \ --delete-excluded \ --exclude="atomic" \ --exclude="centosplus" \ + --exclude="experimental" \ --exclude="fasttrack" \ --exclude="isos" \ --exclude="paas" \ --exclude="sclo" \ - --exclude="x86_64/drpms" \ - $MIRROR/centos/$REPO/ $BASE/$REPO/ + --exclude="*/drpms" \ + $EXTRA_OPTS \ + $MIRROR_PATH $BASE/$REPO/ -# TODO(pabelanger): Validate rsync process + # TODO(pabelanger): Validate rsync process +done date --iso-8601=ns | $K5START tee $BASE/timestamp.txt echo "rsync completed successfully, running vos release."