DPDK CI discussions
 help / color / mirror / Atom feed
From: Adam Hassick <ahassick@iol.unh.edu>
To: Ali Alnubani <alialnu@nvidia.com>
Cc: "ci@dpdk.org" <ci@dpdk.org>,
	"aconole@redhat.com" <aconole@redhat.com>,
	Owen Hilyard <ohilyard@iol.unh.edu>
Subject: Re: [PATCH v6 4/6] containers/templates: Templates for Dockerfiles
Date: Thu, 22 Jun 2023 12:08:43 -0400	[thread overview]
Message-ID: <CAC-YWqjs2OoOjNh0DWOyX_3S7kk6fBhYFwvKm5FKU6_EGNH0FA@mail.gmail.com> (raw)
In-Reply-To: <DM4PR12MB516786462D2F726FA55576ABDA22A@DM4PR12MB5167.namprd12.prod.outlook.com>

[-- Attachment #1: Type: text/plain, Size: 4397 bytes --]

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 AM Ali Alnubani <alialnu@nvidia.com> wrote:

> > -----Original Message-----
> > From: Adam Hassick <ahassick@iol.unh.edu>
> > Sent: Thursday, May 25, 2023 8:15 PM
> > To: ci@dpdk.org
> > Cc: aconole@redhat.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 Dockerfiles
> >
> > From: Owen Hilyard <ohilyard@iol.unh.edu>
> >
> > 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.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 = 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=/ccache/
> > +ENV CCACHE_COMPILERCHECK=content
> > +ENV CCACHE_NAMESPACE="{{ target.name }}-{{ build_timestamp }}"
> > +ENV BUILD_TIMESTAMP="{{ 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=type=cache,target=/ccache,z cd /libabigail
> > +{%- if "libabigail_revision" in target %} && git checkout {{
> > target.libabigail_revision }} {%- endif %} && mkdir build && autoreconf
> -i &&
> > cd build && ../configure --prefix=/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=type=cache,target=/ccache,z cd /dpdk && chown -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 mount command
> documentation:
> https://docs.podman.io/en/latest/markdown/options/mount.html
>


-- 
*Adam Hassick*
Senior Developer
UNH InterOperability Lab
ahassick@iol.unh.edu
iol.unh.edu <https://www.iol.unh.edu/>
+1 (603) 475-8248

[-- Attachment #2: Type: text/html, Size: 6988 bytes --]

  reply	other threads:[~2023-06-22 16:08 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-25 17:14 [PATCH v6 0/6] Community Lab Containers and Builder Engine Adam Hassick
2023-05-25 17:15 ` [PATCH v6 1/6] containers/docs: Add container builder start Adam Hassick
2023-05-25 17:15 ` [PATCH v6 2/6] containers/inventory: Add inventory for container builder Adam Hassick
2023-05-25 17:15 ` [PATCH v6 3/6] containers/builder: Dockerfile creation script Adam Hassick
2023-06-22 15:55   ` Ali Alnubani
2023-06-22 16:18     ` Adam Hassick
2023-06-22 16:52       ` Ali Alnubani
2023-05-25 17:15 ` [PATCH v6 4/6] containers/templates: Templates for Dockerfiles Adam Hassick
2023-06-22 15:40   ` Ali Alnubani
2023-06-22 16:08     ` Adam Hassick [this message]
2023-06-22 16:51       ` Ali Alnubani
2023-05-25 17:15 ` [PATCH v6 5/6] containers/container_builder: Container for python scripts Adam Hassick
2023-05-25 17:15 ` [PATCH v6 6/6] containers/Makefile: Makefile to automate builds Adam Hassick
2023-06-22 15:29 ` [PATCH v6 0/6] Community Lab Containers and Builder Engine Ali Alnubani
2023-06-22 19:28   ` Adam Hassick
2023-06-23 14:11     ` Aaron Conole

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=CAC-YWqjs2OoOjNh0DWOyX_3S7kk6fBhYFwvKm5FKU6_EGNH0FA@mail.gmail.com \
    --to=ahassick@iol.unh.edu \
    --cc=aconole@redhat.com \
    --cc=alialnu@nvidia.com \
    --cc=ci@dpdk.org \
    --cc=ohilyard@iol.unh.edu \
    /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).