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 1AF4442D26 for ; Thu, 22 Jun 2023 18:08:57 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1426742B71; Thu, 22 Jun 2023 18:08:57 +0200 (CEST) Received: from mail-yw1-f180.google.com (mail-yw1-f180.google.com [209.85.128.180]) by mails.dpdk.org (Postfix) with ESMTP id 3D71041611 for ; Thu, 22 Jun 2023 18:08:55 +0200 (CEST) Received: by mail-yw1-f180.google.com with SMTP id 00721157ae682-5704ddda6dfso80111947b3.1 for ; Thu, 22 Jun 2023 09:08:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1687450134; x=1690042134; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=WWVMQGfO+69FPZfpMJPFlmw5VqP8O9AdrigVa5TyJ3c=; b=RxnSqfJOlwDgnDv8K2qG9hkWU6ZdoE5eiQQhb2PZ/PnnHUcYncnqwnb4Tw2qUgmlzT zhep2uUBIZMBCkzdiNiFhpuWpb96EOcAW78MLnT2vPFabCr66ki9GOETg7L8efotB5WS wIK7u1tpehg8T0Qgyu9T5b/MenBo3Tg7tzzLY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687450134; x=1690042134; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=WWVMQGfO+69FPZfpMJPFlmw5VqP8O9AdrigVa5TyJ3c=; b=OziIn2A7GEAlWy4vS60bS4ydSlaN1mNqyCTZaR7FN5w59QSBXqEx984fw9XSeMge+5 d7KXpJyHn/B8pi4dpPunVuHY54nP5uco8UWIyD9lX4BTP/1gVVwo/aV+MJEsaomj+p9Z pXqYhCR44K+Yk6U4OkIHkD+Zxo+gOepsIIEXrQR+UFIYPqJSwSNupKY/+PkR8Euri4b+ +X9MKIEJECYbGrpslvB1czBLqL2xTOmm+yPW04ZfrNknTagAefKi+IQereofxSANWrKp KRKUEkrIaqEmkbyjOTLwIgQoQhOJPFciln1mCfO7+7ggQkvB/R2wQ+c6bqrnGAhXKrKH lbsA== X-Gm-Message-State: AC+VfDwdWJahLtIjvITvUlU8Do6wGpJ1HXDbO8xmZ3va/fTga5JqhX/W PEeKZMFk+BPUJchPWfHIx7ra2AMPCuCpb+zwcRXwpA== X-Google-Smtp-Source: ACHHUZ7FwnFGOBUgIpjqWwGwVHndW+JDLnprThMCIUCoNOEmdO6kJzpFA3jYRXNCUiJlnGeRJqwUBLJl0WMdf55wSqk= X-Received: by 2002:a81:c24b:0:b0:569:5f72:4d4 with SMTP id t11-20020a81c24b000000b005695f7204d4mr24460844ywg.4.1687450134604; Thu, 22 Jun 2023 09:08:54 -0700 (PDT) MIME-Version: 1.0 References: <20230525171505.1276457-1-ahassick@iol.unh.edu> <20230525171505.1276457-5-ahassick@iol.unh.edu> In-Reply-To: From: Adam Hassick Date: Thu, 22 Jun 2023 12:08:43 -0400 Message-ID: Subject: Re: [PATCH v6 4/6] containers/templates: Templates for Dockerfiles To: Ali Alnubani Cc: "ci@dpdk.org" , "aconole@redhat.com" , Owen Hilyard Content-Type: multipart/alternative; boundary="000000000000d9860d05feba19ea" X-BeenThere: ci@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK CI discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ci-bounces@dpdk.org --000000000000d9860d05feba19ea Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable The Z/z mount option tells podman how to handle SELinux labels on the host system. In this case, the ccache mount is meant to be shared across containers, so we use the lowercase z flag. This is the "shared" mode, which lets all containers access the files. It's explained in the Podman docs here: https://docs.podman.io/en/latest/markdown/podman-run.1.html#volume-v-source= -volume-host-dir-container-dir-options On Thu, Jun 22, 2023 at 11:40=E2=80=AFAM Ali Alnubani = wrote: > > -----Original Message----- > > From: Adam Hassick > > Sent: Thursday, May 25, 2023 8:15 PM > > To: ci@dpdk.org > > Cc: aconole@redhat.com; Ali Alnubani ; Owen Hilyard > > ; Adam Hassick > > Subject: [PATCH v6 4/6] containers/templates: Templates for Dockerfiles > > > > From: Owen Hilyard > > > > Adds a variety of extensible templates used to create the Dockerfiles > > for each target. All templates inherit from base, and most distros and > > distro families have their own templates that are used to define common > > functionality. Multiple versions of a distro may use a single template > > if they are similar enough (ex: fedora). > > > > [..] > > > diff --git > > a/containers/template_engine/templates/containers/base.dockerfile.j2 > > b/containers/template_engine/templates/containers/base.dockerfile.j2 > > new file mode 100644 > > index 0000000..92f5cb5 > > --- /dev/null > > +++ b/containers/template_engine/templates/containers/base.dockerfile.j= 2 > > @@ -0,0 +1,120 @@ > > +{#- SPDX-License-Identifier: BSD-3-Clause -#} > > +{#- Copyright (c) 2022 University of New Hampshire -#} > > +# ------------------------ Begin {{ target.name }} > -------------------------------------- > > ---------- > > + > > +{%- set build_base_img =3D target.name + "_base" %} > > +FROM {{ target.base_image }} as {% if build_abi and not > > target.force_disable_abi -%} > > +{{ build_base_img }} > > +{%- else -%} > > +{{ target.name }} > > +{%- endif %} > > + > > +ENV CCACHE_DIR=3D/ccache/ > > +ENV CCACHE_COMPILERCHECK=3Dcontent > > +ENV CCACHE_NAMESPACE=3D"{{ target.name }}-{{ build_timestamp }}" > > +ENV BUILD_TIMESTAMP=3D"{{ build_timestamp }}" > > + > > +{% block extra_env_vars -%}{%- endblock extra_env_vars %} > > + > > +{% block pre_package_manager -%}{%- endblock pre_package_manager %} > > + > > +# Install packages > > +RUN {{ target.package_manager_command }} {{ target.packages | join(" "= ) > }} > > + > > +# Installs from pip > > +{% block pip_installs -%}{%- endblock pip_installs %} > > + > > +# Extra setup after python libs are installed > > +{% block before_meson_after_pip -%}{%- endblock %} > > + > > +# install libabigail > > +{% block install_libabigail %} > > +{% if build_libabigail and build_abi and (not "force_disable_abi" in > target or > > not target.force_disable_abi) %} > > +COPY libabigail /libabigail > > +RUN --mount=3Dtype=3Dcache,target=3D/ccache,z cd /libabigail > > +{%- if "libabigail_revision" in target %} && git checkout {{ > > target.libabigail_revision }} {%- endif %} && mkdir build && autoreconf > -i && > > cd build && ../configure --prefix=3D/usr/local && make all install && \ > > + ldconfig && cd / && rm -rf /libabigail > > +{% else %} > > +# libabigail build is disabled > > +{% endif %} > > +{% endblock install_libabigail %} > > + > > +# cross compilation setup > > +{% block cross_compilation_setup %} > > +{% endblock cross_compilation_setup %} > > + > > +# Copy externally pulled DPDK into the container > > +RUN mkdir /dpdk > > +COPY dpdk-stable /dpdk-stable > > + > > +# Install meson > > +{% block install_meson %} > > +# Install meson from dpdk main > > +# Writes to the mount are discarded once the container is built and is > not > > shared with other containers or the host > > +COPY dpdk /dpdk > > +RUN --mount=3Dtype=3Dcache,target=3D/ccache,z cd /dpdk && chown -R roo= t > > /dpdk && git checkout main && sh .ci/linux-setup.sh > > What is the 'z' mount option? I can't find it in podman's mount command > documentation: > https://docs.podman.io/en/latest/markdown/options/mount.html > --=20 *Adam Hassick* Senior Developer UNH InterOperability Lab ahassick@iol.unh.edu iol.unh.edu +1 (603) 475-8248 --000000000000d9860d05feba19ea Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
The Z/z mount option tells podman how to handle SELin= ux labels on the host system. In this case, the ccache mount is meant to be= shared across containers, so we use the lowercase z flag. This is the &quo= t;shared" mode, which lets all containers access the files.

