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

RE: [PATCH v3 05/10] automation: Add Arm containers to containerize script


  • To: Michal Orzel <michal.orzel@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jiamei Xie <Jiamei.Xie@xxxxxxx>
  • Date: Thu, 20 Oct 2022 08:03:31 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • 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=2; 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=pSxYXp92YlagzFFnQkaaPPPaDO8PHE5v8f/k8Fq6jTc=; b=HV+wVMpNQqVueWClX8cxTA1YjNb44xCHlsPUPEm16UjzTNfHtjkcZwAvJHXGoaP1yQnahw3vMrUtke/OUvKv0sC1XWO/Kb+JEq/keuTaAPwJBq6s1W6MbCUBXydX3sQIAc4t6J9JqLpJar6hUyPszDetoofK7UErGUOC8I2v9WNICyFfpewxVFy1EG5Bhm5/UfMzTXGeoW9Y1T/G9O0BPPWknS7va7aut4wlc+dkVLXnOTHDvL3ACF7a8/bfpgUiKz2TZWc0foCsZpmtzxYLtpTVs4SzhwrUO9/rDMiHvoOp5Zu/yRVyQYDoNig6QMjYaE82agoS3NlDQMsiEj7pZA==
  • 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=pSxYXp92YlagzFFnQkaaPPPaDO8PHE5v8f/k8Fq6jTc=; b=B0cfMMgmZybpYh3K5kHvD+5zdNhDmJMwksA9yeQQo46AjBiXb2DtZbvUWeoynjf5jd28WFL3+D26d/+Z/uOkmTC0p6ycqS2+clizbnvjZBNfdm7DuenlN87N3RTE5vTejuChsj5YHJoS38b73efTpWugIFVFjqVsfZwINx0AmVGXLZjwO2EEzhucbjk5DKLS1bPamF7tmuXN2TKRA0Y+b9yLBl2ACmxHxyZXuPOyjBv73bmqLlimyqi3xsnrctNm1VkE6dXhrqEMTkmd/B4+CuJzA9u//3U57NbeJhCgdGXAJLALylxZdvNmIKqouXVubunQhl52X9HFPcm+nwtPHg==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=gfPIVoupecmNMA61ZyMDScmO5aqCRuoXKaAjUneccnnR5klN//hmKc7Ie0y9X/zlAwBz6T768Yc+sTZNYQ7+PwhliYjrCqPYL9STunwDAGoDWFXJZfhBHJ+c6AkVH1bcLyGZFGeLUfU3uWdo8V1WalSSCdv58pE+X6fSdHvsGzoVz6kBBo/XTjW1hHZHiu1pHXeQ4ZR8n4iP7u/ymH3iPWJeJtFC5OmhTt5mPSpkw2ZjZm8o4fH8YfsombtK2pRR0sZx4+/fZ7bH9vhFIB+/MoYawhY3ajRo4n6TZ2DJzZfQqum0M4L+SwJzBEshc9Jwj+FyLuy+yvATx+KUN+rYQQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Nl3BzI28FOiN88PrDWAPGzhLP5qQ0NrfDgvQO1kbeE1OyHhIGWROkxnddOJfQGZGIYFcjy50IsCrILPZyWEu+JreH24FbHlb0eJ8WLWsx9KvHuP/Bmqy/LdSJH7Clu09LLEbhDJFnE26Fj6j4OaPcmfNUSGCPygawcXQ4cNsgk0WfSWO9aX+d2AcFDWvqgdSkiyRTyWuZvJQ4UEnr/YoGrvMeHzMXm42uZ/KyqYpN7PlJKEXmzM07T6n8V1xG36uEeGSzcSzE24AkzV3d0RD7rn5dX1lgY7yEH508BzGrtaJoHDv8IYtDGvAYw/+/tLmSSGy4q0wpbr/v0+kEJ5vVg==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Doug Goldstein <cardoe@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • Delivery-date: Thu, 20 Oct 2022 08:03:51 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHY0lZFu/mKHMVlEk6rDAaZCITsX64Ws3HQgABK2QCAAAFz0IAADTKAgAABtvA=
  • Thread-topic: [PATCH v3 05/10] automation: Add Arm containers to containerize script

Hi Michal,

