DPDK patches and discussions
 help / color / mirror / Atom feed
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 <jspewock@iol.unh.edu>
Subject: [PATCH v2] dts: fix runner target in the Dockerfile
Date: Mon, 16 Sep 2024 14:14:45 -0400	[thread overview]
Message-ID: <20240916181445.13997-1-jspewock@iol.unh.edu> (raw)
In-Reply-To: <20240911155058.11321-1-jspewock@iol.unh.edu>

From: Jeremy Spewock <jspewock@iol.unh.edu>

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 <jspewock@iol.unh.edu>
---
 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


  parent reply	other threads:[~2024-09-16 18:14 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-11 15:50 [PATCH v1] " jspewock
2024-09-11 15:52 ` Luca Vizzarro
2024-09-11 17:26   ` Patrick Robb
2024-09-16 10:16 ` Juraj Linkeš
2024-09-16 17:28   ` Jeremy Spewock
2024-09-16 18:14 ` jspewock [this message]
2024-09-17  9:50   ` [PATCH v2] " Luca Vizzarro
2024-09-17 15:22     ` Patrick Robb
2024-09-18  7:44       ` Juraj Linkeš
2024-09-18  7:57   ` Juraj Linkeš
2024-09-18 14:16     ` Jeremy Spewock
2024-09-19  7:09       ` Juraj Linkeš
2024-09-19 14:12         ` Jeremy Spewock
2024-09-19  9:36   ` Juraj Linkeš
2024-09-19 11:28     ` Juraj Linkeš
2024-09-19 14:24 ` [PATCH v3] " jspewock
2024-09-19 14:34   ` Luca Vizzarro
2024-09-19 14:35   ` Juraj Linkeš

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240916181445.13997-1-jspewock@iol.unh.edu \
    --to=jspewock@iol.unh.edu \
    --cc=Honnappa.Nagarahalli@arm.com \
    --cc=Luca.Vizzarro@arm.com \
    --cc=alex.chapman@arm.com \
    --cc=dev@dpdk.org \
    --cc=juraj.linkes@pantheon.tech \
    --cc=npratte@iol.unh.edu \
    --cc=paul.szczepanek@arm.com \
    --cc=probb@iol.unh.edu \
    --cc=thomas@monjalon.net \
    --cc=wathsala.vithanage@arm.com \
    --cc=yoan.picchi@foss.arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).