It&= #39;s explained in the Podman docs here: https://docs.podman.io/en/latest/markdown/podman-run.1.htm= l#volume-v-source-volume-host-dir-container-dir-options
<= br>

On Thu, Jun 22, 2023 at 11:40=E2=80=AFAM Ali Alnubani <alialnu@nvidia.com> wrote:
<= blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l= eft:1px solid rgb(204,204,204);padding-left:1ex">> -----Original Message= -----
> From: Adam Hassick <ahassick@iol.unh.edu>
> Sent: Thursday, May 25, 2023 8:15 PM
> To: ci@dpdk.org > Cc: aconole@re= dhat.com; Ali Alnubani <alialnu@nvidia.com>; Owen Hilyard
> <ohilyard= @iol.unh.edu>; Adam Hassick <ahassick@iol.unh.edu>
> Subject: [PATCH v6 4/6] containers/templates: Templates for Dockerfile= s
>
> From: Owen Hilyard <ohilyard@iol.unh.edu>
>
> Adds a variety of extensible templates used to create the Dockerfiles<= br> > for each target. All templates inherit from base, and most distros and=
> distro families have their own templates that are used to define commo= n
> functionality. Multiple versions of a distro may use a single template=
> if they are similar enough (ex: fedora).
>

[..]

> diff --git
> a/containers/template_engine/templates/containers/base.dockerfile.j2 > b/containers/template_engine/templates/containers/base.dockerfile.j2 > new file mode 100644
> index 0000000..92f5cb5
> --- /dev/null
> +++ b/containers/template_engine/templates/containers/base.dockerfile.= j2
> @@ -0,0 +1,120 @@
> +{#- SPDX-License-Identifier: BSD-3-Clause -#}
> +{#- Copyright (c) 2022 University of New Hampshire -#}
> +# ------------------------ Begin {{ target.name }} ---------------------= -----------------
> ----------
> +
> +{%- set build_base_img =3D target.name + "_base" %}
> +FROM {{ target.base_image }} as {% if build_abi and not
> target.force_disable_abi -%}
> +{{ build_base_img }}
> +{%- else -%}
> +{{ target.name }}
> +{%- endif %}
> +
> +ENV CCACHE_DIR=3D/ccache/
> +ENV CCACHE_COMPILERCHECK=3Dcontent
> +ENV CCACHE_NAMESPACE=3D"{{ target.name }}-{{ build_timestamp }}&quo= t;
> +ENV BUILD_TIMESTAMP=3D"{{ build_timestamp }}"
> +
> +{% block extra_env_vars -%}{%- endblock extra_env_vars %}
> +
> +{% block pre_package_manager -%}{%- endblock pre_package_manager %} > +
> +# Install packages
> +RUN {{ target.package_manager_command }} {{ target.packages | join(&q= uot; ") }}
> +
> +# Installs from pip
> +{% block pip_installs -%}{%- endblock pip_installs %}
> +
> +# Extra setup after python libs are installed
> +{% block before_meson_after_pip -%}{%- endblock %}
> +
> +# install libabigail
> +{% block install_libabigail %}
> +{% if build_libabigail and build_abi and (not "force_disable_abi= " in target or
> not target.force_disable_abi) %}
> +COPY libabigail /libabigail
> +RUN --mount=3Dtype=3Dcache,target=3D/ccache,z cd /libabigail
> +{%- if "libabigail_revision" in target %} && git ch= eckout {{
> target.libabigail_revision }} {%- endif %} && mkdir build &= ;& autoreconf -i &&
> cd build && ../configure --prefix=3D/usr/local && make= all install && \
> +=C2=A0 =C2=A0 ldconfig && cd / && rm -rf /libabigail<= br> > +{% else %}
> +#=C2=A0 =C2=A0libabigail build is disabled
> +{% endif %}
> +{% endblock install_libabigail %}
> +
> +# cross compilation setup
> +{% block cross_compilation_setup %}
> +{% endblock cross_compilation_setup %}
> +
> +# Copy externally pulled DPDK into the container
> +RUN mkdir /dpdk
> +COPY dpdk-stable /dpdk-stable
> +
> +# Install meson
> +{% block install_meson %}
> +# Install meson from dpdk main
> +# Writes to the mount are discarded once the container is built and i= s not
> shared with other containers or the host
> +COPY dpdk /dpdk
> +RUN --mount=3Dtype=3Dcache,target=3D/ccache,z cd /dpdk && cho= wn -R root
> /dpdk && git checkout main && sh .ci/linux-setup.sh
What is the 'z' mount option? I can't find it in podman's m= ount command documentation:
https://docs.podman.io/en/latest/markdow= n/options/mount.html


--
Adam Hassick
Senior Developer
UNH InterOperability Lab
+1 (603) 475-8248
--000000000000d9860d05feba19ea--