> -----Original Message-----
> From: Michal Orzel <michal.orzel@xxxxxxx>
> Sent: Thursday, October 20, 2022 3:52 PM
> To: Jiamei Xie <Jiamei.Xie@xxxxxxx>; xen-devel@xxxxxxxxxxxxxxxxxxxx
> Cc: Doug Goldstein <cardoe@xxxxxxxxxx>; Stefano Stabellini
> <sstabellini@xxxxxxxxxx>
> Subject: Re: [PATCH v3 05/10] automation: Add Arm containers to
> containerize script
> 
> Hi Jiamei,
> 
> On 20/10/2022 09:13, Jiamei Xie wrote:
> >
> >
> > Hi Michal,
> >
> >> -----Original Message-----
> >> From: Michal Orzel <michal.orzel@xxxxxxx>
> >> Sent: Thursday, October 20, 2022 2:59 PM
> >> To: Jiamei Xie <Jiamei.Xie@xxxxxxx>; xen-devel@xxxxxxxxxxxxxxxxxxxx
> >> Cc: Doug Goldstein <cardoe@xxxxxxxxxx>; Stefano Stabellini
> >> <sstabellini@xxxxxxxxxx>
> >> Subject: Re: [PATCH v3 05/10] automation: Add Arm containers to
> >> containerize script
> >>
> >> Hi Jiamei,
> >>
> >> On 20/10/2022 05:00, Jiamei Xie wrote:
> >>>
> >>>
> >>> Hi Michal,
> >>>
> >>>> -----Original Message-----
> >>>> From: Xen-devel <xen-devel-bounces@xxxxxxxxxxxxxxxxxxxx> On Behalf
> Of
> >>>> Michal Orzel
> >>>> Sent: Tuesday, September 27, 2022 5:47 PM
> >>>> To: xen-devel@xxxxxxxxxxxxxxxxxxxx
> >>>> Cc: Michal Orzel <michal.orzel@xxxxxxx>; Doug Goldstein
> >>>> <cardoe@xxxxxxxxxx>; Stefano Stabellini <sstabellini@xxxxxxxxxx>
> >>>> Subject: [PATCH v3 05/10] automation: Add Arm containers to
> >> containerize
> >>>> script
> >>>>
> >>>> Script automation/scripts/containerize makes it easy to build Xen
> within
> >>>> predefined containers from gitlab container registry. This script is
> >>>> currently missing the helpers to select Arm containers, so populate the
> >>>> necessary entries.
> >>>>
> >>>> Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>
> >>>> Acked-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
> >>>> ---
> >>
> >>>
> >>> [Jiamei Xie]
> >>> I wonder if an default container for arm can be added. For example,  if
> >>>  "CONTAINER=arm64 automation/scripts/containerize bash",
> >>>  set the default CONTAINER as "registry.gitlab.com/xen-
> >> project/xen/alpine:3.12-arm64v8"
> >>>
> >>
> >> It can be added doing the following:
> >>
> >> diff --git a/automation/scripts/containerize
> >> b/automation/scripts/containerize
> >> index 0f4645c4cccb..b395bd359ecf 100755
> >> --- a/automation/scripts/containerize
> >> +++ b/automation/scripts/containerize
> >> @@ -25,7 +25,7 @@ die() {
> >>  BASE="registry.gitlab.com/xen-project/xen"
> >>  case "_${CONTAINER}" in
> >>      _alpine) CONTAINER="${BASE}/alpine:3.12" ;;
> >> -    _alpine-arm64v8) CONTAINER="${BASE}/alpine:3.12-arm64v8" ;;
> >> +    _alpine-arm64v8|_arm64) CONTAINER="${BASE}/alpine:3.12-
> arm64v8" ;;
> >>      _archlinux|_arch) CONTAINER="${BASE}/archlinux:current" ;;
> >>      _riscv64) CONTAINER="${BASE}/archlinux:riscv64" ;;
> >>      _centos7) CONTAINER="${BASE}/centos:7" ;;
> >>
> >> The question is whether it would be beneficial. After all you would still
> need
> >> to
> >> type CONTAINER=arm64, whereas at the moment, you need to type
> >> CONTAINER=alpine-arm64v8.
> >> TBH I'm not sure it is improving anything (?).
> >>
> >> ~Michal
> > [Jiamei Xie]
> > I am not sure about this either.  I added something like below f to run it 
> > on
> arm64 machine.   But it  didn't take "running container for a different
> architecture" into consideration.
> >
> So your question is not about adding default container when selecting
> CONTAINER=arm64, but adding
> a default one when running on arm64 platform. Right now, the default one
> is debian:stretch
> (if you don't type CONTAINER= at all). Do I understand it right that you
> would like the same
> behavior when running on arm64 platform (currently, it would also select
> debian:stretch)?
> So that when executing:
> ./automation/scripts/containerize ...
> it would automatically select alpine-arm64v8?
> 
Yes, this is what I mean.
> 
> > --- a/automation/scripts/containerize
> > +++ b/automation/scripts/containerize
> > @@ -18,6 +18,12 @@ die() {
> >      exit 1
> >  }
> >
> > +# There are two containers that can run on aarch64, unstable and alpine.
> > +# Set the default container to alpine for aarch64
> > +if [[ $(uname -m) = "aarch64" && -z ${CONTAINER} ]]; then
> The output from `uname -m` for arm64 can be aarch64 and arm64.
> 
> > +    CONTAINER="alpine"
> > +fi
> > +
> >  #
> >  # The caller is expected to override the CONTAINER environment
> >  # variable with the container they wish to launch.
> > @@ -41,6 +47,11 @@ case "_${CONTAINER}" in
> >      _opensuse-tumbleweed|_tumbleweed)
> CONTAINER="${BASE}/suse:opensuse-tumbleweed" ;;
> >  esac
> >
> > +# Containers for aarch64 have a sufix "-arm64v8"
> > +if [[ $(uname -m) = "aarch64" ]]; then
> > +    CONTAINER="${CONTAINER}-arm64v8"
> > +fi
> This is not needed. CONTAINER can be selected on the first check and let
> case/esac block
> to determine the full path to container.
> 
> > +
> >  # Use this variable to control whether root should be used
> >  case "_${CONTAINER_UID0}" in
> >      _1)   userarg= ;;
> >
> >
> > Best wishes
> > Jiamei Xie
> >
> >
> 
> What you are asking for can be done in a simpler way. The following is
> enough:
> 
> diff --git a/automation/scripts/containerize
> b/automation/scripts/containerize
> index 0f4645c4cccb..4e7e8bb48e3a 100755
> --- a/automation/scripts/containerize
> +++ b/automation/scripts/containerize
> @@ -18,6 +18,11 @@ die() {
>      exit 1
>  }
> 
> +# Select default container when running on arm64 machine.
> +if [ -z "${CONTAINER}" ] && uname -m | grep -qE 'aarch64|arm64'; then
> +    CONTAINER="alpine-arm64v8"
> +fi
> +
>  #
>  # The caller is expected to override the CONTAINER environment
>  # variable with the container they wish to launch.
> 
> ~Michal
Yeah, I agree with this  implementation. 

Best wishes
Jiamei Xie



 


Rackspace

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