From nobody Fri Apr 26 11:24:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1619190515; cv=none; d=zohomail.com; s=zohoarc; b=aRaHVfcdY6Kou7Lh9OoU5rbdy6L4QnL05i+5ARtpmLewDhbRWBcqMyiovwDuyao63xF91WJJroih/g/xUPTKCtcLSFyI/sfjYctTjQGUX2zHHrp63GPPtTDzo/VuG+dI+S11n1FxjPkqJb2734X5utptzfo5tGGa7w4mcjC1VkE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1619190515; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=OLtFjDm019o3+4LC0Dz2zXJGv00bb1jdnAXe3Yoj/pk=; b=B5YkEMs7CCZVfRkjUYXb2Tw6CaFWBSMrQbOAYvdYqKDtA5ROz11TkA4s08ym3T176RkzkqNv+k4Ok1SzqvC6ZQ6QWhTV9SuDMqdmQi+drbtDfYZdMLaXDBj2lJjCi4c60008gMyWL0RJ2NQvS9zp5rtgBsrxqPoAdfbSV1rHF3c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1619190515021579.2847734975055; Fri, 23 Apr 2021 08:08:35 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-328-FUgmWQtrNjuTlVnVF0amNQ-1; Fri, 23 Apr 2021 11:08:29 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D304A343A8; Fri, 23 Apr 2021 15:08:24 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B3C2A5D6B1; Fri, 23 Apr 2021 15:08:24 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 78CE21806D2A; Fri, 23 Apr 2021 15:08:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 13NF3HIp031677 for ; Fri, 23 Apr 2021 11:03:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id 601C010027A5; Fri, 23 Apr 2021 15:03:17 +0000 (UTC) Received: from harajuku.usersys.redhat.com (unknown [10.40.195.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 80A5010016DB for ; Fri, 23 Apr 2021 15:03:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619190513; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=OLtFjDm019o3+4LC0Dz2zXJGv00bb1jdnAXe3Yoj/pk=; b=M5dDLOKevMDeM9nUmNT+QUTFj53+qK6cimnmezhkJjQpPXQPwaXaONXDztzTqEHUbdySur SxrfxWAHM1/O5os9wilpvBVx0VoUI+4JGW6o9Unm8TlJUWbcCgieKjKeAMkTcBeqi1ZU6j ObmgksovGBBGGcJO3OIxrWYODTndYhY= X-MC-Unique: FUgmWQtrNjuTlVnVF0amNQ-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 01/11] ci: util: Drop documentation for api_version parameter Date: Fri, 23 Apr 2021 17:02:58 +0200 Message-Id: <20210423150308.346189-2-abologna@redhat.com> In-Reply-To: <20210423150308.346189-1-abologna@redhat.com> References: <20210423150308.346189-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" It's a leftover from development. Signed-off-by: Andrea Bolognani Reviewed-by: Erik Skultety --- ci/util.py | 1 - 1 file changed, 1 deletion(-) diff --git a/ci/util.py b/ci/util.py index 90d58454be..304d0d4af8 100644 --- a/ci/util.py +++ b/ci/util.py @@ -12,7 +12,6 @@ def get_registry_uri(namespace: str, =20 :param namespace: GitLab project namespace, e.g. "libvirt/libvirt" :param gitlab_uri: GitLab base URI, can be a private deployment - :param api_version: GitLab REST API version number :return: URI pointing to a namespaced project's image registry """ =20 --=20 2.26.3 From nobody Fri Apr 26 11:24:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1619190483; cv=none; d=zohomail.com; s=zohoarc; b=lMJum6vmC0y9nPEuV0QCBKCkP7eMhmhIisvzbSeBvuqK0T4kPmdwkRfzyicaxSIXsAEi9y4BtAkM0CcKGCwIWEf5GylzZS9TmZG9LGv7+7qoJZmfDpTTRTH8aLKbZJ/AUZgDnMo33NV2+GIogAlGPjlOzVs8r/TN4KomZFvvCUg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1619190483; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Wh7W14+lL2aItF9e9ltMszoMjjBBYgJipGXLF15uc4I=; b=cO0aZ9UcTL8lTjwWYaov7+AOujXCxerwp3POCwyt0nMx3mckV7gnu1MZ9WRM7/7bPINsbsFOwRPBmvCG59R4M8CQ5eP1Y/eV6T97hKhLG1fz5/MZ1AiPNoSNR/NmM5YPC/7LEKgJaFRh3DjABf9X6DyRLh1iviANWNS0tWtQV/Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1619190483912345.7432706116025; Fri, 23 Apr 2021 08:08:03 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-466-RoAz2trhOkuFE8td6YB8LA-1; Fri, 23 Apr 2021 11:08:00 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5C602802575; Fri, 23 Apr 2021 15:07:55 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3EB9B60854; Fri, 23 Apr 2021 15:07:55 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 0AA771806D1D; Fri, 23 Apr 2021 15:07:55 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 13NF3IMh031684 for ; Fri, 23 Apr 2021 11:03:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id B763F10027A5; Fri, 23 Apr 2021 15:03:18 +0000 (UTC) Received: from harajuku.usersys.redhat.com (unknown [10.40.195.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 152FB10016DB for ; Fri, 23 Apr 2021 15:03:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619190482; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Wh7W14+lL2aItF9e9ltMszoMjjBBYgJipGXLF15uc4I=; b=QDhbNQybsOAov8RVoDHFOdc1bPH787+wbJ1zofwoxUaXpJ/mhGtdE0vv/jRq+YJhVZctbw Zu1cmAYtw8AXuY/ECnLg9tqgPTtQPXRWTHvt9rKR962X1CHoa6R6CuYfWDfQ08+DhBJUsa I7SdLm24cD+dNj/S0WrHBYELh1reqgE= X-MC-Unique: RoAz2trhOkuFE8td6YB8LA-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 02/11] ci: util: Replace get_image_distro() with get_image_info() Date: Fri, 23 Apr 2021 17:02:59 +0200 Message-Id: <20210423150308.346189-3-abologna@redhat.com> In-Reply-To: <20210423150308.346189-1-abologna@redhat.com> References: <20210423150308.346189-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This is a more flexible function that parses the name of the container image into its components: distro name and, where applicable, target architecture for cross-building. Signed-off-by: Andrea Bolognani --- ci/util.py | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/ci/util.py b/ci/util.py index 304d0d4af8..e4e0955098 100644 --- a/ci/util.py +++ b/ci/util.py @@ -39,24 +39,32 @@ def get_registry_images(uri: str) -> List[Dict]: return json.loads(r.read().decode()) =20 =20 -def get_image_distro(image_name: str) -> str: +def get_image_info(image_name: str) -> Dict[str, str]: """ - Extract the name of the distro in the GitLab image registry name, e.g. - ci-debian-9-cross-mipsel --> debian-9 + Extract information about the image from its name, e.g. + + "ci-debian-9-cross-mipsel" + =3D> { "distro": "debian-9", "cross": "mipsel" } + + "ci-centos-8" + =3D> { "distro": "centos-8", "cross": None } =20 :param image_name: name of the GitLab registry image - :return: distro name as a string + :return: image information """ - name_prefix =3D "ci-" - name_suffix =3D "-cross-" + distro_prefix =3D "ci-" + cross_prefix =3D "-cross-" =20 - distro =3D image_name[len(name_prefix):] + distro =3D image_name[len(distro_prefix):] =20 - index =3D distro.find(name_suffix) - if index > 0: - distro =3D distro[:index] + cross_index =3D distro.find(cross_prefix) + if cross_index > 0: + cross =3D distro[cross_index + len(cross_prefix):] + distro =3D distro[:cross_index] + else: + cross =3D None =20 - return distro + return {"distro": distro, "cross": cross} =20 =20 def get_registry_stale_images(registry_uri: str, @@ -74,7 +82,8 @@ def get_registry_stale_images(registry_uri: str, =20 stale_images =3D {} for img in images: - if get_image_distro(img["name"]) not in supported_distros: + info =3D get_image_info(img["name"]) + if info["distro"] not in supported_distros: stale_images[img["name"]] =3D img["id"] =20 return stale_images --=20 2.26.3 From nobody Fri Apr 26 11:24:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1619190441; cv=none; d=zohomail.com; s=zohoarc; b=akEuFuLjT40c3CBZSO7FuAz+2Q4GuvG7cywHmzJ6DyMQD/HvXw+u5YfuLDPQrrneo412NuE0gPEhxeoSYQCIr3JV8E/sS7ghygAZ0s1dFu/82LyHvMxdvLX1+qWLJo6IHEb0NrNVgG4TySRlGtB9KQj/1taSoBvU6do5AEZepsk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1619190441; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=hP9TFob+8LHC7pTSK8+b7TvhxucOI6C+pkV9wm3yORk=; b=JNoMnmVuYvvX2jfXgioz5Vo56DWTUPPAF39iAwZIXLeLhcRo3wh33ETNGmwvt8cLlMYug1AZMkilSvPE3ou4yLHHE/vKV3JGB67sc6ae8bwTa2kUQuGKb4LRcI2M/7q4tKGNUoskhQk22V5kit0GtlQ2R9CErE4Xg5965j6PCBA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1619190441486879.4225392172051; Fri, 23 Apr 2021 08:07:21 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-431-uM19UBSBON-OLQItttlafA-1; Fri, 23 Apr 2021 11:07:16 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 340F618397A9; Fri, 23 Apr 2021 15:07:09 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6FC8660BD8; Fri, 23 Apr 2021 15:07:06 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 449B91806D1B; Fri, 23 Apr 2021 15:07:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 13NF3JXl031691 for ; Fri, 23 Apr 2021 11:03:20 -0400 Received: by smtp.corp.redhat.com (Postfix) id EDA1410027A5; Fri, 23 Apr 2021 15:03:19 +0000 (UTC) Received: from harajuku.usersys.redhat.com (unknown [10.40.195.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2AC2D10016DB for ; Fri, 23 Apr 2021 15:03:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619190439; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=hP9TFob+8LHC7pTSK8+b7TvhxucOI6C+pkV9wm3yORk=; b=SmDznaI7rOHcnfOw4xYWN6AGGuJ9gOTF/Pti4w0JpGTkQ24SRc2hsRl6y+QbOmGOEjl9Gn Oc0VfWpkbuPx3x4uG6eLdCTGgaxK1U9taPaRs0aPOFGZxwyS2KgxFJoibHCss801+2f69A 1H6x5tfB0fQQ1TzoQDVjZfAGvPNDgGU= X-MC-Unique: uM19UBSBON-OLQItttlafA-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 03/11] ci: util: Document that get_registry_images() returns raw data Date: Fri, 23 Apr 2021 17:03:00 +0200 Message-Id: <20210423150308.346189-4-abologna@redhat.com> In-Reply-To: <20210423150308.346189-1-abologna@redhat.com> References: <20210423150308.346189-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The current documentation makes it sound like the function will only return a simple list containing the name of each image available on the registry, but it actually returns a lot more information than that. Signed-off-by: Andrea Bolognani Reviewed-by: Erik Skultety --- ci/util.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ci/util.py b/ci/util.py index e4e0955098..625428f339 100644 --- a/ci/util.py +++ b/ci/util.py @@ -29,8 +29,13 @@ def get_registry_images(uri: str) -> List[Dict]: List all container images that are currently available in the given Gi= tLab project. =20 + The raw data, as obtained from the GitLab API, is returned: this + will contain not only the name of each image, but also additional + information such as the image ID, which can be used to perform + further operations with subsequent calls to the GitLab API. + :param uri: URI pointing to a GitLab instance's image registry - :return: list of container image names + :return: detailed information about container images """ =20 r =3D urllib.request.urlopen(uri + "?per_page=3D100") --=20 2.26.3 From nobody Fri Apr 26 11:24:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1619190489; cv=none; d=zohomail.com; s=zohoarc; b=FjtsUnap8iWju+I2WRUwYWsVi54+Ir+fDz/KWwTsRhD+0/jpeAkY9XzjYtMPKyPeQw4+9/DlKeiQCmpf7DYzLEgcHT1YJnMy0cjgJT80ANXy1inAAVRUtQLKZnQJ2ycpSCMzFSSFLTXdIfrZ19iOUIdVcKHNCSMQ+PW5RmJQavc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1619190489; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=NeLhYOnwAWFbGd/248/8vFtK+jjNX7fF33TbfF8QQJw=; b=RzN8xDEWN+LAoJtwnMZFu+tDG9NjdWoUJSXl8xVQUg0kJoxwUTShznIY1vQivRqd3y2hNuzO5KtTUdelwhOM3uPrysYK6NsZGB8ck/DDBkHash4yltCUWqXoAeMrcltlwlGxItON0VouFEvSdGZ3nW5CfGSqJiplMvtViZaK0mE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1619190489866901.8426198838179; Fri, 23 Apr 2021 08:08:09 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-201-RSQtMKGTMIq9ohVlHy6brg-1; Fri, 23 Apr 2021 11:08:04 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3F5FB1006C82; Fri, 23 Apr 2021 15:07:58 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 20E8F5945C; Fri, 23 Apr 2021 15:07:58 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id E10171806D1D; Fri, 23 Apr 2021 15:07:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 13NF3LJd031705 for ; Fri, 23 Apr 2021 11:03:21 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3DB1910027A5; Fri, 23 Apr 2021 15:03:21 +0000 (UTC) Received: from harajuku.usersys.redhat.com (unknown [10.40.195.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 76E7110016DB for ; Fri, 23 Apr 2021 15:03:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619190488; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=NeLhYOnwAWFbGd/248/8vFtK+jjNX7fF33TbfF8QQJw=; b=VUZDPD7kF5j/tkq1IlzYyoEoYRzrPEmWGQifieFLyD6VHrlziaNM5mbupCwcRblZ/a0iP6 AxR0p0BTjjKe/qXMb+tJgPHLucqy68hP+KHs3L4cpeUqfKCtCJKCyshFGFE+p0IikaIXXL 7mjYYeZSqJaxoy3nkjyUG5P+bT7Re2c= X-MC-Unique: RSQtMKGTMIq9ohVlHy6brg-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 04/11] ci: util: Add _raw suffix to get_registry_images() Date: Fri, 23 Apr 2021 17:03:01 +0200 Message-Id: <20210423150308.346189-5-abologna@redhat.com> In-Reply-To: <20210423150308.346189-1-abologna@redhat.com> References: <20210423150308.346189-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This stresses the fact that the function returns the data obtained from the GitLab API in its raw form; later on, we're going to implement a more convenient wrapper that extracts the information we're interested in and processes it so that it can be used more conveniently. Signed-off-by: Andrea Bolognani --- ci/helper | 2 +- ci/util.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ci/helper b/ci/helper index 2c3a9f8db4..eb037d3495 100755 --- a/ci/helper +++ b/ci/helper @@ -309,7 +309,7 @@ class Application: def _action_list_images(self): registry_uri =3D util.get_registry_uri(self._args.namespace, self._args.gitlab_uri) - images =3D util.get_registry_images(registry_uri) + images =3D util.get_registry_images_raw(registry_uri) =20 # skip the "ci-" prefix each of our container images' name has name_prefix =3D "ci-" diff --git a/ci/util.py b/ci/util.py index 625428f339..b6a99ce9c0 100644 --- a/ci/util.py +++ b/ci/util.py @@ -24,7 +24,7 @@ def get_registry_uri(namespace: str, return uri =20 =20 -def get_registry_images(uri: str) -> List[Dict]: +def get_registry_images_raw(uri: str) -> List[Dict]: """ List all container images that are currently available in the given Gi= tLab project. @@ -83,7 +83,7 @@ def get_registry_stale_images(registry_uri: str, :return: dictionary formatted as: {: } """ =20 - images =3D get_registry_images(registry_uri) + images =3D get_registry_images_raw(registry_uri) =20 stale_images =3D {} for img in images: --=20 2.26.3 From nobody Fri Apr 26 11:24:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1619190557; cv=none; d=zohomail.com; s=zohoarc; b=F4LJK/l+lM/O6Zidc6EfrOJXEse5lycZMvuGXam6/hlqhQPo0ZZJvrmN1q16LKr1YoWUcLpG1ygy63auJY+awJtSKKPmu8P0zNZpHbBYG/XNHTEm7uBM6VuC0APuKfemFm7ChVClo3++PaZBplQ359mXJMdlpl5uf37VR0ovqbM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1619190557; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=/IRj2DFvL4h1f18qbJPeVNChbkd7OVSiejOjIXoB+t0=; b=LGgk4OqwqWIhcu8h5Ipj982ptfRCy1drz+bkXA4FkBtzs9HezymgsFXMDLTKpAchWAUBS3qOTPkl56cC6ya+mUccz1IhuQQyDAXDWTyq5pQ/cxAtcPTRF3Eht/aA6SbDRVp35C8NYkvtrVvJYcXuyfFfHvEZutYpONjM1sE4IDQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1619190557833154.9464053702867; Fri, 23 Apr 2021 08:09:17 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-546-Z8MZOnjZM8WLJ8LBWUX6Pg-1; Fri, 23 Apr 2021 11:08:33 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1F0798189D3; Fri, 23 Apr 2021 15:08:28 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F1DEF60BE5; Fri, 23 Apr 2021 15:08:27 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id BC5DF1806D2D; Fri, 23 Apr 2021 15:08:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 13NF3MYY031713 for ; Fri, 23 Apr 2021 11:03:22 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8C7FF10027A5; Fri, 23 Apr 2021 15:03:22 +0000 (UTC) Received: from harajuku.usersys.redhat.com (unknown [10.40.195.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BD8FC10016DB for ; Fri, 23 Apr 2021 15:03:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619190556; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=/IRj2DFvL4h1f18qbJPeVNChbkd7OVSiejOjIXoB+t0=; b=L6n8GjxJBvH+baRmBJboVVls1qUbreaX22VE//kcnhVA7xxwMhzeoG+9/6FzAe4eLq/J+k Op37pEtgvjs0ThT+IFRBvIbAaoPbodlAUWJfo4134Dk4KI2Kfoj6jBC0aHp6bAOP0ztVjB E5JrCV4kddw+LWgbZBP2hGR9gsDzsc0= X-MC-Unique: Z8MZOnjZM8WLJ8LBWUX6Pg-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 05/11] ci: util: Add new get_registry_images() function Date: Fri, 23 Apr 2021 17:03:02 +0200 Message-Id: <20210423150308.346189-6-abologna@redhat.com> In-Reply-To: <20210423150308.346189-1-abologna@redhat.com> References: <20210423150308.346189-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Andrea Bolognani --- ci/util.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/ci/util.py b/ci/util.py index b6a99ce9c0..b314ebd078 100644 --- a/ci/util.py +++ b/ci/util.py @@ -72,6 +72,34 @@ def get_image_info(image_name: str) -> Dict[str, str]: return {"distro": distro, "cross": cross} =20 =20 +def get_registry_images(registry_uri: str) -> Dict[str, List[str]]: + """ + List all container images that are currently available in the + given GitLab project. + + The returned dictionary contains an entry for each available + distro, with its associated value being a (possibly empty) list + of cross-building architectures it supports. + + :param uri: URI pointing to a GitLab instance's image registry + :return: information about container images + """ + + registry_images =3D get_registry_images_raw(registry_uri) + + # Parse the names of all images found on the registry and + # organize them by distro + images =3D {} + for image in registry_images: + info =3D get_image_info(image["name"]) + if info["distro"] not in images: + images[info["distro"]] =3D [] + if info["cross"]: + images[info["distro"]].append(info["cross"]) + + return images + + def get_registry_stale_images(registry_uri: str, supported_distros: List[str]) -> Dict[str, i= nt]: """ --=20 2.26.3 From nobody Fri Apr 26 11:24:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1619190493; cv=none; d=zohomail.com; s=zohoarc; b=Qxoqd9LTy0qFZZrpVad6C5MLo9SyRwWo2ZQ0XOwRhtEAvHu4HD42nd4tswGxd78mduOTzKs8kWrH2R2ns2a/i9sS/MBe7KTO6eJkwRX7QYznSIKgvbr4YBk+wYsMdqgk9yXzKM54YBELawAlK7jZmcYPGRvuSUCGjcnzc0gISDo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1619190493; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=h8QSEAVRfszCFTZ2jP3rAXV35TtdB6RhTZIJTrMXS5E=; b=NTfnfJfxIKEELbVoYiQp5EMoyHIe6jRTdObujXCm1EhuEKKo6cI6dHeCrMxg8DsqHbfJ1ZrMpGTLg9NXBR82dsNX3boqGLsQpx75jzl/WhevrKHYVC8xy5YjmzPScLRVOFuVg511ma8BFvvu48SYs5SjQ3E97WcJ9bJinO1ks5o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1619190493477833.3987177404833; Fri, 23 Apr 2021 08:08:13 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-591-7MhvsILpPYqN_6gQ7kVg8Q-1; Fri, 23 Apr 2021 11:08:10 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1DEA8343A9; Fri, 23 Apr 2021 15:08:01 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0155F60613; Fri, 23 Apr 2021 15:08:01 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id BA88A1806D1F; Fri, 23 Apr 2021 15:08:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 13NF3OPa031727 for ; Fri, 23 Apr 2021 11:03:24 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0EB7D10027A5; Fri, 23 Apr 2021 15:03:24 +0000 (UTC) Received: from harajuku.usersys.redhat.com (unknown [10.40.195.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4A24E10016DB for ; Fri, 23 Apr 2021 15:03:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619190492; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=h8QSEAVRfszCFTZ2jP3rAXV35TtdB6RhTZIJTrMXS5E=; b=aY+rqzTIpMAefwSy0g1FmHUZ3N7SLVcM9aEqavPYoiBsAa0fZBJI+NuVqx72z/Qu/mp/ps xL1WElAQjnzt0CrrAI0r48j+MXpSmNoyIHAefq+WEOBJaL8cWntnp9v2LOmtI6dKYKL0eO NlYNrTa+zsdgvkDeTAP10NceNGKvaYw= X-MC-Unique: 7MhvsILpPYqN_6gQ7kVg8Q-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 06/11] ci: helper: Use get_registry_images() Date: Fri, 23 Apr 2021 17:03:03 +0200 Message-Id: <20210423150308.346189-7-abologna@redhat.com> In-Reply-To: <20210423150308.346189-1-abologna@redhat.com> References: <20210423150308.346189-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Generate output using the processed data instead of the raw data. The output remains identical for now, so this doesn't look like a big improvement, but we're soon going to change it in a way that highlights the convenience of using processed data. Signed-off-by: Andrea Bolognani --- ci/helper | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/ci/helper b/ci/helper index eb037d3495..c1e1a53d51 100755 --- a/ci/helper +++ b/ci/helper @@ -309,15 +309,18 @@ class Application: def _action_list_images(self): registry_uri =3D util.get_registry_uri(self._args.namespace, self._args.gitlab_uri) - images =3D util.get_registry_images_raw(registry_uri) - - # skip the "ci-" prefix each of our container images' name has - name_prefix =3D "ci-" - names =3D [i["name"][len(name_prefix):] for i in images] - names.sort() - - native =3D [name for name in names if "-cross-" not in name] - cross =3D [name for name in names if "-cross-" in name] + images =3D util.get_registry_images(registry_uri) + + native =3D [] + cross =3D [] + for image_distro in images.keys(): + if images[image_distro]: + for image_cross in images[image_distro]: + cross.append(image_distro + "-cross-" + image_cross) + else: + native.append(image_distro) + native.sort() + cross.sort() =20 spacing =3D 4 * " " print("Available x86 container images:\n") --=20 2.26.3 From nobody Fri Apr 26 11:24:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1619190457; cv=none; d=zohomail.com; s=zohoarc; b=bebVEmMlvLrPLG5vYB9M34/4aW9awLqPalR+BwRS8Pv6ZWzGGWti80amYcmrQevHXzr3UybhMizP9Zx9vUKBCUmRxyf+XDykL/VS4hDMWYTA/PjohsQi6aQh2xNDFvp5MJXENUHCzEJ5bBz31uFf633UNEC77dZ1oU4mSkQYxkU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1619190457; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=S9YDa0UhkswHffF88/QxFcJ9lwleK6OFl/S6rcLKkb4=; b=PO5EE+x4n7Ce64WgqnJ4/vZQgmoIhhqjxmmtjuMVbnpL2dAQ37ZgzhV2e5/mc85FmMtL0h4DgXpw9fBlIP6cCCshXmEiARjYVgsTUIKeMLvgaeskGCEqfSUJaeCQD+9FhvCqB+KK9TWg3HopapFkXiC3O1GsWLz14Ml8jTIMyu0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1619190457888244.96114980501272; Fri, 23 Apr 2021 08:07:37 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-161-sJbanMUUNQ-hTkbfdAkCcA-1; Fri, 23 Apr 2021 11:07:34 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8E89A107ACCA; Fri, 23 Apr 2021 15:07:26 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6C79960C17; Fri, 23 Apr 2021 15:07:26 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id CED1844A58; Fri, 23 Apr 2021 15:07:25 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 13NF3PWk031734 for ; Fri, 23 Apr 2021 11:03:25 -0400 Received: by smtp.corp.redhat.com (Postfix) id 857C610027C4; Fri, 23 Apr 2021 15:03:25 +0000 (UTC) Received: from harajuku.usersys.redhat.com (unknown [10.40.195.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9771510027A5 for ; Fri, 23 Apr 2021 15:03:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619190456; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=S9YDa0UhkswHffF88/QxFcJ9lwleK6OFl/S6rcLKkb4=; b=MXauO5tMv+TvwuZSi0uzcHyBYxgyzQ9r1GUxVc49dfP4yXLg3wvQkuZiJIY55Jbs26HfzE 4qTTcY6hKMJzVXKcQP9AGk+jgEKTAGYVwuHi9eUtFJt7Qfm13U8uoWvdmfYBAilt8llhsx 1eTQnzDD15QjITIzDTGEY3JBkw7xNvE= X-MC-Unique: sJbanMUUNQ-hTkbfdAkCcA-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 07/11] ci: helper: Improve output for list-images action Date: Fri, 23 Apr 2021 17:03:04 +0200 Message-Id: <20210423150308.346189-8-abologna@redhat.com> In-Reply-To: <20210423150308.346189-1-abologna@redhat.com> References: <20210423150308.346189-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This makes the output more compact by grouping together all images that are built on the same base OS. Later on, when we change the actions that operate on container images to accept an lcitool-style --cross-arch argument instead of expecting the name of the image to have the cross-building architecture baked in, this will allow users to quickly copy-and-paste the necessary information. Signed-off-by: Andrea Bolognani --- ci/helper | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/ci/helper b/ci/helper index c1e1a53d51..6543a47131 100755 --- a/ci/helper +++ b/ci/helper @@ -311,25 +311,12 @@ class Application: self._args.gitlab_uri) images =3D util.get_registry_images(registry_uri) =20 - native =3D [] - cross =3D [] - for image_distro in images.keys(): - if images[image_distro]: - for image_cross in images[image_distro]: - cross.append(image_distro + "-cross-" + image_cross) + for distro in sorted(images.keys()): + if images[distro]: + cross =3D " ".join(sorted(images[distro])) + print(f"{distro} (cross: {cross})") else: - native.append(image_distro) - native.sort() - cross.sort() - - spacing =3D 4 * " " - print("Available x86 container images:\n") - print(spacing + ("\n" + spacing).join(native)) - - if cross: - print() - print("Available cross-compiler container images:\n") - print(spacing + ("\n" + spacing).join(cross)) + print(distro) =20 def _action_refresh(self): self._refresh_containers() --=20 2.26.3 From nobody Fri Apr 26 11:24:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1619190495; cv=none; d=zohomail.com; s=zohoarc; b=eynZLMgdzS1Y8FRdi8/wpuaM2zhf5phKOCGUG4zstfyYqQ0PB12w+VC1XowwAxGyg0xSVsgj0UZtLERW/0B77wkkLyTzH18zMi+sXekn8LbimTNvCW5cdsv8bEZ54SuQBOzarTCZ3Pa+yiUSmeiwGDyCVbq6WTFlMRzeEUromto= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1619190495; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=g6IAnzqQxYi4kYgrNedZIumT0QyiusveK8WUejHfGIM=; b=CfHnVNysnPQH3gOshdPLaVbDgAMGsE5cQ/zRo5l9RafjwlPsavForM0Y8YEBY3QO24z+3fSqFZooOUT/BUsCoeoua8luClAVU50gYSMZlAdjTHTywyEHFiEhdtmODcoDiUSeeGHlUvnugVKvWDZIx8/1l2soZrm/520X/9x/73A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 161919049541570.10807588076409; Fri, 23 Apr 2021 08:08:15 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-250-3FvYo4_qM3WOQmKySKo8uA-1; Fri, 23 Apr 2021 11:08:11 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CF26C18397A5; Fri, 23 Apr 2021 15:08:03 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AA2BE60C13; Fri, 23 Apr 2021 15:08:03 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 6E6D21806D21; Fri, 23 Apr 2021 15:08:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 13NF3Qcw031743 for ; Fri, 23 Apr 2021 11:03:26 -0400 Received: by smtp.corp.redhat.com (Postfix) id D5E7910016DB; Fri, 23 Apr 2021 15:03:26 +0000 (UTC) Received: from harajuku.usersys.redhat.com (unknown [10.40.195.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0E5F610027A5 for ; Fri, 23 Apr 2021 15:03:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619190493; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=g6IAnzqQxYi4kYgrNedZIumT0QyiusveK8WUejHfGIM=; b=BMa/XR+6adqDbivS3SUpFTH/5jCgyClfnw68tRSV4FAleMcDg8cRbmncxcEQJfEb2793P5 seSHCQUY8b9veToVi6ouCpywEgJVv2VE/zjk5Si8hF5blWDB0deppimAJ/pTzh/UewB6n0 h00RfU8/5WarjzykJUjd6MIFdi1OGRU= X-MC-Unique: 3FvYo4_qM3WOQmKySKo8uA-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 08/11] ci: helper: Add _make_run_action() function Date: Fri, 23 Apr 2021 17:03:05 +0200 Message-Id: <20210423150308.346189-9-abologna@redhat.com> In-Reply-To: <20210423150308.346189-1-abologna@redhat.com> References: <20210423150308.346189-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This provides a single place where we can process self._args before handing the control over to make; later on, we're going to implement more logic that can be shared by the build, test and shell actions. Signed-off-by: Andrea Bolognani --- ci/helper | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ci/helper b/ci/helper index 6543a47131..31e05c0e38 100755 --- a/ci/helper +++ b/ci/helper @@ -186,6 +186,11 @@ class Application: if pty.spawn(["make"] + args) !=3D 0: sys.exit("error: 'make' failed") =20 + def _make_run_action(self, action): + target =3D self._args.target + make_target =3D f"{action}@{target}" + self._make_run(make_target) + def _lcitool_run(self, args): output =3D subprocess.check_output([self._args.lcitool] + args) return output.decode("utf-8") @@ -298,13 +303,13 @@ class Application: print(msg.replace("STALE_DETAILS", stale_details)) =20 def _action_build(self): - self._make_run(f"ci-build@{self._args.target}") + self._make_run_action("ci-build") =20 def _action_test(self): - self._make_run(f"ci-test@{self._args.target}") + self._make_run_action("ci-test") =20 def _action_shell(self): - self._make_run(f"ci-shell@{self._args.target}") + self._make_run_action("ci-shell") =20 def _action_list_images(self): registry_uri =3D util.get_registry_uri(self._args.namespace, --=20 2.26.3 From nobody Fri Apr 26 11:24:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1619190499; cv=none; d=zohomail.com; s=zohoarc; b=mWJW2jlVVy9GHByh4+46sPQsaemyCQG6cdECBLIM4AAJMtEU2hIJO2r9Bp+dm9r9/bgkmGf5N5F9JFdm6mEXVI+Vxxx/9JimBc01aXdBU26NQgFyDzsW+YujRLyUueSOmlZgj/bXbTGsRoetOnDYAdVpDN66Ds8o/PMjvzLNtHQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1619190499; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=FU1hbEyGKeHbIQzFX+1Gatqd/O8fuep9A7SlAW7n4uw=; b=ewGwP4NwgKuLclsgZ/acDOivWLycxd+wUE0aAGj+cyPjLQftnc9NUAeFjnF1rMbKdxfvBKmLv117GBtBqQSJD4b25Q4ltfew0NqTQcuDN+l1Og6HCPRzjdV8AaVcNl1z7WUeuNopB291AZcXjoL7+WK6rM4olkRoOiakfp8rWL4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1619190499415684.624432937213; Fri, 23 Apr 2021 08:08:19 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-226-nUdKH4hfMiOuTFLBlgKtKg-1; Fri, 23 Apr 2021 11:08:12 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B12698189CB; Fri, 23 Apr 2021 15:08:06 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 84E5C5C3FD; Fri, 23 Apr 2021 15:08:06 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 3E99344A5D; Fri, 23 Apr 2021 15:08:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 13NF3S8J031759 for ; Fri, 23 Apr 2021 11:03:28 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8098010027A5; Fri, 23 Apr 2021 15:03:28 +0000 (UTC) Received: from harajuku.usersys.redhat.com (unknown [10.40.195.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 90E6D10016DB for ; Fri, 23 Apr 2021 15:03:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619190497; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=FU1hbEyGKeHbIQzFX+1Gatqd/O8fuep9A7SlAW7n4uw=; b=BFdXd2fRElJRwyonfNj3F/g4cuPgJpkLW1D+AquhsfI6E0jHC/nrlR/5ZLRQDPQ5SJPRuO kCG1wuzUvXxvVV/I5A/vVhxMbq4059CDw3zrVuYylWUT2An0S+ptYGxCfhdpvUo+yiQ+U9 L+/S4gqWjIiDFbNHWmgohSPnL09mtvM= X-MC-Unique: nUdKH4hfMiOuTFLBlgKtKg-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 09/11] ci: helper: Accept --cross-arch argument Date: Fri, 23 Apr 2021 17:03:06 +0200 Message-Id: <20210423150308.346189-10-abologna@redhat.com> In-Reply-To: <20210423150308.346189-1-abologna@redhat.com> References: <20210423150308.346189-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This argument is accepted by all actions that use containers. Signed-off-by: Andrea Bolognani --- ci/helper | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ci/helper b/ci/helper index 31e05c0e38..e39934d357 100755 --- a/ci/helper +++ b/ci/helper @@ -23,6 +23,10 @@ class Parser: "target", help=3D"perform action on target OS", ) + containerparser.add_argument( + "-x", "--cross-arch", + help=3D"target architecture for cross-compiler", + ) containerparser.add_argument( "--engine", choices=3D["auto", "podman", "docker"], @@ -188,7 +192,13 @@ class Application: =20 def _make_run_action(self, action): target =3D self._args.target - make_target =3D f"{action}@{target}" + cross =3D self._args.cross_arch + + if cross: + make_target =3D f"{action}@{target}-cross-{cross}" + else: + make_target =3D f"{action}@{target}" + self._make_run(make_target) =20 def _lcitool_run(self, args): --=20 2.26.3 From nobody Fri Apr 26 11:24:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1619190463; cv=none; d=zohomail.com; s=zohoarc; b=arfpQqlkbmLbwZ84ftGqdyA3tu1WO4Vbl0pppv9SUlwhH+7Wbb0DNta35FzN9AivY1r6kuSc+ji4J/Sa1v3kaOC1qwUcnJNIC9BSBv0oGiU9DMaLjOw2MtGzjQxyo4JRVObKlpVHnCF9zAg8gfQ3Md9ZLb9F0FWt9WGlLI3LcQ8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1619190463; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=l1X/R2MaA5ceOpTmupJYikI0DYMYvnenPRYeiPjj2WI=; b=DqddwlDwDzRTwytG4mWmjNxkKOspjPJbo4mk/UYAoE4VYJ5fXO7iAPIf70fDUcqPdnR21X7LbEfF0037GIJZ0B0NI9gDug0Rz5HO5kv0j5U1dNPiaY3IYk1MFevN7xljHOAOp19vtyR3WQsfK+/mn1p/icGwdRnKcH66DEYgo/8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 161919046334097.78522614397934; Fri, 23 Apr 2021 08:07:43 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-495-bai8HT4RPcm-QAG6wVz6lQ-1; Fri, 23 Apr 2021 11:07:37 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E6DB118397B0; Fri, 23 Apr 2021 15:07:30 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B56C910027A5; Fri, 23 Apr 2021 15:07:30 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 7A8321806D1B; Fri, 23 Apr 2021 15:07:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 13NF3TDk031767 for ; Fri, 23 Apr 2021 11:03:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id D3CC010027A5; Fri, 23 Apr 2021 15:03:29 +0000 (UTC) Received: from harajuku.usersys.redhat.com (unknown [10.40.195.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 05A1B10016DB for ; Fri, 23 Apr 2021 15:03:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619190460; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=l1X/R2MaA5ceOpTmupJYikI0DYMYvnenPRYeiPjj2WI=; b=TJIfmitJsbaclQEGFEUoCzX8DN+BAnQklPE+mKa/SEKvY+OnOGuJ4UtqP92qa3vtQclI44 RHEloycshbKfoozRr0KrH2P1LDwaThuDmX5WOJ33lzaYL5a4m3CF4M0ZfJ9yFHjC7kJ/XR InHBWZKf1mncS7Wv+8YCl24nqYzwhac= X-MC-Unique: bai8HT4RPcm-QAG6wVz6lQ-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 10/11] ci: helper: Enable gitlabparser for container actions Date: Fri, 23 Apr 2021 17:03:07 +0200 Message-Id: <20210423150308.346189-11-abologna@redhat.com> In-Reply-To: <20210423150308.346189-1-abologna@redhat.com> References: <20210423150308.346189-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Unfortunately this doesn't work completely yet, because the underlying Makefile has no notion of the --namespace and --gitlab-uri arguments, but we need the subparser to be enabled so that we can use the corresponding information in _make_run_action() for validation purposes. Once we've reimplemented the Makefile part in Python, then the new arguments will start working as expected. Signed-off-by: Andrea Bolognani --- ci/helper | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ci/helper b/ci/helper index e39934d357..cd3069a89a 100755 --- a/ci/helper +++ b/ci/helper @@ -99,7 +99,7 @@ class Parser: buildparser =3D subparsers.add_parser( "build", help=3D"run a build in a container", - parents=3D[containerparser, mesonparser], + parents=3D[gitlabparser, containerparser, mesonparser], formatter_class=3Dargparse.ArgumentDefaultsHelpFormatter, ) buildparser.set_defaults(func=3DApplication._action_build) @@ -108,7 +108,7 @@ class Parser: testparser =3D subparsers.add_parser( "test", help=3D"run a build in a container (including tests)", - parents=3D[containerparser, mesonparser], + parents=3D[gitlabparser, containerparser, mesonparser], formatter_class=3Dargparse.ArgumentDefaultsHelpFormatter, ) testparser.set_defaults(func=3DApplication._action_test) @@ -117,7 +117,7 @@ class Parser: shellparser =3D subparsers.add_parser( "shell", help=3D"start a shell in a container", - parents=3D[containerparser], + parents=3D[gitlabparser, containerparser], formatter_class=3Dargparse.ArgumentDefaultsHelpFormatter, ) shellparser.set_defaults(func=3DApplication._action_shell) --=20 2.26.3 From nobody Fri Apr 26 11:24:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1619190548; cv=none; d=zohomail.com; s=zohoarc; b=LUy6ChXOfm1wB+bj6y0FAu9fy6R3JRcZyVrxW1Yu8lSFFyJ0q8rfJQY7Q6GWCjb1lzEtAICezRz5SD5P+CGD39oPNwKI49rD7USvF/8D5+I3isTxjjmZzcz8aTOTIpG2S1f2w000VS1FVerlxRMPn82zgEYQcQtd24KNbUMMIdM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1619190548; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=g/FZ3hDOJXEGQeeqsKhngX5ARAoTJgOCxEiRR1+oW50=; b=M7I0tCFbwzO5lsuAbUOOzATPZEUMSth6K8OxisnB47YojS93NF4VaThXVd8nbhzGTFscFbG8UC8InrMZYqZqYsfsppTCK6OEf7IHJKeFs9YHgN2zobXjootSZDOymsl0ToKfS4CGK3CsWA+nKYzglJlSTiLaMcZb3p4PYKdrcIY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 161919054853373.9757969301462; Fri, 23 Apr 2021 08:09:08 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-442-j-QwbYMUMGigOcJj7aJ5aQ-1; Fri, 23 Apr 2021 11:08:16 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A568918397A8; Fri, 23 Apr 2021 15:08:09 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 82AE72B0A5; Fri, 23 Apr 2021 15:08:09 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 20CC11806D22; Fri, 23 Apr 2021 15:08:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 13NF3VQu031780 for ; Fri, 23 Apr 2021 11:03:31 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3427C10016DB; Fri, 23 Apr 2021 15:03:31 +0000 (UTC) Received: from harajuku.usersys.redhat.com (unknown [10.40.195.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6FFF210027A5 for ; Fri, 23 Apr 2021 15:03:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619190547; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=g/FZ3hDOJXEGQeeqsKhngX5ARAoTJgOCxEiRR1+oW50=; b=WpmdSoh3UlUrRiAN+ZCoK46t5ntz40Ab+n3mR9H+rRHAV6n6V4UOD9OtCYmMETodeYz7Rb ZiJ92kAWBbXxU1avsFZnC6eJRt4zBdzR4CIuqy0X9oFsWgB2ETGC4oWmHnucTMBzBqB8vu OCfby51w09Gr099sL8Z2Xx9GDJ4WRCI= X-MC-Unique: j-QwbYMUMGigOcJj7aJ5aQ-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 11/11] ci: helper: Perform some validation on containers Date: Fri, 23 Apr 2021 17:03:08 +0200 Message-Id: <20210423150308.346189-12-abologna@redhat.com> In-Reply-To: <20210423150308.346189-1-abologna@redhat.com> References: <20210423150308.346189-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This reports a nice error messages when the user attempts to perform a cross-build on a target that doesn't support it, or to use a target that doesn't exist at all. Signed-off-by: Andrea Bolognani --- ci/helper | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ci/helper b/ci/helper index cd3069a89a..d5bdb15112 100755 --- a/ci/helper +++ b/ci/helper @@ -191,10 +191,19 @@ class Application: sys.exit("error: 'make' failed") =20 def _make_run_action(self, action): + registry_uri =3D util.get_registry_uri(self._args.namespace, + self._args.gitlab_uri) + images =3D util.get_registry_images(registry_uri) target =3D self._args.target cross =3D self._args.cross_arch =20 + if target not in images: + sys.exit(f"Unknown target '{target}'") + if cross: + if cross not in images[target]: + sys.exit(f"Target '{target}' doesn't support cross '{cross= }'") + make_target =3D f"{action}@{target}-cross-{cross}" else: make_target =3D f"{action}@{target}" --=20 2.26.3