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 \ 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 diff --git a/release_build_versions.txt b/release_build_versions.txt index 55a96b4..d40d4f2 100644 --- a/release_build_versions.txt +++ b/release_build_versions.txt @@ -25,14 +25,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