diff mbox series

[10/12] CI: Introduce debian:11/12-riscv64 containers

Message ID 20240711111517.3064810-11-andrew.cooper3@citrix.com (mailing list archive)
State New
Headers show
Series CI: part 3 (slimline, and PPC/RISCV fixes) | expand

Commit Message

Andrew Cooper July 11, 2024, 11:15 a.m. UTC
For starters, they're slightly smaller:

  $ docker image list <snip>
  registry.gitlab.com/xen-project/xen/debian      12-riscv64         772MB
  registry.gitlab.com/xen-project/xen/debian      11-riscv64         422MB
  registry.gitlab.com/xen-project/xen/archlinux   current-riscv64    2.32GB

They also not rolling distros, so will be more predicatable testing for the
stable trees in the future.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Anthony PERARD <anthony.perard@vates.tech>
CC: Juergen Gross <jgross@suse.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Jan Beulich <JBeulich@suse.com>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Julien Grall <julien@xen.org>
CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>
CC: Shawn Anastasio <sanastasio@raptorengineering.com>
---
 automation/build/debian/11-riscv64.dockerfile | 33 +++++++++++++++++
 automation/build/debian/12-riscv64.dockerfile | 36 +++++++++++++++++++
 2 files changed, 69 insertions(+)
 create mode 100644 automation/build/debian/11-riscv64.dockerfile
 create mode 100644 automation/build/debian/12-riscv64.dockerfile

Comments

Anthony PERARD July 11, 2024, 4:34 p.m. UTC | #1
On Thu, Jul 11, 2024 at 12:15:15PM +0100, Andrew Cooper wrote:
> For starters, they're slightly smaller:
> 
>   $ docker image list <snip>
>   registry.gitlab.com/xen-project/xen/debian      12-riscv64         772MB
>   registry.gitlab.com/xen-project/xen/debian      11-riscv64         422MB
>   registry.gitlab.com/xen-project/xen/archlinux   current-riscv64    2.32GB
> 
> They also not rolling distros, so will be more predicatable testing for the
> stable trees in the future.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>

Thanks,
Oleksii Kurochko July 12, 2024, 11:39 a.m. UTC | #2
On Thu, 2024-07-11 at 12:15 +0100, Andrew Cooper wrote:
> For starters, they're slightly smaller:
> 
>   $ docker image list <snip>
>   registry.gitlab.com/xen-project/xen/debian      12-riscv64        
> 772MB
>   registry.gitlab.com/xen-project/xen/debian      11-riscv64        
> 422MB
Do we really need both 11-riscv64 and 12-riscv64?

Generally this patch LGTM: Reviewed-by: Oleksii Kurochko
<oleksii.kurochko@gmail.com>

~ Oleksii
 

