Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release-build: build cri-o for each Kubernetes version #83

Merged
merged 1 commit into from
Aug 2, 2024
Merged
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
32 changes: 27 additions & 5 deletions release_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ echo "================================================="
KBS_VERS=$(curl -fsSL --retry-delay 1 --retry 60 --retry-connrefused \
--retry-max-time 60 --connect-timeout 20 \
https://raw.githubusercontent.com/kubernetes/website/main/data/releases/schedule.yaml \
| yq -r '.schedules[] | .previousPatches[0] // (.release = .release + ".0") | .release' \
| awk '{print "kubernetes-v"$1}')
| yq -r '.schedules[] | .previousPatches[0] // (.release = .release + ".0") | .release')
if [[ -z "${KBS_VERS}" ]] ; then
echo "Failed fetching Kubernetes versions"
exit 1
Expand All @@ -25,6 +24,21 @@ fi
KBS_VERS_ARRAY=(${KBS_VERS})
printf "%s\n" "${KBS_VERS_ARRAY[@]}"

echo "Fetching list of latest CRI-O patch releases"
echo "================================================="

git ls-remote --tags --sort=-v:refname https://github.com/cri-o/cri-o \
| grep -v "{}" \
| awk '{ print $2}' \
| cut --delimiter='/' --fields=3 \
> crio.txt

CRIO=()
for r in "${KBS_VERS_ARRAY[@]}"; do
version=$(cat crio.txt | grep "v${r%.*}" | head -n1)
CRIO+=( "crio-${version:1}" )
done

echo
echo "Fetching previous 'latest' release sysexts"
echo "=========================================="
Expand All @@ -47,7 +61,15 @@ echo "================"

mapfile -t images < <( awk '{ content=sub("[[:space:]]*#.*", ""); if ($0) print $0; }' \
release_build_versions.txt )
images+=("${KBS_VERS_ARRAY[@]}")

KUBERNETES=()
for v in "${KBS_VERS_ARRAY[@]}"; do
KUBERNETES+=( "kubernetes-v${v}" )
done
images+=( "${CRIO[@]}" )
images+=( "${KUBERNETES[@]}" )

echo "building: ${images[@]}"

echo "# Release $(date '+%Y-%m-%d %R')" > Release.md
echo "The release adds the following sysexts:" >> Release.md
Expand All @@ -67,8 +89,8 @@ for image in "${images[@]}"; do
echo "* ${target}" >> Release.md
done
streams+=("${component}:-@v")
if [ "${component}" = "kubernetes" ]; then
streams+=("kubernetes-${version%.*}:.@v")
if [ "${component}" = "kubernetes" ] || [ "${component}" = "crio" ]; then
streams+=("${component}-${version%.*}:.@v")
# Should give, e.g., v1.28 for v1.28.2 (use ${version#*.*.} to get 2)
fi
done
Expand Down
4 changes: 1 addition & 3 deletions release_build_versions.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Versions to build.

# For Kubernetes, we fetch the latest versions to be built.
# For Kubernetes and CRI-O, we fetch the latest versions to be built.
# The below lists _additional_ kubernetes versions to be built.

kubernetes-v1.28.5 # required for CAPO CI
Expand All @@ -23,8 +23,6 @@ wasmcloud-1.0.0

tailscale-1.70.0

crio-1.28.4

k3s-v1.29.2+k3s1

rke2-v1.29.2+rke2r1