From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6989998000320806912 X-Received: by 2002:aa7:c952:: with SMTP id h18mr6041132edt.18.1627563938661; Thu, 29 Jul 2021 06:05:38 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:aa7:df0b:: with SMTP id c11ls1629542edy.0.gmail; Thu, 29 Jul 2021 06:05:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwfmLDkn6YHa842aPHMEkEBbtIdLmo9ahTrVwEENXAHzrggp5oPdYP8VfGNWh9wS/uEs3HK X-Received: by 2002:a50:f113:: with SMTP id w19mr5682873edl.107.1627563937753; Thu, 29 Jul 2021 06:05:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627563937; cv=none; d=google.com; s=arc-20160816; b=ThnB6uSrQ6gJxXyL2IqwBOxkPgWVpCXIaG8vYAGzQnvKTyW2mkFKuzPazQtwydgOzt tFMhAI03ImWP0SLqEkcqbz3aizXCPWBlZinVsNtVPd3yeMUo/T+RVptzZ+2wm+DTeJdh HZBvajMTgt7ZVkqOECPU6oUDxxGP51Cv6XBTZ/2B5x+Lhi3mCTnTMGkz4sq3n7dO5CMI qwJugYU9XkHHHdgNHDjYykPl9oHYwGMnFhOhMuzaFYFlu0PEkNeZery5Zb9AcJBm5T50 68yBD1hvKDsjB3yljC2GoHsNucn6LRz8+vRWTY//fLihvk49GduMLcrq+LgzkZZbTXbq 7DRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date; bh=Uv3KLn1zmaLWfOLJFBW3zZm0Bo3v9yC8Tidyjri0wSQ=; b=qHosJpi5xS2fS9tr09+O3xwh/F9otOUnREmhvO/m2CRpwlxH2vyZj7u6fbBJJGLOoU g0+ah6CpgCqfSkUABdTbNddv+J04ANlf/3GFf4yvMZ15w9sZbpdPB244uZGH+gU/qhW8 BJ1wfvCV6/XqNV7eQCgawttVw4adQEeG0z6hWwp7R5M+mHpWxp1hnECSCqpFHcGMkPrY gpclLT7bZVNPGsY8lJQJxJl8G7EHu/FcmGQ1eyz1XJ/7Ie/4H7MC2IdGc24ARzPERHHX yAqc6YGODAbtHc9ETf+8NUOjjNqCWLIs8Ef/sIKVkF7dRa8XMAbUIQtZrZlh99MFDUPC O6Vg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=henning.schild@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from goliath.siemens.de (goliath.siemens.de. [192.35.17.28]) by gmr-mx.google.com with ESMTPS id w14si174414edu.1.2021.07.29.06.05.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Jul 2021 06:05:37 -0700 (PDT) Received-SPF: pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.28 as permitted sender) client-ip=192.35.17.28; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=henning.schild@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by goliath.siemens.de (8.15.2/8.15.2) with ESMTPS id 16TD5bmm002829 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 29 Jul 2021 15:05:37 +0200 Received: from md1za8fc.ad001.siemens.net ([139.25.68.194]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id 16TD5b3A005467; Thu, 29 Jul 2021 15:05:37 +0200 Date: Thu, 29 Jul 2021 15:05:35 +0200 From: Henning Schild To: Silvano Cirujano Cuesta Cc: Subject: Re: [PATCH 3/4] classes: allow more control over container image name and tag Message-ID: <20210729150535.2b194218@md1za8fc.ad001.siemens.net> In-Reply-To: <8ce8e348-890e-08f3-b087-c3a604e4b931@siemens.com> References: <20210728152210.7089-1-henning.schild@siemens.com> <20210728152210.7089-4-henning.schild@siemens.com> <8ce8e348-890e-08f3-b087-c3a604e4b931@siemens.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TUID: rSG9NRIjg8yx Am Thu, 29 Jul 2021 14:50:12 +0200 schrieb Silvano Cirujano Cuesta : > On 28/07/2021 17:22, Henning Schild wrote: > > This patch allows more fine-grained control over how the resulting > > container will be tagged. Where the default name will be PN together > > with DISTRO and ARCH, and tag will be derived from PV and PR > > This is a completely meaningful change. My implementation didn't > foresee the need for free selection of container name and tag. > > The default container name and tag that is patch is providing is also > meaningful, but it's breaking the interface (resulting container > image has a fixed, predefined name). I don't have the impression that > there are many users of this feature. Therefore we might afford it. > But I don't follow ISAR development close enough to be able to assess > what's the impact of this change on the user community. > > The alternative is breaking this transition in two steps: > 1. Make the container image name and tag configurable, but keep the > default backwards compatible (even if yours is more meaningful). And > announce the upcoming breaking change. 2. Change the default > effectively breaking the interface. I was expecting you to know users that might need to be warned about the default name:tag change. But seems you are OK with it. Let us see if anyone else speaks up, in which case we could see about adding a way to stick to the old default. Any way i will add an entry to the API-CHANGELOG to point out the break. Maybe in v2 or just on top in case this v1 goes through as is. Henning > > > > Signed-off-by: Henning Schild > > --- > > meta/classes/container-img.bbclass | 4 +--- > > meta/classes/image-container-extension.bbclass | 11 ++++++----- > > meta/classes/image-sdk-extension.bbclass | 2 +- > > 3 files changed, 8 insertions(+), 9 deletions(-) > > > > diff --git a/meta/classes/container-img.bbclass > > b/meta/classes/container-img.bbclass index > > 79ef3e8d756b..9928a58ef53d 100644 --- > > a/meta/classes/container-img.bbclass +++ > > b/meta/classes/container-img.bbclass @@ -9,10 +9,8 @@ > > do_container_image[stamp-extra-info] = "${DISTRO}-${MACHINE}" > > do_container_image[vardeps] += "CONTAINER_FORMATS" > > do_container_image(){ > > - rootfs_id="${DISTRO}-${DISTRO_ARCH}" > > - > > bbdebug 1 "Generate container image in these formats: > > ${CONTAINER_FORMATS}" > > - containerize_rootfs "${IMAGE_ROOTFS}" "${rootfs_id}" > > "${CONTAINER_FORMATS}" > > + containerize_rootfs "${IMAGE_ROOTFS}" "${CONTAINER_FORMATS}" > > } > > > > addtask container_image before do_image after do_image_tools > > diff --git a/meta/classes/image-container-extension.bbclass > > b/meta/classes/image-container-extension.bbclass index > > 0e70ba9c1405..43b67f9d864d 100644 --- > > a/meta/classes/image-container-extension.bbclass +++ > > b/meta/classes/image-container-extension.bbclass @@ -6,15 +6,16 @@ > > # This class extends the image.bbclass for containerizing the root > > filesystem. > > CONTAINER_FORMATS ?= "docker-archive" > > +CONTAINER_IMAGE_NAME ?= "${PN}-${DISTRO}-${DISTRO_ARCH}" > > +CONTAINER_TAG ?= "${PV}-${PR}" > > > > containerize_rootfs() { > > local cmd="/bin/dash" > > local empty_tag="empty" > > - local tag="latest" > > + local tag="${CONTAINER_TAG}" > > local oci_img_dir="${WORKDIR}/oci-image" > > local rootfs="$1" > > - local rootfs_id="$2" > > - local container_formats="$3" > > + local container_formats="$2" > > > > # prepare OCI container image skeleton > > bbdebug 1 "prepare OCI container image skeleton" > > @@ -42,9 +43,9 @@ containerize_rootfs() { > > sudo chown --recursive $(id -u):$(id -g) "${oci_img_dir}" > > > > # convert the OCI container image to the desired format > > - image_name="isar-${rootfs_id}" > > + image_name="${CONTAINER_IMAGE_NAME}" > > for image_type in ${CONTAINER_FORMATS} ; do > > - > > image_archive="${DEPLOY_DIR_IMAGE}/${rootfs_id}-${image_type}.tar" > > + > > image_archive="${DEPLOY_DIR_IMAGE}/${image_name}-${tag}-${image_type}.tar" > > bbdebug 1 "Creating container image type: ${image_type}" case > > "${image_type}" in "docker-archive" | "oci-archive") > > diff --git a/meta/classes/image-sdk-extension.bbclass > > b/meta/classes/image-sdk-extension.bbclass index > > 426b92595554..fa15b588068c 100644 --- > > a/meta/classes/image-sdk-extension.bbclass +++ > > b/meta/classes/image-sdk-extension.bbclass @@ -80,7 +80,7 @@ > > do_populate_sdk() { # generate the SDK in all the desired container > > formats if [ -n "${sdk_container_formats}" ] ; then > > bbnote "Generating SDK container in > > ${sdk_container_formats} format" > > - containerize_rootfs "${SDKCHROOT_DIR}" > > "sdk-${DISTRO}-${DISTRO_ARCH}" "${sdk_container_formats}" > > + containerize_rootfs "${SDKCHROOT_DIR}" > > "${sdk_container_formats}" fi > > } > > > >