[XEN PATCH v1 3/6] CI: Refresh the Debian 12 arm64 container

Javi Merino posted 6 patches 1 month ago
There is a newer version of this series
[XEN PATCH v1 3/6] CI: Refresh the Debian 12 arm64 container
Posted by Javi Merino 1 month ago
Rework the container to use heredocs for readability and use apt-get
--no-install-recommends to keep the size down.  Rename the job to
debian-12-arm64-* to follow the naming scheme of all the other CI jobs.

This reduces the size of the debian:12-arm64v8 from 2.25GB down to 1.62GB.

Signed-off-by: Javi Merino <javi.merino@cloud.com>
---
 automation/build/debian/12-arm64v8.dockerfile | 68 +++++++++++++++++++
 .../build/debian/bookworm-arm64v8.dockerfile  | 55 ---------------
 automation/gitlab-ci/build.yaml               |  8 +--
 automation/gitlab-ci/test.yaml                |  4 +-
 automation/scripts/containerize               |  2 +-
 5 files changed, 75 insertions(+), 62 deletions(-)
 create mode 100644 automation/build/debian/12-arm64v8.dockerfile
 delete mode 100644 automation/build/debian/bookworm-arm64v8.dockerfile

diff --git a/automation/build/debian/12-arm64v8.dockerfile b/automation/build/debian/12-arm64v8.dockerfile
new file mode 100644
index 000000000000..4da1b074aedb
--- /dev/null
+++ b/automation/build/debian/12-arm64v8.dockerfile
@@ -0,0 +1,68 @@
+# syntax=docker/dockerfile:1
+FROM --platform=linux/arm64/v8 debian:bookworm
+LABEL maintainer.name="The Xen Project" \
+      maintainer.email="xen-devel@lists.xenproject.org"
+
+ENV DEBIAN_FRONTEND=noninteractive
+
+# build depends
+RUN <<EOF
+#!/bin/bash
+    set -eu
+
+    apt-get update
+    DEPS=(
+        # Xen
+        bison
+        build-essential
+        flex
+        # Flask
+        checkpolicy
+
+        # Tools (general)
+        git-core
+        libext2fs-dev
+        libfdt-dev
+        libglib2.0-dev
+        libpixman-1-dev
+        pkg-config
+        wget
+        # libxenguest dombuilder
+        libbz2-dev
+        liblzma-dev
+        liblzo2-dev
+        libzstd-dev
+        # libacpi
+        acpica-tools
+        # libxl
+        uuid-dev
+        libyajl-dev
+        # Python bindings
+        python3-dev
+        python3-setuptools
+        # Golang bindings
+        golang-go
+        # Ocaml bindings/oxenstored
+        ocaml-nox
+        ocaml-findlib
+
+        # for test phase, qemu-smoke-* jobs
+        busybox-static
+        ca-certificates
+        cpio
+        curl
+        device-tree-compiler
+        expect
+        u-boot-qemu
+        # for imagebuilder
+        file
+        u-boot-tools
+    )
+
+    apt-get -y --no-install-recommends install "${DEPS[@]}"
+
+    rm -rf /var/lib/apt/lists*
+EOF
+
+USER root
+WORKDIR /build
diff --git a/automation/build/debian/bookworm-arm64v8.dockerfile b/automation/build/debian/bookworm-arm64v8.dockerfile
deleted file mode 100644
index da8ae7512589..000000000000
--- a/automation/build/debian/bookworm-arm64v8.dockerfile
+++ /dev/null
@@ -1,55 +0,0 @@
-# syntax=docker/dockerfile:1
-FROM --platform=linux/arm64/v8 debian:bookworm
-LABEL maintainer.name="The Xen Project" \
-      maintainer.email="xen-devel@lists.xenproject.org"
-
-ENV DEBIAN_FRONTEND=noninteractive
-ENV USER root
-
-RUN mkdir /build
-WORKDIR /build
-
-# build depends
-RUN apt-get update && \
-    apt-get --quiet --yes install \
-        build-essential \
-        zlib1g-dev \
-        libncurses5-dev \
-        python3-dev \
-        python3-setuptools \
-        uuid-dev \
-        libyajl-dev \
-        libaio-dev \
-        libglib2.0-dev \
-        clang \
-        libpixman-1-dev \
-        pkg-config \
-        flex \
-        bison \
-        acpica-tools \
-        libfdt-dev \
-        bin86 \
-        bcc \
-        liblzma-dev \
-        libnl-3-dev \
-        ocaml-nox \
-        libfindlib-ocaml-dev \
-        markdown \
-        transfig \
-        pandoc \
-        checkpolicy \
-        wget \
-        git \
-        nasm \
-        # for test phase, qemu-smoke-* jobs
-        u-boot-qemu \
-        u-boot-tools \
-        device-tree-compiler \
-        curl \
-        cpio \
-        busybox-static \
-        expect \
-        && \
-        apt-get autoremove -y && \
-        apt-get clean && \
-        rm -rf /var/lib/apt/lists* /tmp/* /var/tmp/*
diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index 1b322044ab19..c687298cc924 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -407,15 +407,15 @@ debian-bookworm-gcc-arm32-debug-earlyprintk:
 
 # Arm builds
 
-debian-bookworm-gcc-arm64:
+debian-12-arm64-gcc:
   extends: .gcc-arm64-build
   variables:
-    CONTAINER: debian:bookworm-arm64v8
+    CONTAINER: debian:12-arm64v8
 
-debian-bookworm-gcc-debug-arm64:
+debian-12-arm64-gcc-debug:
   extends: .gcc-arm64-build-debug
   variables:
-    CONTAINER: debian:bookworm-arm64v8
+    CONTAINER: debian:12-arm64v8
 
 alpine-3.18-gcc-arm64:
   extends: .gcc-arm64-build
diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index 0812ddb42d9b..248281f47942 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -17,7 +17,7 @@
 .qemu-arm64:
   extends: .test-jobs-common
   variables:
-    CONTAINER: debian:bookworm-arm64v8
+    CONTAINER: debian:12-arm64v8
     LOGFILE: qemu-smoke-arm64.log
   artifacts:
     paths:
@@ -30,7 +30,7 @@
 .qemu-arm32:
   extends: .test-jobs-common
   variables:
-    CONTAINER: debian:bookworm-arm64v8
+    CONTAINER: debian:12-arm64v8
     LOGFILE: qemu-smoke-arm32.log
   artifacts:
     paths:
diff --git a/automation/scripts/containerize b/automation/scripts/containerize
index d72c22c103ff..1b75c8d93724 100755
--- a/automation/scripts/containerize
+++ b/automation/scripts/containerize
@@ -37,7 +37,7 @@ case "_${CONTAINER}" in
     _bookworm|_bookworm-x86_64|_) CONTAINER="${BASE}/debian:12-x86_64" ;;
     _bookworm-i386|_bookworm-x86_32) CONTAINER="${BASE}/debian:12-x86_32" ;;
     _bookworm-arm64v8-arm32-gcc) CONTAINER="${BASE}/debian:bookworm-arm64v8-arm32-gcc" ;;
-    _bookworm-arm64v8) CONTAINER="${BASE}/debian:bookworm-arm64v8" ;;
+    _bookworm-arm64v8) CONTAINER="${BASE}/debian:12-arm64v8" ;;
     _bookworm-cppcheck) CONTAINER="${BASE}/debian:bookworm-cppcheck" ;;
     _opensuse-leap|_leap) CONTAINER="${BASE}/opensuse:leap-15.6-x86_64" ;;
     _opensuse-tumbleweed|_tumbleweed) CONTAINER="${BASE}/opensuse:tumbleweed-x86_64" ;;
-- 
2.45.2
Re: [XEN PATCH v1 3/6] CI: Refresh the Debian 12 arm64 container
Posted by Stefano Stabellini 1 month ago
On Thu, 24 Oct 2024, Javi Merino wrote:
> Rework the container to use heredocs for readability and use apt-get
> --no-install-recommends to keep the size down.  Rename the job to
> debian-12-arm64-* to follow the naming scheme of all the other CI jobs.
> 
> This reduces the size of the debian:12-arm64v8 from 2.25GB down to 1.62GB.

Hi Javi, I am a bit confused by the new list of packages. I diff'ed the
old list with the new list, and I appended the difference below. Maybe I
ask how did you manage to make the new list? As an example, are bcc and
bin86 necessary?

 acpica-tools
+bcc
+bin86
 bison
 build-essential
 busybox-static
-ca-certificates
 checkpolicy
+clang
 cpio
 curl
 device-tree-compiler
 expect
-file
 flex
-git-core
-golang-go
-libbz2-dev
-libext2fs-dev
+git
+libaio-dev
 libfdt-dev
+libfindlib-ocaml-dev
 libglib2.0-dev
 liblzma-dev
-liblzo2-dev
+libncurses5-dev
+libnl-3-dev
 libpixman-1-dev
 libyajl-dev
-libzstd-dev
-ocaml-findlib
+markdown
+nasm
 ocaml-nox
+pandoc
 pkg-config
 python3-dev
 python3-setuptools
+transfig
 u-boot-qemu
 u-boot-tools
 uuid-dev
 wget
+zlib1g-dev
Re: [XEN PATCH v1 3/6] CI: Refresh the Debian 12 arm64 container
Posted by Javi Merino 2 weeks, 5 days ago
On Thu, Oct 24, 2024 at 04:03:56PM -0700, Stefano Stabellini wrote:
> On Thu, 24 Oct 2024, Javi Merino wrote:
> > Rework the container to use heredocs for readability and use apt-get
> > --no-install-recommends to keep the size down.  Rename the job to
> > debian-12-arm64-* to follow the naming scheme of all the other CI jobs.
> > 
> > This reduces the size of the debian:12-arm64v8 from 2.25GB down to 1.62GB.
> 
> Hi Javi, I am a bit confused by the new list of packages. I diff'ed the
> old list with the new list, and I appended the difference below. Maybe I
> ask how did you manage to make the new list?

I started from scratch.  I dropped everything and only added the
packages that were needed.

> As an example, are bcc and
> bin86 necessary?

They are not, that's why I dropped them.  The list you generated shows
as "+" the things that were in the old container and "-" are the ones
in the new container that were not in the old container.

If this helps, for the next series I will add a diff of the packages
added and removed.

Cheers,
Javi

>  acpica-tools
> +bcc
> +bin86
>  bison
>  build-essential
>  busybox-static
> -ca-certificates
>  checkpolicy
> +clang
>  cpio
>  curl
>  device-tree-compiler
>  expect
> -file
>  flex
> -git-core
> -golang-go
> -libbz2-dev
> -libext2fs-dev
> +git
> +libaio-dev
>  libfdt-dev
> +libfindlib-ocaml-dev
>  libglib2.0-dev
>  liblzma-dev
> -liblzo2-dev
> +libncurses5-dev
> +libnl-3-dev
>  libpixman-1-dev
>  libyajl-dev
> -libzstd-dev
> -ocaml-findlib
> +markdown
> +nasm
>  ocaml-nox
> +pandoc
>  pkg-config
>  python3-dev
>  python3-setuptools
> +transfig
>  u-boot-qemu
>  u-boot-tools
>  uuid-dev
>  wget
> +zlib1g-dev