Skip to content

Commit

Permalink
Dummy out k8s_init.sh
Browse files Browse the repository at this point in the history
It's used in the initContainer but calls scripts that do not exist in this branch.
(The el9 deployment was touching .ignore-errors to get this script to pass.)
Until we delete the initContainers from the deployed repo instances,
turn k8s_init.sh into a dummy script.
  • Loading branch information
matyasselmeci committed Jan 6, 2025
1 parent 9a7e541 commit af7fbd6
Showing 1 changed file with 3 additions and 51 deletions.
54 changes: 3 additions & 51 deletions bin/k8s_init.sh
Original file line number Diff line number Diff line change
@@ -1,53 +1,5 @@
#!/bin/bash

REPO_BASEDIR="${REPO_BASEDIR:-/data}"
REPO_MAXAGE="${REPO_MAXAGE:-480}" # default of 8 hours (8*60 min)
REPO_TIMESTAMP="$REPO_BASEDIR/repo/osg/timestamp.txt"

# Show errors, but allow a sleep for container debugging
err_exit() {
echo "Error on line $(caller)" >&2
sleep 5m
if [ -f /.ignore-errors ] ; then
exit 0
else
exit 1
fi
}
trap 'err_exit' ERR

# Was timestamp file modified less than $REPO_MAXAGE minutes ago?
if test "$(find $REPO_TIMESTAMP -mmin -$REPO_MAXAGE)" ; then
echo "Repo is current. Skipping sync."
exit 0
fi

# Generate output directories
mkdir -p "$REPO_BASEDIR/mash" \
"$REPO_BASEDIR/mirror" \
"$REPO_BASEDIR/repo" \
"$REPO_BASEDIR/repo.previous" \
"$REPO_BASEDIR/repo.working"

# Generate mash config files
update_mashfiles.sh

# Reorder mash tags for less lock contention
rev /etc/osg-koji-tags/osg-tags | sort | rev > /tmp/osg-tags

# Download repo data in parallel
parallel --max-procs 12 --results /tmp/init --arg-file /tmp/osg-tags --retries 10 update_repo.sh {}

# Add symlink for mirrorlist
ln --no-target-directory --force --symbolic "$REPO_BASEDIR/mirror" "$REPO_BASEDIR/repo/mirror"

# Generate mirrorlist
update_mirror.py

# Note: we can't run repo-update-cadist here, since it downloads *from* repo

# Update tarballs
update_tarball-install.sh

# Create timestamp marker file
echo $(date) > $REPO_TIMESTAMP
# TODO: Delete this script once the initContainers have been removed from
# all repo instances.
exit 0

0 comments on commit af7fbd6

Please sign in to comment.