>   registry.gitlab.com/xen-project/xen/archlinux   current-riscv64   
> 2.32GB
> 
> They also not rolling distros, so will be more predicatable testing
> for the
> stable trees in the future.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> CC: Anthony PERARD <anthony.perard@vates.tech>
> CC: Juergen Gross <jgross@suse.com>
> CC: Roger Pau Monné <roger.pau@citrix.com>
> CC: Jan Beulich <JBeulich@suse.com>
> CC: Stefano Stabellini <sstabellini@kernel.org>
> CC: Julien Grall <julien@xen.org>
> CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> CC: Shawn Anastasio <sanastasio@raptorengineering.com>
> ---
>  automation/build/debian/11-riscv64.dockerfile | 33 +++++++++++++++++
>  automation/build/debian/12-riscv64.dockerfile | 36
> +++++++++++++++++++
>  2 files changed, 69 insertions(+)
>  create mode 100644 automation/build/debian/11-riscv64.dockerfile
>  create mode 100644 automation/build/debian/12-riscv64.dockerfile
> 
> diff --git a/automation/build/debian/11-riscv64.dockerfile
> b/automation/build/debian/11-riscv64.dockerfile
> new file mode 100644
> index 000000000000..1c99bc89ea1a
> --- /dev/null
> +++ b/automation/build/debian/11-riscv64.dockerfile
> @@ -0,0 +1,33 @@
> +# syntax=docker/dockerfile:1
> +FROM --platform=linux/amd64 debian:bullseye-slim
> +LABEL maintainer.name="The Xen Project"
> +LABEL maintainer.email="xen-devel@lists.xenproject.org"
> +
> +ENV DEBIAN_FRONTEND=noninteractive
> +ENV CROSS_COMPILE=riscv64-linux-gnu-
> +ENV XEN_TARGET_ARCH=riscv64
> +
> +RUN <<EOF
> +#!/bin/bash
> +    set -e
> +
> +    useradd --create-home user
> +
> +    apt-get -y update
> +
> +    DEPS=(
> +        # Xen
> +        bison
> +        build-essential
> +        checkpolicy
> +        flex
> +        gcc-riscv64-linux-gnu
> +        python3-minimal
> +    )
> +
> +    apt-get -y --no-install-recommends install "${DEPS[@]}"
> +    rm -rf /var/lib/apt/lists/*
> +EOF
> +
> +USER user
> +WORKDIR /build
> diff --git a/automation/build/debian/12-riscv64.dockerfile
> b/automation/build/debian/12-riscv64.dockerfile
> new file mode 100644
> index 000000000000..03fd4b03059b
> --- /dev/null
> +++ b/automation/build/debian/12-riscv64.dockerfile
> @@ -0,0 +1,36 @@
> +# syntax=docker/dockerfile:1
> +FROM --platform=linux/amd64 debian:bookworm-slim
> +LABEL maintainer.name="The Xen Project"
> +LABEL maintainer.email="xen-devel@lists.xenproject.org"
> +
> +ENV DEBIAN_FRONTEND=noninteractive
> +ENV CROSS_COMPILE=riscv64-linux-gnu-
> +ENV XEN_TARGET_ARCH=riscv64
> +
> +RUN <<EOF
> +#!/bin/bash
> +    set -e
> +
> +    useradd --create-home user
> +
> +    apt-get -y update
> +
> +    DEPS=(
> +        # Xen
> +        bison
> +        build-essential
> +        checkpolicy
> +        flex
> +        gcc-riscv64-linux-gnu
> +        python3-minimal
> +
> +        # Qemu for test phase
> +        qemu-system-riscv64
> +    )
> +
> +    apt-get -y --no-install-recommends install "${DEPS[@]}"
> +    rm -rf /var/lib/apt/lists/*
> +EOF
> +
> +USER user
> +WORKDIR /build
Andrew Cooper July 12, 2024, 12:30 p.m. UTC | #3
On 12/07/2024 12:39 pm, Oleksii wrote:
> On Thu, 2024-07-11 at 12:15 +0100, Andrew Cooper wrote:
>> For starters, they're slightly smaller:
>>
>>   $ docker image list <snip>
>>   registry.gitlab.com/xen-project/xen/debian      12-riscv64        
>> 772MB
>>   registry.gitlab.com/xen-project/xen/debian      11-riscv64        
>> 422MB
> Do we really need both 11-riscv64 and 12-riscv64?

Need? No, not strictly.

Want? Yes, absolutely.

You always want at least 2 different toolchains worth of testing, or
what you will find happens is that you end up accidentally depending on
a quirk of the single compiler your using, and that you discover this at
some point in the future, rather than now(ish) when CI says no.

At the moment, the RISC-V builds are very trivial and quick, so it makes
a lot of sense to have a second toolchain.  Before too much longer,
you'll want to get Clang working too.

> Generally this patch LGTM: Reviewed-by: Oleksii Kurochko
> <oleksii.kurochko@gmail.com>

Thanks.

~Andrew
Oleksii Kurochko July 15, 2024, 1:29 p.m. UTC | #4
On Fri, 2024-07-12 at 13:30 +0100, Andrew Cooper wrote:
> On 12/07/2024 12:39 pm, Oleksii wrote:
> > On Thu, 2024-07-11 at 12:15 +0100, Andrew Cooper wrote:
> > > For starters, they're slightly smaller:
> > > 
> > >   $ docker image list <snip>
> > >   registry.gitlab.com/xen-project/xen/debian      12-
> > > riscv64        
> > > 772MB
> > >   registry.gitlab.com/xen-project/xen/debian      11-
> > > riscv64        
> > > 422MB
> > Do we really need both 11-riscv64 and 12-riscv64?
> 
> Need? No, not strictly.
> 
> Want? Yes, absolutely.
> 
> You always want at least 2 different toolchains worth of testing, or
> what you will find happens is that you end up accidentally depending
> on
> a quirk of the single compiler your using, and that you discover this
> at
> some point in the future, rather than now(ish) when CI says no.
> 
> At the moment, the RISC-V builds are very trivial and quick, so it
> makes
> a lot of sense to have a second toolchain.  Before too much longer,
> you'll want to get Clang working too.
Agree, I should consider to add Clang. I will do that in the one of my
nearest patch series.

~ Oleksii
diff mbox series

Patch

diff --git a/automation/build/debian/11-riscv64.dockerfile b/automation/build/debian/11-riscv64.dockerfile
new file mode 100644
index 000000000000..1c99bc89ea1a
--- /dev/null
+++ b/automation/build/debian/11-riscv64.dockerfile
@@ -0,0 +1,33 @@ 
+# syntax=docker/dockerfile:1
+FROM --platform=linux/amd64 debian:bullseye-slim
+LABEL maintainer.name="The Xen Project"
+LABEL maintainer.email="xen-devel@lists.xenproject.org"
+
+ENV DEBIAN_FRONTEND=noninteractive
+ENV CROSS_COMPILE=riscv64-linux-gnu-
+ENV XEN_TARGET_ARCH=riscv64
+
+RUN <<EOF
+#!/bin/bash
+    set -e
+
+    useradd --create-home user
+
+    apt-get -y update
+
+    DEPS=(
+        # Xen
+        bison
+        build-essential
+        checkpolicy
+        flex
+        gcc-riscv64-linux-gnu
+        python3-minimal
+    )
+
+    apt-get -y --no-install-recommends install "${DEPS[@]}"
+    rm -rf /var/lib/apt/lists/*
+EOF
+
+USER user
+WORKDIR /build
diff --git a/automation/build/debian/12-riscv64.dockerfile b/automation/build/debian/12-riscv64.dockerfile
new file mode 100644
index 000000000000..03fd4b03059b
--- /dev/null
+++ b/automation/build/debian/12-riscv64.dockerfile
@@ -0,0 +1,36 @@ 
+# syntax=docker/dockerfile:1
+FROM --platform=linux/amd64 debian:bookworm-slim
+LABEL maintainer.name="The Xen Project"
+LABEL maintainer.email="xen-devel@lists.xenproject.org"
+
+ENV DEBIAN_FRONTEND=noninteractive
+ENV CROSS_COMPILE=riscv64-linux-gnu-
+ENV XEN_TARGET_ARCH=riscv64
+
+RUN <<EOF
+#!/bin/bash
+    set -e
+
+    useradd --create-home user
+
+    apt-get -y update
+
+    DEPS=(
+        # Xen
+        bison
+        build-essential
+        checkpolicy
+        flex
+        gcc-riscv64-linux-gnu
+        python3-minimal
+
+        # Qemu for test phase
+        qemu-system-riscv64
+    )
+
+    apt-get -y --no-install-recommends install "${DEPS[@]}"
+    rm -rf /var/lib/apt/lists/*
+EOF
+
+USER user
+WORKDIR /build