[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v5 1/3] automation: Create Yocto docker images


  • To: Michal Orzel <michal.orzel@xxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Wed, 30 Nov 2022 14:56:52 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=PguNgRSJ73OSGU8nhMLC8EDFZ7GLXldEzRQtaMlxTRM=; b=U/tmSY/iDGUa8ToAa6SqxxmPo4ldHuqKbG3e/6BRe/z6hIPlv4AXc6gRs1KNKsZPsa1Zuz1gAI/JMcW2gtBJLocPYIxElQ0U1Ai5iSyw49PCXVvOZ8xfinT88PL0z2+vRGJnmMIheIOLzH5nndfByef9iknUumgKa0bNL/yAdEeSx/JSDCyDk+fOAJtPqIGlG1actwAU9we9z3fnIAj1EH9MdzZoYFje8jyVgFZaJLw81ptQUgfetqdi6M0p4nSWtoAoG4Stlld89GJwEUnh+juWwADOvWwE0UAX+SZ4CTecoocqjnR8O/Bw3XpHaqkBp2eQXlXYwVXn8GxSA74/VQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=icGpsjTqIKB+KrJmOw1U417Hnh/gVwPSUG84sxeM6b7NCByt57IuTXICnJ1pH8JiD9q2/NlqSbvCGBsbORBoRxnHr/MfITFCtnnh21CdEkponPzM+tIATruRFXuKXdvGlSYj6ixZpM14r8u/jzyIKQM5ALocxMxeIJFu8gqtm0Txi+YpZHRU67nk4mw2liSU7X4PNXs8F3JNQubllDpGMWmpIkEnrmq6uTJBtq54XOSKk8npKsJW1Ti4PO/gAFkTq8PzlftIx1JufjHKp1UNPYsgsl2E9ZRgTbyQF4nUhjBarU0KVqRMoCjjdrbvYamvOay3pbBpqd40p05C1okxUA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Doug Goldstein <cardoe@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • Delivery-date: Wed, 30 Nov 2022 14:57:14 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Thread-index: AQHZBLWFmb3GO0y8oEy6bIpMhPppa65XdbOAgAAY1oA=
  • Thread-topic: [PATCH v5 1/3] automation: Create Yocto docker images

Hi Michal,

> On 30 Nov 2022, at 13:27, Michal Orzel <michal.orzel@xxxxxxx> wrote:
> 
> Hi Bertrand,
> 
> I will try to build and run the yocto containers for a test.
> In the meantime I just spotted one thing.

I will wait until tomorrow for a v6 in case you find issues.

