diff --git a/.github/workflows/kagome-builder-deb.yaml b/.github/workflows/kagome-builder-deb.yaml index 850b722fcf..32afca8fdd 100644 --- a/.github/workflows/kagome-builder-deb.yaml +++ b/.github/workflows/kagome-builder-deb.yaml @@ -4,7 +4,7 @@ # SPDX-License-Identifier: Apache-2.0 # -name: Kagome Builder | Debian (Bookworm) +name: Kagome Builder | Debian (trixie) on: # schedule: diff --git a/housekeeping/docker/kagome-dev/Makefile b/housekeeping/docker/kagome-dev/Makefile index 9377017f61..d1669308e4 100644 --- a/housekeeping/docker/kagome-dev/Makefile +++ b/housekeeping/docker/kagome-dev/Makefile @@ -1,6 +1,6 @@ # Shared Environment Variables -# bookworm (Debian 12) -MINIDEB_IMAGE ?= bitnami/minideb@sha256:6cc3baf349947d587a9cd4971e81ff3ffc0d17382f2b5b6de63d6542bff10c16 +# trixie (Debian 13) +MINIDEB_IMAGE ?= debian:trixie-slim@sha256:c63174f799a74411a0290f25086fdc5dc939aa1f8971a16ad6fb1b7658a25126 ## DOCKER_REGISTRY_PATH empty for local usage DOCKER_REGISTRY_PATH ?= DOCKERHUB_REGISTRY_PATH ?= qdrvm/kagome @@ -13,7 +13,7 @@ PACKAGE_ARCHITECTURE ?= amd64 BUILD_TYPE ?= Release # Generated versions -MINIDEB_HASH := $(subst bitnami/minideb@sha256:,,$(MINIDEB_IMAGE)) +MINIDEB_HASH := $(subst debian:trixie-slim@sha256:,,$(MINIDEB_IMAGE)) MINIDEB_SHORT_HASH := $(shell echo $(MINIDEB_HASH) | cut -c1-7) MINIDEB_TAG = $(MINIDEB_SHORT_HASH)_rust-$(RUST_VERSION) diff --git a/housekeeping/docker/kagome-dev/install_packages b/housekeeping/docker/kagome-dev/install_packages new file mode 100644 index 0000000000..c957764744 --- /dev/null +++ b/housekeeping/docker/kagome-dev/install_packages @@ -0,0 +1,24 @@ +#!/bin/sh +set -e +set -u +export DEBIAN_FRONTEND=noninteractive +n=0 +max=2 +until [ $n -gt $max ]; do + set +e + ( + apt-get update -qq && + apt-get install -y --no-install-recommends "$@" + ) + CODE=$? + set -e + if [ $CODE -eq 0 ]; then + break + fi + if [ $n -eq $max ]; then + exit $CODE + fi + echo "apt failed, retrying" + n=$(($n + 1)) +done +rm -r /var/lib/apt/lists /var/cache/apt/archives diff --git a/housekeeping/docker/kagome-dev/kagome_builder_deb.Dockerfile b/housekeeping/docker/kagome-dev/kagome_builder_deb.Dockerfile index ee24636838..972089b6d2 100644 --- a/housekeeping/docker/kagome-dev/kagome_builder_deb.Dockerfile +++ b/housekeeping/docker/kagome-dev/kagome_builder_deb.Dockerfile @@ -4,7 +4,7 @@ ARG BASE_IMAGE ARG RUST_VERSION ARG ARCHITECTURE=x86_64 -ARG DEBIAN_VERSION=bookworm +ARG DEBIAN_VERSION=unstable ARG LLVM_VERSION=19 ARG GCC_VERSION=13 @@ -24,6 +24,9 @@ ENV LLVM_VERSION=${LLVM_VERSION} ARG GCC_VERSION ENV GCC_VERSION=${GCC_VERSION} +COPY install_packages /usr/sbin/install_packages +RUN chmod 0755 /usr/sbin/install_packages + RUN install_packages \ apt-transport-https \ ca-certificates \ @@ -31,9 +34,13 @@ RUN install_packages \ wget RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --dearmor -o /usr/share/keyrings/llvm-archive-keyring.gpg -RUN echo "deb [signed-by=/usr/share/keyrings/llvm-archive-keyring.gpg] http://apt.llvm.org/${DEBIAN_VERSION}/ llvm-toolchain-${DEBIAN_VERSION}-${LLVM_VERSION} main" | \ - tee -a /etc/apt/sources.list.d/llvm.list -RUN echo "deb http://deb.debian.org/debian/ trixie main" | tee -a /etc/apt/sources.list +RUN if [ "$DEBIAN_VERSION" = "unstable" ]; then \ + echo "deb [signed-by=/usr/share/keyrings/llvm-archive-keyring.gpg] http://apt.llvm.org/${DEBIAN_VERSION}/ llvm-toolchain-${LLVM_VERSION} main" | \ + tee -a /etc/apt/sources.list.d/llvm.list; \ + else \ + echo "deb [signed-by=/usr/share/keyrings/llvm-archive-keyring.gpg] http://apt.llvm.org/${DEBIAN_VERSION}/ llvm-toolchain-${DEBIAN_VERSION}-${LLVM_VERSION} main" | \ + tee -a /etc/apt/sources.list.d/llvm.list; \ + fi RUN install_packages \ build-essential \ diff --git a/housekeeping/docker/kagome-dev/minideb.Dockerfile b/housekeeping/docker/kagome-dev/minideb.Dockerfile index ffbaaed3e3..75b4035543 100644 --- a/housekeeping/docker/kagome-dev/minideb.Dockerfile +++ b/housekeeping/docker/kagome-dev/minideb.Dockerfile @@ -16,6 +16,9 @@ ENV AUTHOR=${AUTHOR} LABEL org.opencontainers.image.authors="${AUTHOR}" LABEL org.opencontainers.image.description="Kagome image" +COPY install_packages /usr/sbin/install_packages +RUN chmod 0755 /usr/sbin/install_packages + RUN install_packages \ bash \ software-properties-common \ @@ -65,11 +68,6 @@ RUN --mount=type=secret,id=google_creds,target=/root/.gcp/google_creds.json \ kagome-dev=${KAGOME_PACKAGE_VERSION} && \ sed -i '1s/^/#/' /etc/apt/sources.list.d/kagome.list -# temporary fix for libc6 (gcc-13) -# TODO: remove when CI swithed to trixie -RUN echo "deb http://deb.debian.org/debian/ trixie main" | tee -a /etc/apt/sources.list && apt update -RUN apt install -y libc6 libstdc++6 libgcc-s1 -t trixie - CMD ["/usr/bin/tini", "--", "/bin/bash", "-c"] diff --git a/zombienet/docker/Makefile b/zombienet/docker/Makefile index 9909bfc9cf..da64933308 100644 --- a/zombienet/docker/Makefile +++ b/zombienet/docker/Makefile @@ -1,6 +1,6 @@ # Shared Environment Variables -# bookworm (Debian 12) -MINIDEB_IMAGE=bitnami/minideb@sha256:6cc3baf349947d587a9cd4971e81ff3ffc0d17382f2b5b6de63d6542bff10c16 +# trixie (Debian 13) +MINIDEB_IMAGE ?= debian:trixie-slim@sha256:c63174f799a74411a0290f25086fdc5dc939aa1f8971a16ad6fb1b7658a25126 ## DOCKER_REGISTRY_PATH empty for local usage DOCKER_REGISTRY_PATH ?= GOOGLE_APPLICATION_CREDENTIALS ?= diff --git a/zombienet/docker/install_packages b/zombienet/docker/install_packages new file mode 100644 index 0000000000..c957764744 --- /dev/null +++ b/zombienet/docker/install_packages @@ -0,0 +1,24 @@ +#!/bin/sh +set -e +set -u +export DEBIAN_FRONTEND=noninteractive +n=0 +max=2 +until [ $n -gt $max ]; do + set +e + ( + apt-get update -qq && + apt-get install -y --no-install-recommends "$@" + ) + CODE=$? + set -e + if [ $CODE -eq 0 ]; then + break + fi + if [ $n -eq $max ]; then + exit $CODE + fi + echo "apt failed, retrying" + n=$(($n + 1)) +done +rm -r /var/lib/apt/lists /var/cache/apt/archives diff --git a/zombienet/docker/zombie_tester.Dockerfile b/zombienet/docker/zombie_tester.Dockerfile index bc71b0dd10..2c881bf6eb 100644 --- a/zombienet/docker/zombie_tester.Dockerfile +++ b/zombienet/docker/zombie_tester.Dockerfile @@ -24,6 +24,9 @@ ENV ZOMBIENET_RELEASE=$ZOMBIENET_RELEASE ARG POLKADOT_SDK_RELEASE ENV POLKADOT_SDK_RELEASE=$POLKADOT_SDK_RELEASE +COPY install_packages /usr/sbin/install_packages +RUN chmod 0755 /usr/sbin/install_packages + RUN groupadd --gid 10000 nonroot && \ useradd --home-dir /home/nonroot \ --create-home \ @@ -128,8 +131,3 @@ RUN install_packages \ libseccomp2 \ libatomic1 \ ssh - -# temporary fix for libc6 (gcc-13) -# TODO: remove when CI swithed to trixie -RUN echo "deb http://deb.debian.org/debian/ trixie main" | tee -a /etc/apt/sources.list && apt update -RUN apt install -y libc6 libstdc++6 libgcc-s1 -t trixie