Skip to content

Commit

Permalink
release-build: build cri-o for each Kubernetes version
Browse files Browse the repository at this point in the history
CRI-O is coupled to Kubernetes for the releases, while the major and the
minor follows Kubernetes streams, the patch version is independant, so
we need to fetch the latest patch release for each minor Kubernetes
version.

sysupdate configuration is generated similar to Kubernetes.

Signed-off-by: Mathieu Tortuyaux <[email protected]>
  • Loading branch information
tormath1 committed Aug 2, 2024
1 parent 56de033 commit a1b1b80
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 8 deletions.
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

0 comments on commit a1b1b80

Please sign in to comment.