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 EE620459D7; Thu, 19 Sep 2024 16:24:49 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B37B6432C2; Thu, 19 Sep 2024 16:24:49 +0200 (CEST) Received: from mail-io1-f99.google.com (mail-io1-f99.google.com [209.85.166.99]) by mails.dpdk.org (Postfix) with ESMTP id 1748D406FF for ; Thu, 19 Sep 2024 16:24:49 +0200 (CEST) Received: by mail-io1-f99.google.com with SMTP id ca18e2360f4ac-82ce1cd202cso49048539f.0 for ; Thu, 19 Sep 2024 07:24:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1726755888; x=1727360688; darn=dpdk.org; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=VesMLyASHdq1Wd1viffqzruPm8HtrwQOU/gjGz2tENo=; b=d0lmR7LDgjGJvJjbo30Z0v/HIpyx9/C1kga107jMdHJ16cu6iwQuIM9zeXm7yXT6wk VgJAbW3AGUCGhHUlBbC60d9CVaq0MzqHza+/97gQMbeqLbkEOXi+vUAgc39KnSsgyisg u50XWbZTGrIhrRlNxWWeDHYd1aG/UyzbtR5HU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726755888; x=1727360688; h=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=VesMLyASHdq1Wd1viffqzruPm8HtrwQOU/gjGz2tENo=; b=BZPgzPJ7mgBGHWwDzrsuhMMQ7rxsLOYNUyDyVP0Z81994CbWPJAfPPCiB0peL6PM3X o4tSYvjWaUH9oiuBa9q5UqYaMi/0hZoQPHY/pxzMKUxfP/dB/cg0atPOlPk2k15qVBId nsFEbY4xoJ5Xmwhc0bHbd94BR1x9dEgAiN0ip82x6mlGwTGOc6zi/zBpFT8lbBfMtZw4 mbIsRgXbyWbS/rqPCw0bGqqcuwNMYKuhYwMRXD74X/oTH+KLYOXWPBJsH5nX35v2n7Mz d7vYLmQrDD/KwbBtsW3LS/brfl8yeSLod0YwMXyM4MXcDX7tXhZSk1C+VMiSbtNmZ3/3 lP5Q== X-Gm-Message-State: AOJu0YwC3qNYD+QHbjkCaInsS9cG87T1U40EWI/vcCVRk9Yo1fIGy1qz Bm8rjIqMKIzxwuuGFXLEEty2x0tdI8snGSBk1tAKwqLn4rEWCIO4EwtAE81/g8O4q5FOes+Wqro 6r953FjYcy4ohPxhwANDsDIUbfE7z6ZjepObS44EkthsxtYXJUdmIfjx13e8Di13aulZ133R1aE xGBEw= X-Google-Smtp-Source: AGHT+IHD8lmUei1XNIo74OqqZlvDsFhuqsJVZi1INxiBCMsdkrjpUiMPRCBEW8aagkqqx8bq3RC9TAKFDQ5G X-Received: by 2002:a05:6602:6d04:b0:82a:4e38:b47c with SMTP id ca18e2360f4ac-831830edce2mr863243939f.1.1726755888255; Thu, 19 Sep 2024 07:24:48 -0700 (PDT) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [132.177.123.84]) by smtp-relay.gmail.com with ESMTPS id 8926c6da1cb9f-4d37eb68effsm332644173.25.2024.09.19.07.24.48 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Sep 2024 07:24:48 -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 31D4D6050A6B; Thu, 19 Sep 2024 10:24:47 -0400 (EDT) From: jspewock@iol.unh.edu To: probb@iol.unh.edu, Luca.Vizzarro@arm.com, thomas@monjalon.net, yoan.picchi@foss.arm.com, Honnappa.Nagarahalli@arm.com, npratte@iol.unh.edu, alex.chapman@arm.com, paul.szczepanek@arm.com, juraj.linkes@pantheon.tech, wathsala.vithanage@arm.com Cc: dev@dpdk.org, Jeremy Spewock Subject: [PATCH v3] dts: fix runner target in the Dockerfile Date: Thu, 19 Sep 2024 10:24:38 -0400 Message-ID: <20240919142438.10192-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-Type: text/plain; charset="US-ASCII" 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 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 | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/dts/Dockerfile b/dts/Dockerfile index a81e46c41a..cb23faf3d4 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,14 @@ FROM base AS runner # It bakes DTS into the image during the build. COPY . /dpdk/dts -RUN poetry install --no-dev +# pipx installs packages in ~/.local/bin, which is not in PATH by default. The `pipx ensurepath` +# command used in the previous step adds said directory to PATH, but the docker build process does +# not preserve environment variables between steps. Therefore, ~/.local/bin must be manually added +# into PATH in order to use the poetry command below. +ENV PATH="$PATH:/root/.local/bin" +RUN poetry install --only main -CMD ["poetry", "run", "python", "main.py"] +ENTRYPOINT ["poetry", "run", "python", "main.py"] FROM base AS dev @@ -35,4 +43,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 -- *Let's Connect!* ... *October Webinars* Ask Us Anything: IOL Services Open Q&A Your questions. Our answers. Let's get started. Oct 3rd Live Tour of INTACT(R) for IPv6 Testing and Validation Open tour. Open Q&A. See why we think you'll love INTACT. Oct 9th How to Prep for Our NVMe(R) Plugfest #21 Checklists. Conversation. Let's get ready to plugin! Oct 15th ... * Newsletter* * * Get the IOL Connector for our latest news and event info. .