On 11/07/2024 3:41 pm, Anthony PERARD wrote:
> On Thu, Jul 11, 2024 at 12:15:12PM +0100, Andrew Cooper wrote:
>> diff --git a/automation/build/debian/12-ppc64le.dockerfile b/automation/build/debian/12-ppc64le.dockerfile
>> new file mode 100644
>> index 000000000000..3b311e675ef5
>> --- /dev/null
>> +++ b/automation/build/debian/12-ppc64le.dockerfile
>> @@ -0,0 +1,36 @@
> ...
>> +ENV CROSS_COMPILE=powerpc64le-linux-gnu-
>> +ENV XEN_TARGET_ARCH=ppc64
> I don't really like these two envvars. The second one is already set in
> the env by gitlab, the first one could in theory also come from
> gitlab-ci.
The first one is pre-existing. (It shows as new because enough of the
file changed for it not to be deemed a rename).
The second is something I added, for improved usability.
> But I guess that comment comes from the fact that I don't really know
> why we would want a second bookworm containers with only a few packages.
Right now (for better or worse) - we have single purpose containers for
a single arch.
For PPC and RISCV, where we're only doing a cross-build of the
hypervisor, the dependencies are almost identical. But the moment we
start doing userspace, it will diverge quickly.
Part of the work I'm doing is trimming the containers down. Container
size is a relevant factor for how long the CI tests take. Also, with
smaller containers, the "oops, out of disk space, delete everything"
logic on various runners will trigger less frequently, so we get better
cache utilisation.
We do not IMO want to have containers with a union of all deps of all
architectures. They'd be giant.
So while we do have single-purpose containers, these ENV vars are
~mandatory for using the container for it's intended purpose, and it's
far more usable for a human when you can just enter the container and
type `make`.
>> +
>> +RUN <<EOF
>> +#!/bin/bash
>> + set -e
>> +
>> + useradd --create-home user
>> +
>> + apt-get -y update
>> +
>> + DEPS=(
>> + # Xen
>> + bison
>> + build-essential
>> + checkpolicy
>> + flex
>> + gcc-powerpc64le-linux-gnu
>> + python3-minimal
>> +
>> + # Qemu for test phase
>> + qemu-system-ppc
>> + )
>> +
>> + apt-get -y --no-install-recommends install "${DEPS[@]}"
>> + rm -rf /var/lib/apt/lists/*
> Other containers do also `apt-get clean` is this not needed? Or maybe
> the original containers is setup to not save packages?
>
> /me looking into /var/cache
>
> Looks empty enough, so I guess `apt-get clean` is optional.
https://docs.docker.com/build/building/best-practices/ notes that the
official Debian and Ubuntu images automatically clean themselves, so you
don't need to do it manually.
https://github.com/moby/moby/blob/03e2923e42446dbb830c654d0eec323a0b4ef02a/contrib/mkimage/debootstrap#L82-L105
> Changes looks good enough, so:
> Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
Thanks.
~Andrew