> 
> On 30/11/2022 13:15, Bertrand Marquis wrote:
>> 
>> 
>> Add containers suitable to run yocto kirkstone build based on ubuntu
>> 22.04. It contains all packages required by Yocto and a checkout of the
>> layers required to build Xen with Yocto.
>> 
>> Add a generic docker image template to be used to automatically generate
>> docker files for different configurations:
>> - specific yocto version
>> - different targets (qemu arm, arm64 and x86)
>> - different host platforms (x86 or arm64)
>> 
>> During a call to 'make all', only the images for the host platform we
>> run it on in the CI is generated.
>> If needed, images for an other host platform can be generated manually
>> by calling the right make target (see make help).
>> 
>> Add a build script to build and run xen on qemu using Yocto.
>> The script supports arm32, arm64 and x86_64 and checks that dom0 is
>> properly booting. At this stage this does not run any guest on top of
>> dom0. The script is to be executed in one of the docker images to build
>> and run a system using a Xen source tree.
>> 
>> Signed-off-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>
>> ---
>> Changes in v5:
>> - typo fixes
>> - add INTERMEDIATE to remove intermediate dockerfile
>> - use container architecture
>> - use full words in foreach loops
>> - fix shellcheck findings in build-yocto.sh
>> - rebase on sstabellini next branch
>> Changes in v4:
>> - Rework the system to have one dockerfile template from which make will
>> generate the required dockerfiles for the wanted configuration
>> - add support for different host architectures
>> - Merge the generation system into one single dockerfile
>> - Merge patches 1 and 2 in a single patch
>> - Introduce CONTAINERS_EXTRA to have extra containers not built by
>> default (for those not used by CI but useful to users)
>> Changes in v3:
>> - limit number of jobs in yocto by default to 8 and add --num-jobs
>> option to the script to set a custom number of jobs
>> - do not copy anymore the build-yocto.sh script inside the main image so
>> that the current one in the repository is used when running
>> Changes in v2:
>> - add a --dump-log command line option to build-yocto.sh script to dump
>> the logs if an error occurs.
>> Changes in v1:
>> - add --image command line argument to build-yocto.sh to allow building
>> something different than xen-image-minimal.
>> - modify dockerfile to have one layer per line and make it easier to add
>> other. I kept the for loop to keep the number of docker steps lower
>> - update commit message to warn that no guest are tested.
>> - fix build-yocto script to properly return with an error if expect
>> script ends up in timeout or EOF.
>> ---
>> automation/build/Makefile                  |  14 +-
>> automation/build/yocto/build-yocto.sh      | 351 +++++++++++++++++++++
>> automation/build/yocto/yocto.dockerfile.in | 114 +++++++
>> automation/build/yocto/yocto.inc           |  42 +++
>> 4 files changed, 519 insertions(+), 2 deletions(-)
>> create mode 100755 automation/build/yocto/build-yocto.sh
>> create mode 100644 automation/build/yocto/yocto.dockerfile.in
>> create mode 100644 automation/build/yocto/yocto.inc
>> 
>> diff --git a/automation/build/Makefile b/automation/build/Makefile
>> index a4b2b85178cf..72a5335baec1 100644
>> --- a/automation/build/Makefile
>> +++ b/automation/build/Makefile
>> @@ -1,13 +1,18 @@
>> 
>> # the base of where these containers will appear
>> REGISTRY := registry.gitlab.com/xen-project/xen
>> -CONTAINERS = $(subst .dockerfile,,$(wildcard */*.dockerfile))
>> +CONTAINERS = $(filter-out yocto/%,$(subst .dockerfile,,$(wildcard 
>> */*.dockerfile)))
>> +CONTAINERS_EXTRA =
>> DOCKER_CMD ?= docker
>> 
>> +include yocto/yocto.inc
> Because this appears before help, when calling make without any target like:
> make -C automation/build
> the previous behavior of printing help by default is no longer true (the 
> default target is
> taken from yocto.inc in this case). Instead we're getting:
> 
> make: Entering directory...
> rm yocto/kirkstone-qemuarm64.dockerfile
> make: Leaving directory...
> 
> This include can be easily moved after help to stick to the current behavior 
> and still
> achieve what we want (i.e. make will still first evaluate include and then 
> call the first
> target which is help, so CONTAINERS and CONTAINERS_EXTRA will contain correct 
> data).

Complete right.
I will fix that in v6.

Cheers
Bertrand

> 
>> +
>> help:
>>        @echo "Builds containers for building Xen based on different distros"
>>        @echo "To build one run 'make DISTRO/VERSION'. Available containers:"
>>        @$(foreach file,$(sort $(CONTAINERS)),echo ${file};)
>> +       @echo "Extra containers (not built using make all):"
>> +       @$(foreach file,$(sort $(CONTAINERS_EXTRA)),echo ${file};)
>>        @echo "To push container builds, set the env var PUSH"
>> 
>> %: %.dockerfile ## Builds containers
>> @@ -16,5 +21,10 @@ help:
>>                $(DOCKER_CMD) push $(REGISTRY)/$(@D):$(@F); \
>>        fi
>> 
>> -.PHONY: all
>> +.PHONY: all clean
>> all: $(CONTAINERS)
>> +
>> +# Remove generated dockerfiles for yocto
>> +clean:
>> +       rm -f yocto/*.dockerfiles
>> +
> 
> ~Michal




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.