From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id CF356459B3; Mon, 16 Sep 2024 20:14:55 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9300740E37; Mon, 16 Sep 2024 20:14:55 +0200 (CEST) Received: from mail-pl1-f225.google.com (mail-pl1-f225.google.com [209.85.214.225]) by mails.dpdk.org (Postfix) with ESMTP id 0FFC740261 for ; Mon, 16 Sep 2024 20:14:54 +0200 (CEST) Received: by mail-pl1-f225.google.com with SMTP id d9443c01a7336-20792913262so28126455ad.3 for ; Mon, 16 Sep 2024 11:14:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1726510493; x=1727115293; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=yXy09JVY61qopso/ZYpgauv6CEbiN4pnI34TW8HxiuQ=; b=DjDKW5NcsVc28zVU2RyvsysJK0mZnlN1Moj2ocvrCbznuMDYAZCmEKcWdrWTPe/TjD EllO9rbB8jHS0nONIHvqlLHH5JSbjx9dI/TyaX8+ofHPdOKI54+KNJ8CKzbPLNbEYtV3 +iAGoKwKJwzuJZrN+K7/KJ/vOYGtwnD85ieRI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726510493; x=1727115293; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yXy09JVY61qopso/ZYpgauv6CEbiN4pnI34TW8HxiuQ=; b=Dizl9X0ao+uhkwi4BhS/d3wyyFIKhmrW9Dz27Pv9mJkRfgXHOm1gVhR3xU2IBaaInB qx7ykunuql3Q02nEMbX8SUvObklL1I89xKdWW+Oj3vqV0jqZLM7Wiexv7NgAoic41rKi jrU4Bs+zGZY3Uoh7Cj6YgKcjQGE49zZTD2SurboD0BDmMr6o/+USmC9KYF5Ssgq/hbnL Bsb/wgiOO8PWYygXXYtziRYHY2TzEEYxUsTx2QrA7R1ZDfLMpJ+vJlc1phkMOse6yLiV 416jyYYFdeF8lF6GZcqGYELFaUcqMIeqdXfd/ACJZORFrEWdHRpqjaE9gr38ikqvCTFq 78QQ== X-Gm-Message-State: AOJu0YwmfaNSegguvZd6byA9jibu6MiqEVTd3ZQp+VHt1SQYPUFmDIFw AlP7yKUnWxH4mxnDVUqI1Q8j89PkYcwwWBtFTt9ZdKtZGm3Vykp9FljxwtMW8YzqV1EVKmsw+jD 7AYs9SY2O5g3wP4JN6Nl8GJNjk85HfH8E X-Google-Smtp-Source: AGHT+IG2AM/w7iExbWYXk9jof639maW907LkY+55wTcNJX1kO6XqzjND1G6exaj4D10XOJIshPbMfSaMPUj6 X-Received: by 2002:a17:902:e80c:b0:207:20c5:42c with SMTP id d9443c01a7336-20782a69ebemr216100335ad.45.1726510493140; Mon, 16 Sep 2024 11:14:53 -0700 (PDT) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [132.177.123.84]) by smtp-relay.gmail.com with ESMTPS id d9443c01a7336-207945da7adsm1462075ad.27.2024.09.16.11.14.52 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Sep 2024 11:14:53 -0700 (PDT) X-Relaying-Domain: iol.unh.edu Received: from iol.unh.edu (unknown [IPv6:2606:4100:3880:1257::1083]) by postal.iol.unh.edu (Postfix) with ESMTP id C2F75605C351; Mon, 16 Sep 2024 14:14:51 -0400 (EDT) From: jspewock@iol.unh.edu To: npratte@iol.unh.edu, probb@iol.unh.edu, wathsala.vithanage@arm.com, yoan.picchi@foss.arm.com, juraj.linkes@pantheon.tech, paul.szczepanek@arm.com, alex.chapman@arm.com, Luca.Vizzarro@arm.com, thomas@monjalon.net, Honnappa.Nagarahalli@arm.com Cc: dev@dpdk.org, Jeremy Spewock Subject: [PATCH v2] dts: fix runner target in the Dockerfile Date: Mon, 16 Sep 2024 14:14:45 -0400 Message-ID: <20240916181445.13997-1-jspewock@iol.unh.edu> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240911155058.11321-1-jspewock@iol.unh.edu> References: <20240911155058.11321-1-jspewock@iol.unh.edu> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Jeremy Spewock Currently the runner target in the Dockerfile attempts to run the `poetry install` command when building the image, but this fails due to poetry not being found in the container. Poetry is installed in a previous step with pipx, but doing so adds the binary to use poetry to ~/.local/bin which isn't present in the PATH variable in the container image. The command `pipx ensurepath` fixes this issue in most cases, but it requires a restart of the shell in order for the changes to take place which is not something that can be done in the runner target. To solve this problem this patch manually adds ~/.local/bin to PATH in the runner target. Additionally, the command for installing poetry in the runner target uses a depreciated flag, and the --revision parameter does not work with the runner target. To address these problems the --no-dev flag is removed in this patch and replaced with the new method of doing the same thing alongside the --no-root flag from the DTS documentation and git is added to the base target of the image. The CMD of the runner target is also replaced with an ENTRYPOINT for ease of use. Fixes: 19082c1fac43 ("dts: add Dockerfile") Cc: juraj.linkes@pantheon.tech Signed-off-by: Jeremy Spewock --- dts/Dockerfile | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/dts/Dockerfile b/dts/Dockerfile index a81e46c41a..58642fdc67 100644 --- a/dts/Dockerfile +++ b/dts/Dockerfile @@ -13,8 +13,11 @@ RUN apt-get -y update && apt-get -y upgrade && \ python3-pip \ pipx \ python3-cachecontrol \ + git \ + xz-utils \ openssh-client && \ - pipx install poetry>=1.8.2 && pipx ensurepath + pipx install poetry>=1.8.2 && pipx ensurepath && \ + git config --global --add safe.directory /dpdk WORKDIR /dpdk/dts @@ -24,9 +27,12 @@ FROM base AS runner # It bakes DTS into the image during the build. COPY . /dpdk/dts -RUN poetry install --no-dev +# Adds ~/.local/bin to PATH so that packages installed with pipx are callable. `pipx ensurepath` +# fixes this issue, but requires the shell to be re-opened which isn't an option for this target. +ENV PATH="$PATH:/root/.local/bin" +RUN poetry install --only main --no-root -CMD ["poetry", "run", "python", "main.py"] +ENTRYPOINT ["poetry", "run", "python", "main.py"] FROM base AS dev @@ -35,4 +41,4 @@ FROM base AS dev # the dependencies should be installed using Poetry. RUN apt-get -y install --no-install-recommends \ - vim emacs git + vim emacs -- 2.46.0