From e8fe70fe8d2bd52c8b67fe9400f86326334d089d Mon Sep 17 00:00:00 2001 From: Mathieu Tortuyaux Date: Tue, 19 Nov 2024 13:32:19 +0100 Subject: [PATCH 1/3] build_versions: remove k3s and rke2 k3s and rke2 are now synced with kubernetes versions Signed-off-by: Mathieu Tortuyaux --- release_build_versions.txt | 8 -------- 1 file changed, 8 deletions(-) diff --git a/release_build_versions.txt b/release_build_versions.txt index a81edc5..5cfb4df 100644 --- a/release_build_versions.txt +++ b/release_build_versions.txt @@ -23,14 +23,6 @@ wasmcloud-1.2.1 tailscale-1.70.0 -k3s-v1.29.9+k3s1 -k3s-v1.30.5+k3s1 -k3s-v1.31.1+k3s1 - -rke2-v1.29.9+rke2r1 -rke2-v1.30.5+rke2r1 -rke2-v1.31.1+rke2r1 - nvidia_runtime-v1.16.2 ollama-0.3.9 From 8b0f4c71d623e6610a880fca89003a6d1851e584 Mon Sep 17 00:00:00 2001 From: Mathieu Tortuyaux Date: Tue, 19 Nov 2024 13:49:06 +0100 Subject: [PATCH 2/3] crio: make usage of 'v$VERSION' consistent let's use the version with a 'v', similar to kubernetes or k3s. Signed-off-by: Mathieu Tortuyaux --- create_crio_sysext.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/create_crio_sysext.sh b/create_crio_sysext.sh index b7b1944..92edc0d 100755 --- a/create_crio_sysext.sh +++ b/create_crio_sysext.sh @@ -6,7 +6,7 @@ SCRIPTFOLDER="$(dirname "$(readlink -f "$0")")" if [ $# -lt 2 ] || [ "$1" = "-h" ] || [ "$1" = "--help" ]; then echo "Usage: $0 VERSION SYSEXTNAME" - echo "The script will download the cri-o release binaries (e.g., for 1.28.4) and create a sysext squashfs image with the name SYSEXTNAME.raw in the current folder." + echo "The script will download the cri-o release binaries (e.g., for v1.28.4) and create a sysext squashfs image with the name SYSEXTNAME.raw in the current folder." echo "A temporary directory named SYSEXTNAME in the current folder will be created and deleted again." echo "All files in the sysext image will be owned by root." echo "To use arm64 pass 'ARCH=arm64' as environment variable (current value is '${ARCH}')." @@ -18,6 +18,9 @@ fi VERSION="$1" SYSEXTNAME="$2" +# For compatibility with existing automation. +[[ "${VERSION}" == v* ]] || VERSION="v${VERSION}" + # The github release uses different arch identifiers (not the same as in the other scripts here), # we map them here and rely on bake.sh to map them back to what systemd expects if [ "${ARCH}" = "x86_64" ] || [ "${ARCH}" = "x86-64" ]; then @@ -26,11 +29,11 @@ elif [ "${ARCH}" = "aarch64" ]; then ARCH="arm64" fi -rm -f "cri-o.${ARCH}.v${VERSION}.tar.gz" -curl -o "cri-o.${ARCH}.v${VERSION}.tar.gz" -fsSL "https://storage.googleapis.com/cri-o/artifacts/cri-o.${ARCH}.v${VERSION}.tar.gz" +rm -f "cri-o.${ARCH}.${VERSION}.tar.gz" +curl -o "cri-o.${ARCH}.${VERSION}.tar.gz" -fsSL "https://storage.googleapis.com/cri-o/artifacts/cri-o.${ARCH}.${VERSION}.tar.gz" rm -rf "${SYSEXTNAME}" mkdir -p "${SYSEXTNAME}" "${SYSEXTNAME}/tmp" -tar --force-local -xf "cri-o.${ARCH}.v${VERSION}.tar.gz" -C "${SYSEXTNAME}/tmp" +tar --force-local -xf "cri-o.${ARCH}.${VERSION}.tar.gz" -C "${SYSEXTNAME}/tmp" cd "${SYSEXTNAME}/tmp/cri-o/" sed -i '/^sed -i.*DESTDIR/d' install # removes sed replacements from install script to keep the default location (/usr) in the base config file DESTDIR="${PWD}/../../../${SYSEXTNAME}" PREFIX=/usr ETCDIR=$PREFIX/share/crio/etc OCIDIR=$PREFIX/share/oci-umount/oci-umount.d \ From 2f9fab2d5e2b2e6cc043d0df08de204e880d8f73 Mon Sep 17 00:00:00 2001 From: Mathieu Tortuyaux Date: Tue, 19 Nov 2024 14:06:10 +0100 Subject: [PATCH 3/3] release_build: sync k3s and rke2 w/ kubernetes This will sync those software with major kubernetes version at each release. No need to maintain a version file for these components. Signed-off-by: Mathieu Tortuyaux Co-authored-by: Krzesimir Nowak --- release_build.sh | 62 ++++++++++++++++++++++++++++++------------------ 1 file changed, 39 insertions(+), 23 deletions(-) diff --git a/release_build.sh b/release_build.sh index 22bc534..853735c 100755 --- a/release_build.sh +++ b/release_build.sh @@ -25,24 +25,37 @@ 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 - if ! grep -q "v${r%.*}" crio.txt; then - echo "Skipping $r" - continue - fi - version=$(cat crio.txt | grep "v${r%.*}" | head -n1) - CRIO+=( "crio-${version:1}" ) -done +# fetch_releases returns available for a given software +# based on Kubernetes major versions. +function fetch_releases { + local software="${1}" + local file; file=$(mktemp) + local versions=() + + git ls-remote --tags --sort=-v:refname "https://github.com/${software}" \ + | grep -v "{}" \ + | awk '{ print $2}' \ + | cut --delimiter='/' --fields=3 \ + > "${file}" + + local version component r + for r in "${KBS_VERS_ARRAY[@]}"; do + if ! grep -q "v${r%.*}" "${file}"; then + echo "Skipping $r" + continue + fi + version=$(cat "${file}" | grep "v${r%.*}" | grep -v "rc"| head -n1) + component="${software#*/}" + + # remove extra '-' from component name (e.g cri-o -> crio) + component="${component//-/}" + versions+=( "${component}-${version}" ) + done + + rm -f "${file}" + + echo "${versions[@]}" +} echo echo "Fetching previous 'latest' release sysexts" @@ -71,7 +84,9 @@ KUBERNETES=() for v in "${KBS_VERS_ARRAY[@]}"; do KUBERNETES+=( "kubernetes-v${v}" ) done -images+=( "${CRIO[@]}" ) +images+=( $(fetch_releases "k3s-io/k3s") ) +images+=( $(fetch_releases "cri-o/cri-o") ) +images+=( $(fetch_releases "rancher/rke2") ) images+=( "${KUBERNETES[@]}" ) echo "building: ${images[@]}" @@ -94,10 +109,11 @@ for image in "${images[@]}"; do echo "* ${target}" >> Release.md done streams+=("${component}:-@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 + case "${component}" in + kubernetes|crio|rke2|k3s) + # Should give, e.g., v1.28 for v1.28.2 (use ${version#*.*.} to get 2) + streams+=("${component}-${version%.*}:.@v") + esac done echo "" >> Release.md