From nobody Sun Feb 8 19:03:06 2026 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=1612976609; cv=none; d=zohomail.com; s=zohoarc; b=XtUm0pZSIGI3K2W42GGh7WCvt6bmR2LAGgHq/4noQ70enSCcHZAi/xakr756/t2Hp1PJP2+B5RislSmyVg3dmiminrnIuwZT4TFDYiBB+ssn+rJEzccxRxJOZWL0sUqebiMMn/E9g+ThPqa9faaLRBFAas+aVGixcfYZ52Ozvzw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612976609; h=Content-Type:Content-Transfer-Encoding:Cc: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=BTrBU9Rkpo+PjX5RCGDLi1bYN91mZtTiuv5iJHAxD4Y=; b=D0fsiV7Z2dsvouBFHwCE9EejgNsIjDljXSPCZwZT/OGB5ftUmPqC+k22zAz+ifvUS1FyQCO0oj1KTC9Q63HEHL/ATfV1vVyCKJ7RuPoask+GZq5Sg8chFiCi+S7iqL0MmJeJiccKgv4L1Wv4p+5LhD3/YvHTCC1pepapKHSc9ck= 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 1612976608865484.03491090235855; Wed, 10 Feb 2021 09:03:28 -0800 (PST) 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-253-Rw7Tg0UTMqi2nC7DF0S_Wg-1; Wed, 10 Feb 2021 12:03:24 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 958DB80196E; Wed, 10 Feb 2021 17:03:16 +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 673E919C44; Wed, 10 Feb 2021 17:03:16 +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 E363357DFE; Wed, 10 Feb 2021 17:03:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 11AH0s8L014652 for ; Wed, 10 Feb 2021 12:00:54 -0500 Received: by smtp.corp.redhat.com (Postfix) id E89EE7D55E; Wed, 10 Feb 2021 17:00:53 +0000 (UTC) Received: from nautilus.redhat.com (unknown [10.40.192.74]) by smtp.corp.redhat.com (Postfix) with ESMTP id E443E72FBB; Wed, 10 Feb 2021 17:00:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612976607; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=BTrBU9Rkpo+PjX5RCGDLi1bYN91mZtTiuv5iJHAxD4Y=; b=c0jbw4Eo3pGjLeeHWrw+nti6+hy6sHjtXsdH0sGmpE5DdQWLeI3rSGEbYlZPHe1m4ks9sm FFRY0sufZZxp0icYvYqsZR34y0hVoGxrv1yQcAwGlvy0hXAlV5wwn3wMPkJjKdcAFLXmM5 s0UzCvvwpdmBTAN2t/ml781/kcY0iDE= X-MC-Unique: Rw7Tg0UTMqi2nC7DF0S_Wg-1 From: Erik Skultety To: libvir-list@redhat.com Subject: [libvirt PATCH 2/4] ci: Run podman command directly without wrapping it with prepare.sh Date: Wed, 10 Feb 2021 18:00:42 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: eskultet@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.23 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 prepare.sh script isn't currently used and forces us to make use of sudo to switch the user inside the container from root to $USER which created a problem on our Debian Slim-based containers which don't have the 'sudo' package installed. This patch removes the sudo invocation and instead runs the CMD directly with podman. Summary of the changes: - move the corresponding env variables which we need to be set in the environment from the sudo invocation to the podman invocation - pass --workdir to podman to retain the original behaviour we had with sudo spawning a login shell. - MESON_ARGS env variable doesn't need to propagated to the execution environment anymore (like we had to do with sudo), because it's defined in the Dockerfile Signed-off-by: Erik Skultety Reviewed-by: Andrea Bolognani --- ci/Makefile | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/ci/Makefile b/ci/Makefile index 7938e14c15..1a376a7f0c 100644 --- a/ci/Makefile +++ b/ci/Makefile @@ -82,7 +82,6 @@ CI_HOME_MOUNTS =3D \ $(NULL) =20 CI_SCRIPT_MOUNTS =3D \ - --volume $(CI_SCRATCHDIR)/prepare:$(CI_USER_HOME)/prepare:z \ --volume $(CI_SCRATCHDIR)/build:$(CI_USER_HOME)/build:z \ $(NULL) =20 @@ -150,6 +149,8 @@ CI_GIT_ARGS =3D \ # --user we execute as the same user & group account # as dev so that file ownership matches host # instead of root:root +# --workdir we change to user's home dir in the container +# before running the workload # --volume to pass in the cloned git repo & config # --ulimit lower files limit for performance reasons # --interactive @@ -158,6 +159,11 @@ CI_ENGINE_ARGS =3D \ --rm \ --interactive \ --tty \ + --user $(CI_UID):$(CI_GID) \ + --workdir $(CI_USER_HOME) \ + --env CI_CONT_SRCDIR=3D"$(CI_CONT_SRCDIR)" \ + --env CI_MESON_ARGS=3D"$(CI_MESON_ARGS)" \ + --env CI_NINJA_ARGS=3D"$(CI_NINJA_ARGS)" \ $(CI_PODMAN_ARGS) \ $(CI_PWDB_MOUNTS) \ $(CI_HOME_MOUNTS) \ @@ -178,9 +184,8 @@ ci-prepare-tree: ci-check-engine cp /etc/passwd $(CI_SCRATCHDIR); \ cp /etc/group $(CI_SCRATCHDIR); \ mkdir -p $(CI_SCRATCHDIR)/home; \ - cp "$(CI_PREPARE_SCRIPT)" $(CI_SCRATCHDIR)/prepare; \ cp "$(CI_BUILD_SCRIPT)" $(CI_SCRATCHDIR)/build; \ - chmod +x "$(CI_SCRATCHDIR)/prepare" "$(CI_SCRATCHDIR)/build"; \ + chmod +x "$(CI_SCRATCHDIR)/build"; \ echo "Cloning $(CI_GIT_ROOT) to $(CI_HOST_SRCDIR)"; \ git clone $(CI_GIT_ARGS) $(CI_GIT_ROOT) $(CI_HOST_SRCDIR) || exit 1; \ for mod in $$(git submodule | awk '{ print $$2 }' | sed -E 's,^../,,g') = ; \ @@ -192,18 +197,10 @@ ci-prepare-tree: ci-check-engine fi =20 ci-run-command@%: ci-prepare-tree - $(CI_ENGINE) run $(CI_ENGINE_ARGS) $(CI_IMAGE_PREFIX)$*$(CI_IMAGE_TAG) \ - /bin/bash -c ' \ - $(CI_USER_HOME)/prepare || exit 1; \ - sudo \ - --login \ - --user=3D"#$(CI_UID)" \ - --group=3D"#$(CI_GID)" \ - MESON_OPTS=3D"$$MESON_OPTS" \ - CI_CONT_SRCDIR=3D"$(CI_CONT_SRCDIR)" \ - CI_MESON_ARGS=3D"$(CI_MESON_ARGS)" \ - CI_NINJA_ARGS=3D"$(CI_NINJA_ARGS)" \ - $(CI_COMMAND) || exit 1' + $(CI_ENGINE) run \ + $(CI_ENGINE_ARGS) \ + $(CI_IMAGE_PREFIX)$*$(CI_IMAGE_TAG) \ + $(CI_COMMAND) @test "$(CI_CLEAN)" =3D "1" && rm -rf $(CI_SCRATCHDIR) || : =20 ci-shell@%: --=20 2.29.2