From 051cef73da4822363e9f07fd2cbcebd4084ada4a Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Sep 06 2024 18:00:47 +0000 Subject: Limit sync to /pub to once per day Signed-off-by: Stephen Gallagher --- diff --git a/eln-nightly.sh b/eln-nightly.sh index 180e6ba..def5627 100755 --- a/eln-nightly.sh +++ b/eln-nightly.sh @@ -92,53 +92,55 @@ fi ./releng/scripts/critpath.py --composeurl file://$DESTDIR/compose -o $DESTDIR/logs/critpath.txt rawhide &> $DESTDIR/logs/critpath.log } -# Tell interested persons that the rsync is starting (zomg!) -send_fedora_message "${fedora_message_json_start}" ${RELEASE} rsync.start - -# Sync the content to /pub/fedora-eln -if [ ! -d "$RSYNCTARGET" ]; then - $RSYNCPREFIX mkdir -p "$RSYNCTARGET" -fi - -included_variants=( - AppStream - BaseOS - CRB - Extras - HighAvailability - NFV - ResilientStorage - RT - SAP - SAPHANA -) -$RSYNCPREFIX compose-partial-copy \ - --arch=aarch64 --arch=x86_64 --arch=ppc64le --arch=s390x --arch=src \ - "$DESTDIR" "$RSYNCTARGET/" \ - ${variants[@]/#/--variant } \ - --exclude=repodata -$RSYNCPREFIX compose-partial-copy \ - --arch=aarch64 --arch=x86_64 --arch=ppc64le --arch=s390x --arch=src \ - "$DESTDIR" "$RSYNCTARGET/" \ - ${variants[@]/#/--variant } \ - --delete-after -$RSYNCPREFIX rm "$RSYNCTARGET/.composeinfo" -$RSYNCPREFIX ./releng/scripts/build_composeinfo "$RSYNCTARGET/" --name "$NEWCOMPOSE_ID" - -# hardlink content -time hardlink -v "$RSYNCTARGET" - -# Tell interested persons that the rsync is done. -send_fedora_message "${fedora_message_json_done}" ${RELEASE} rsync.complete - - -# Tell everyone by fedora_message about the compose -send_fedora_message "${fedora_message_json_done}" ${RELEASE} complete - -# Tell everyone by email about the compose -# "$DESTDIR/logs/depcheck" lets not cat out depcheck for now as it does -# not understand rich dependencies +# Only do the sync and report on the first successful compose of a particular day if [[ $NEWCOMPOSE_DATE -gt $OLDCOMPOSE_DATE ]]; then + # NOTE: If a second synced compose is needed on a particular day, manually + # replace the contents of $TARGET_DIR/LAST_COMPOSE_ID to a compose ID of the + # previous day prior to starting this compose. + + # Tell interested persons that the rsync is starting (zomg!) + send_fedora_message "${fedora_message_json_start}" ${RELEASE} rsync.start + + # Sync the content to /pub/fedora-eln + if [ ! -d "$RSYNCTARGET" ]; then + $RSYNCPREFIX mkdir -p "$RSYNCTARGET" + fi + + included_variants=( + AppStream + BaseOS + CRB + Extras + HighAvailability + NFV + ResilientStorage + RT + SAP + SAPHANA + ) + $RSYNCPREFIX compose-partial-copy \ + --arch=aarch64 --arch=x86_64 --arch=ppc64le --arch=s390x --arch=src \ + "$DESTDIR" "$RSYNCTARGET/" \ + ${variants[@]/#/--variant } \ + --exclude=repodata + $RSYNCPREFIX compose-partial-copy \ + --arch=aarch64 --arch=x86_64 --arch=ppc64le --arch=s390x --arch=src \ + "$DESTDIR" "$RSYNCTARGET/" \ + ${variants[@]/#/--variant } \ + --delete-after + $RSYNCPREFIX rm "$RSYNCTARGET/.composeinfo" + $RSYNCPREFIX ./releng/scripts/build_composeinfo "$RSYNCTARGET/" --name "$NEWCOMPOSE_ID" + + # hardlink content + time hardlink -v "$RSYNCTARGET" + + # Tell interested persons that the rsync is done. + send_fedora_message "${fedora_message_json_done}" ${RELEASE} rsync.complete + + # Tell everyone by email about the compose + # "$DESTDIR/logs/depcheck" lets not cat out depcheck for now as it does + # not understand rich dependencies + # Only send one compose report per day or we'll be spamming # the devel list. SUBJECT='Fedora '$RELEASE' compose report: '$SHORTCOMPOSE_ID' changes' @@ -151,6 +153,10 @@ if [[ $NEWCOMPOSE_DATE -gt $OLDCOMPOSE_DATE ]]; then echo -n $NEWCOMPOSE_ID > $TARGET_DIR/LAST_COMPOSE_ID fi + +# Tell everyone by fedora_message about the compose +send_fedora_message "${fedora_message_json_done}" ${RELEASE} complete + # Copy the metadata to the non-garbage-collected metadata archive YEAR=$(echo "${SHORTCOMPOSE_ID}" | cut -c1-4) mkdir -p "${MD_ARCHIVE_DIR}/${YEAR}/${NEWCOMPOSE_ID}"