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 04E09A00C5 for ; Mon, 31 Oct 2022 15:16:27 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1156A41145; Mon, 31 Oct 2022 15:16:26 +0100 (CET) Received: from mail-io1-f98.google.com (mail-io1-f98.google.com [209.85.166.98]) by mails.dpdk.org (Postfix) with ESMTP id C507E40151 for ; Mon, 31 Oct 2022 15:16:24 +0100 (CET) Received: by mail-io1-f98.google.com with SMTP id p184so9813405iof.11 for ; Mon, 31 Oct 2022 07:16:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; 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=+E9dnKE90K+69bdkdRuG3Oavqfz5l7Qc1DWQ5fr5elg=; b=RX3kRzsk8lnsxt+GRKkJDYNms72g1be3BC2bU6Pn+FGeDXtfqqfW6lH3Im9eP/64+C qIuEKcvMptv+NEqLDM4S+2V5aYL+HFQoy8B7DYf08OHMKP/3aqFwRUJLdwsG1r2w9TI0 v6XyoKpv5UpkHJPA4css7zokILmtEkMy7y1Vg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=+E9dnKE90K+69bdkdRuG3Oavqfz5l7Qc1DWQ5fr5elg=; b=xxyZ3eKFB7StUcypsaZPqzRGpbHCRVMvK/9DYvVEauOtJCrJ79RvBi0CjOn9gVHFzy bcS/U78d5aK5RBtOVycV/69T07AMYLBvV/byZPGP2sLaOo38+riGbIuln+aOthokQCvT rW2ljPL0821+O4Pvxy7MUotvAY1ngOLJmSTan9CdoJ0bqx6mP6vE8ieMGqh7NhImd7V3 9IBYTITC84FFyynjfRaI+yZnPVZOEsLSq8SegnY8VwO5jkPtSTDIBwbhHkbKR/FqFSTD dHO4XL43rlci/OLt4PJhbaYk+1+NbZwwqKwchErpV+8/P9uBmbMlpkFTWl/noo433M8w 4JhA== X-Gm-Message-State: ACrzQf0rC27g1UYR/VmVCfhx/1kp+TyuXgrQa7Q8Li7i6aZ8dcoNozm7 fRXxPfBylaKBbBwrLkTlK+7qYC5RAagjY7KhvW04DB4eeY68CJSBx0/kX2DP/lm1iREYcR+7x8q Ehi8rfmGVXwmV0jzp9crBtAedmAHRXerTkqq6a+qz6rBBNSRS8H66/7LPKBzL5we7X7m/a0yd2E 9bNbluqLCwyMVQ X-Google-Smtp-Source: AMsMyM5YNvkNnbj5ZRxNZM7gI61+nWJnTnwxOLQICV0ywh7JPy1KXxMooGUlTh0rpz1qVTZ3Pu/1dkeGkGEP X-Received: by 2002:a05:6638:dd6:b0:363:f22b:e969 with SMTP id m22-20020a0566380dd600b00363f22be969mr7913003jaj.148.1667225784061; Mon, 31 Oct 2022 07:16:24 -0700 (PDT) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [2606:4100:3880:1234::84]) by smtp-relay.gmail.com with ESMTPS id i21-20020a056638381500b0036402460705sm350402jav.5.2022.10.31.07.16.23 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 31 Oct 2022 07:16:24 -0700 (PDT) X-Relaying-Domain: iol.unh.edu Received: from iol.unh.edu (unknown [IPv6:2606:4100:3880:1257::105d]) by postal.iol.unh.edu (Postfix) with ESMTP id 49B9D605C3FE; Mon, 31 Oct 2022 10:16:23 -0400 (EDT) From: ohilyard@iol.unh.edu To: ci@dpdk.org Cc: aconole@redhat.com, alialnu@nvidia.com, Owen Hilyard Subject: [PATCH v4 4/6] containers/templates: Templates for Dockerfiles Date: Mon, 31 Oct 2022 10:16:18 -0400 Message-Id: <20221031141620.54952-5-ohilyard@iol.unh.edu> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221031141620.54952-1-ohilyard@iol.unh.edu> References: <20221031141620.54952-1-ohilyard@iol.unh.edu> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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). Signed-off-by: Owen Hilyard --- .../templates/containers.makefile.j2 | 31 +++++++ .../templates/containers/alpine.dockerfile.j2 | 37 ++++++++ .../templates/containers/arch.dockerfile.j2 | 37 ++++++++ .../templates/containers/base.dockerfile.j2 | 85 +++++++++++++++++++ .../containers/centos8.dockerfile.j2 | 21 +++++ .../containers/centos9.dockerfile.j2 | 17 ++++ .../templates/containers/debian.dockerfile.j2 | 7 ++ .../containers/debian10.dockerfile.j2 | 3 + .../containers/debian11.dockerfile.j2 | 3 + .../containers/debian_bullseye.dockerfile.j2 | 3 + .../containers/debian_buster.dockerfile.j2 | 3 + .../templates/containers/fedora.dockerfile.j2 | 11 +++ .../containers/fedora36_clang.dockerfile.j2 | 7 ++ .../containers/opensuse.dockerfile.j2 | 10 +++ .../containers/redhat_family.dockerfile.j2 | 5 ++ .../templates/containers/rhel.dockerfile.j2 | 12 +++ .../templates/containers/rhel7.dockerfile.j2 | 19 +++++ .../templates/containers/rhel8.dockerfile.j2 | 19 +++++ .../templates/containers/rhel9.dockerfile.j2 | 25 ++++++ .../templates/containers/rpm.dockerfile.j2 | 3 + .../templates/containers/ubuntu.dockerfile.j2 | 3 + .../containers/ubuntu20.04.dockerfile.j2 | 12 +++ .../containers/ubuntu22.04.dockerfile.j2 | 7 ++ .../containers/ubuntu_cross.dockerfile.j2 | 11 +++ .../containers/ubuntu_sve.dockerfile.j2 | 10 +++ 25 files changed, 401 insertions(+) create mode 100644 containers/template_engine/templates/containers.makefile.j2 create mode 100644 containers/template_engine/templates/containers/alpine.dockerfile.j2 create mode 100644 containers/template_engine/templates/containers/arch.dockerfile.j2 create mode 100644 containers/template_engine/templates/containers/base.dockerfile.j2 create mode 100644 containers/template_engine/templates/containers/centos8.dockerfile.j2 create mode 100644 containers/template_engine/templates/containers/centos9.dockerfile.j2 create mode 100644 containers/template_engine/templates/containers/debian.dockerfile.j2 create mode 100644 containers/template_engine/templates/containers/debian10.dockerfile.j2 create mode 100644 containers/template_engine/templates/containers/debian11.dockerfile.j2 create mode 100644 containers/template_engine/templates/containers/debian_bullseye.dockerfile.j2 create mode 100644 containers/template_engine/templates/containers/debian_buster.dockerfile.j2 create mode 100644 containers/template_engine/templates/containers/fedora.dockerfile.j2 create mode 100644 containers/template_engine/templates/containers/fedora36_clang.dockerfile.j2 create mode 100644 containers/template_engine/templates/containers/opensuse.dockerfile.j2 create mode 100644 containers/template_engine/templates/containers/redhat_family.dockerfile.j2 create mode 100644 containers/template_engine/templates/containers/rhel.dockerfile.j2 create mode 100644 containers/template_engine/templates/containers/rhel7.dockerfile.j2 create mode 100644 containers/template_engine/templates/containers/rhel8.dockerfile.j2 create mode 100644 containers/template_engine/templates/containers/rhel9.dockerfile.j2 create mode 100644 containers/template_engine/templates/containers/rpm.dockerfile.j2 create mode 100644 containers/template_engine/templates/containers/ubuntu.dockerfile.j2 create mode 100644 containers/template_engine/templates/containers/ubuntu20.04.dockerfile.j2 create mode 100644 containers/template_engine/templates/containers/ubuntu22.04.dockerfile.j2 create mode 100644 containers/template_engine/templates/containers/ubuntu_cross.dockerfile.j2 create mode 100644 containers/template_engine/templates/containers/ubuntu_sve.dockerfile.j2 diff --git a/containers/template_engine/templates/containers.makefile.j2 b/containers/template_engine/templates/containers.makefile.j2 new file mode 100644 index 0000000..fb71044 --- /dev/null +++ b/containers/template_engine/templates/containers.makefile.j2 @@ -0,0 +1,31 @@ +{#- SPDX-License-Identifier: BSD-3-Clause -#} +{#- Copyright (c) 2022 University of New Hampshire -#} +#################### START VARS ################# +DPDK_CI_CONTAINER_BUILDER_PROGRAM?=podman +DPDK_CI_CONTAINERS_EXTRA_PUSH_ARGS?= +DPDK_CI_CONTAINERS_REGISTRY_HOSTNAME?={{ registry_hostname }} + +#################### END VARS ################# + +.PHONY: build_all +build_all:{% for container in dockerfiles.targets %} build_{{ container.name }}{% endfor %} + +.PHONY: push_all +push_all:{% for container in dockerfiles.targets %} push_{{ container.name }}{% endfor %} + +{% for container in dockerfiles.targets %} +#################### START {{ container.name }} ##################### + {% set container_id = container.name %} +.PHONY: build_{{ container_id }} +build_{{ container_id }}: + {% set base_tag = "%s/%s\:latest" | format(registry_hostname, container_id) -%} + $(DPDK_CI_CONTAINER_BUILDER_PROGRAM) build --target {{container.name}} --platform {{ container.platforms | join(',') }} {% for tag in container.tags -%}-t {{ tag | replace('$R', registry_hostname) | replace('$T', timestamp) | replace('$N', container.name) | replace(':', '\\:') }} {% endfor %} -f {{ container_id }}.dockerfile $(CURDIR) + +.PHONY: push_{{ container_id }} +push_{{ container_id }}: build_{{ container_id }} + {%- set base_tag = "%s/%s\:latest" | format(registry_hostname, container_id) -%} + {%- for tag in container.tags %} + $(DPDK_CI_CONTAINER_BUILDER_PROGRAM) push $(DPDK_CI_CONTAINERS_EXTRA_PUSH_ARGS) {{ base_tag }} docker\://{{ tag | replace('$R', registry_hostname) | replace('$T', timestamp) | replace('$N', container.name) | replace(':', '\\:') }} + {%- endfor %} +#################### END {{ container.name }} ##################### +{% endfor %} \ No newline at end of file diff --git a/containers/template_engine/templates/containers/alpine.dockerfile.j2 b/containers/template_engine/templates/containers/alpine.dockerfile.j2 new file mode 100644 index 0000000..ab21bed --- /dev/null +++ b/containers/template_engine/templates/containers/alpine.dockerfile.j2 @@ -0,0 +1,37 @@ +{#- SPDX-License-Identifier: BSD-3-Clause -#} +{#- Copyright (c) 2022 University of New Hampshire -#} +{% extends 'containers/base.dockerfile.j2' %} + +{% block pip_installs %} +RUN python3 -m pip install ninja pyelftools +{% endblock %} + +{% block install_libabigail %} +{% if build_libabigail %} +COPY libabigail /libabigail +# libabigail2.0 does not build on alpine, this commit does with the modification done in the next step. +RUN --mount=type=cache,target=/ccache cd libabigail && git checkout df28c220976f41620b0bd7b22000815e11f66b75 && sed -i 's/fts-standalone/libfts/g' ./configure.ac && mkdir build && autoreconf -i && cd build && ../configure --prefix=/usr/local && (make all install -j $(nproc) || echo 'failure expected') && (make install || echo 'failure expected') && cd / && rm -rf /libabigail +{% else %} +# libabigail build is disabled +{% endif %} +{% endblock install_libabigail %} + +{% block build_abi %} +{% for abi_version in abi.versions %} + {% if abi_version.major >= 22 %} +{% set abi_version_str = abi_version.git_tag %} +RUN echo '{{ abi_version_str }}' >> abi_versions +RUN mkdir {{ abi_version_str }} +# compile DPDK +RUN --mount=type=cache,target=/ccache \ + mkdir -p /dpdk/build && rm -rf /dpdk/build && cd /dpdk && git fetch --tags && git checkout tags/{{ abi_version_str }} && cd /references && \ + meson /dpdk /dpdk/build {% if "cross_file" in target -%} + --cross-file=/dpdk/{{ target.cross_file }} + {%- endif %} -Dexamples=all --buildtype=debugoptimized && DESTDIR={{ abi_folder }} ninja -C /dpdk/build install && \ + bash /dpdk/devtools/gen-abi.sh {{ abi_folder }} && mv {{ abi_folder }}/usr/local/include {{ abi_folder }} && \ + rm -rf {{ abi_folder }}/usr && rm -rf /dpdk/build + {% endif %} +{% endfor %} +RUN chmod -R 777 . +RUN rm -rf /dpdk +{% endblock build_abi %} \ No newline at end of file diff --git a/containers/template_engine/templates/containers/arch.dockerfile.j2 b/containers/template_engine/templates/containers/arch.dockerfile.j2 new file mode 100644 index 0000000..901607f --- /dev/null +++ b/containers/template_engine/templates/containers/arch.dockerfile.j2 @@ -0,0 +1,37 @@ +{#- SPDX-License-Identifier: BSD-3-Clause -#} +{#- Copyright (c) 2022 University of New Hampshire -#} +{% extends 'containers/base.dockerfile.j2' %} + +{% block pre_package_manager %} +RUN pacman-key --init +RUN pacman -Sy --noconfirm archlinux-keyring && pacman -Su --noconfirm +{% endblock %} + + +{% block pip_installs %} +RUN python3 -m pip install ninja pyelftools +{% endblock %} + +{% block before_meson_after_pip %} +# add user for building aur packages +RUN useradd builder && \ + mkdir /home/builder && \ + chown builder:builder /home/builder + +# switch user to make packages from aur +USER builder + +# clone and make rdma-core packages +RUN cd /home/builder && git clone https://aur.archlinux.org/rdma-core.git +RUN cd /home/builder/rdma-core && makepkg + +USER root + +RUN cd /home/builder/rdma-core && pacman --noconfirm -U rdma-core-*.pkg.tar.* + +RUN rm -rf /home/builder +{% endblock %} + +{% block install_libabigail %} +{# Installed via package manager #} +{% endblock install_libabigail %} \ No newline at end of file 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..5ffeeb1 --- /dev/null +++ b/containers/template_engine/templates/containers/base.dockerfile.j2 @@ -0,0 +1,85 @@ +{#- SPDX-License-Identifier: BSD-3-Clause -#} +{#- Copyright (c) 2022 University of New Hampshire -#} +# ------------------------ Begin {{ target.name }} ------------------------------------------------ + +FROM {{ target.base_image }} as {{ target.name }} + +ENV CCACHE_DIR=/ccache +RUN mkdir /ccache +{% 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 %} +COPY libabigail /libabigail +RUN --mount=type=cache,target=/ccache cd /libabigail && 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 /dpdk + +# 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 +RUN --mount=type=cache,target=/ccache cd /dpdk && chown -R root /dpdk && git checkout main && sh .ci/linux-setup.sh +{% endblock install_meson %} + +ENV RTE_KERNELDIR CHANGE_ME + +RUN mkdir /references +WORKDIR /references +RUN touch abi_versions +# build the abi +{% if build_abi %} + {% block build_abi %} + {% for abi_version in abi.versions %} + {%- set abi_version_str = abi_version.git_tag -%} + {%- set abi_folder = "/references/" + abi_version_str + "_reference" %} +RUN echo '{{ abi_version_str }}' >> abi_versions +RUN mkdir -p {{ abi_folder }} +# compile DPDK +RUN --mount=type=cache,target=/ccache \ + mkdir -p /dpdk/build && rm -rf /dpdk/build && cd /dpdk && git clean -xfd && git fetch --tags && git checkout tags/{{ abi_version_str }} && cd /references && \ + meson /dpdk /dpdk/build {% if "cross_file" in target -%} + --cross-file=/dpdk/{{ target.cross_file }} + {%- endif %} -Dexamples=all --buildtype=debugoptimized && DESTDIR={{ abi_folder }} ninja -C /dpdk/build install && \ + bash /dpdk/devtools/gen-abi.sh {{ abi_folder }} && mv {{ abi_folder }}/usr/local/include {{ abi_folder }} && \ + rm -rf {{ abi_folder }}/usr && rm -rf /dpdk/build + {% endfor %} +RUN rm -rf /dpdk +RUN chmod -R 777 . + {% endblock build_abi %} +{% else %} +{% endif %} + +# Embed extra target information into the container +{% if 'extra_information' in target %} +RUN echo '{{ target.extra_information | tojson }}' > /container_info.json +{% endif %} + +COPY ./scripts /scripts +WORKDIR / +# ------------------------ End {{ target.name }} ------------------------------------------------ + diff --git a/containers/template_engine/templates/containers/centos8.dockerfile.j2 b/containers/template_engine/templates/containers/centos8.dockerfile.j2 new file mode 100644 index 0000000..bda024a --- /dev/null +++ b/containers/template_engine/templates/containers/centos8.dockerfile.j2 @@ -0,0 +1,21 @@ +{#- SPDX-License-Identifier: BSD-3-Clause -#} +{#- Copyright (c) 2022 University of New Hampshire -#} +{% extends 'containers/redhat_family.dockerfile.j2' %} + +{% block pre_package_manager %} +# For ninja-build, meson, libmnl-devel, nasm, and CUnit-devel +RUN dnf install -y dnf-command\(config-manager\) dnf-plugins-core +# Install EPEL repository for ccache +RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm +# Enable powertools repository for libpcap-devel +RUN dnf config-manager --set-enabled powertools +{% endblock %} + +{% block pip_installs %} +RUN python3 -m pip install --upgrade pip +RUN python3 -m pip install pyelftools ninja +{% endblock %} + +{% block install_libabigail %} +{# Install via package manager #} +{% endblock install_libabigail %} \ No newline at end of file diff --git a/containers/template_engine/templates/containers/centos9.dockerfile.j2 b/containers/template_engine/templates/containers/centos9.dockerfile.j2 new file mode 100644 index 0000000..8cacb99 --- /dev/null +++ b/containers/template_engine/templates/containers/centos9.dockerfile.j2 @@ -0,0 +1,17 @@ +{#- SPDX-License-Identifier: BSD-3-Clause -#} +{#- Copyright (c) 2022 University of New Hampshire -#} +{% extends 'containers/redhat_family.dockerfile.j2' %} + +{% block pre_package_manager %} +# For ninja-build, meson, libmnl-devel, nasm, and CUnit-devel +RUN dnf install -y dnf-command\(config-manager\) dnf-plugins-core +# Install EPEL repository for ccache +RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm +# Enable powertools repository for libpcap-devel +RUN dnf config-manager --set-enabled crb +{% endblock %} + +{% block pip_installs %} +RUN python3 -m pip install --upgrade pip +RUN python3 -m pip install pyelftools ninja +{% endblock %} \ No newline at end of file diff --git a/containers/template_engine/templates/containers/debian.dockerfile.j2 b/containers/template_engine/templates/containers/debian.dockerfile.j2 new file mode 100644 index 0000000..74b56b6 --- /dev/null +++ b/containers/template_engine/templates/containers/debian.dockerfile.j2 @@ -0,0 +1,7 @@ +{#- SPDX-License-Identifier: BSD-3-Clause -#} +{#- Copyright (c) 2022 University of New Hampshire -#} +{% extends 'containers/base.dockerfile.j2' %} + +{% block pre_package_manager %} +ENV DEBIAN_FRONTEND=noninteractive +{% endblock %} \ No newline at end of file diff --git a/containers/template_engine/templates/containers/debian10.dockerfile.j2 b/containers/template_engine/templates/containers/debian10.dockerfile.j2 new file mode 100644 index 0000000..c52f866 --- /dev/null +++ b/containers/template_engine/templates/containers/debian10.dockerfile.j2 @@ -0,0 +1,3 @@ +{#- SPDX-License-Identifier: BSD-3-Clause -#} +{#- Copyright (c) 2022 University of New Hampshire -#} +{% extends 'containers/debian.dockerfile.j2' %} \ No newline at end of file diff --git a/containers/template_engine/templates/containers/debian11.dockerfile.j2 b/containers/template_engine/templates/containers/debian11.dockerfile.j2 new file mode 100644 index 0000000..0fd8a68 --- /dev/null +++ b/containers/template_engine/templates/containers/debian11.dockerfile.j2 @@ -0,0 +1,3 @@ +{#- SPDX-License-Identifier: BSD-3-Clause -#} +{#- Copyright (c) 2022 University of New Hampshire -#} +{% extends 'containers/debian.dockerfile.j2' %} diff --git a/containers/template_engine/templates/containers/debian_bullseye.dockerfile.j2 b/containers/template_engine/templates/containers/debian_bullseye.dockerfile.j2 new file mode 100644 index 0000000..0fd8a68 --- /dev/null +++ b/containers/template_engine/templates/containers/debian_bullseye.dockerfile.j2 @@ -0,0 +1,3 @@ +{#- SPDX-License-Identifier: BSD-3-Clause -#} +{#- Copyright (c) 2022 University of New Hampshire -#} +{% extends 'containers/debian.dockerfile.j2' %} diff --git a/containers/template_engine/templates/containers/debian_buster.dockerfile.j2 b/containers/template_engine/templates/containers/debian_buster.dockerfile.j2 new file mode 100644 index 0000000..c52f866 --- /dev/null +++ b/containers/template_engine/templates/containers/debian_buster.dockerfile.j2 @@ -0,0 +1,3 @@ +{#- SPDX-License-Identifier: BSD-3-Clause -#} +{#- Copyright (c) 2022 University of New Hampshire -#} +{% extends 'containers/debian.dockerfile.j2' %} \ No newline at end of file diff --git a/containers/template_engine/templates/containers/fedora.dockerfile.j2 b/containers/template_engine/templates/containers/fedora.dockerfile.j2 new file mode 100644 index 0000000..97e438e --- /dev/null +++ b/containers/template_engine/templates/containers/fedora.dockerfile.j2 @@ -0,0 +1,11 @@ +{#- SPDX-License-Identifier: BSD-3-Clause -#} +{#- Copyright (c) 2022 University of New Hampshire -#} +{% extends 'containers/redhat_family.dockerfile.j2' %} + +{%- block pip_installs -%} +RUN python3 -m pip install ninja +{%- endblock -%} + +{% block install_libabigail %} +# installed by package manager +{% endblock install_libabigail %} \ No newline at end of file diff --git a/containers/template_engine/templates/containers/fedora36_clang.dockerfile.j2 b/containers/template_engine/templates/containers/fedora36_clang.dockerfile.j2 new file mode 100644 index 0000000..bc104ba --- /dev/null +++ b/containers/template_engine/templates/containers/fedora36_clang.dockerfile.j2 @@ -0,0 +1,7 @@ +{#- SPDX-License-Identifier: BSD-3-Clause -#} +{#- Copyright (c) 2022 University of New Hampshire -#} +{% extends 'containers/fedora.dockerfile.j2' %} + +{% block extra_env_vars -%} +ENV CC=clang +{%- endblock extra_env_vars %} \ No newline at end of file diff --git a/containers/template_engine/templates/containers/opensuse.dockerfile.j2 b/containers/template_engine/templates/containers/opensuse.dockerfile.j2 new file mode 100644 index 0000000..48d2502 --- /dev/null +++ b/containers/template_engine/templates/containers/opensuse.dockerfile.j2 @@ -0,0 +1,10 @@ +{#- SPDX-License-Identifier: BSD-3-Clause -#} +{#- Copyright (c) 2022 University of New Hampshire -#} +{% extends 'containers/rpm.dockerfile.j2' %} + +{% block pip_installs %} +{% endblock %} + +{% block install_libabigail %} +{# Install via package manager #} +{% endblock install_libabigail %} \ No newline at end of file diff --git a/containers/template_engine/templates/containers/redhat_family.dockerfile.j2 b/containers/template_engine/templates/containers/redhat_family.dockerfile.j2 new file mode 100644 index 0000000..9ae6577 --- /dev/null +++ b/containers/template_engine/templates/containers/redhat_family.dockerfile.j2 @@ -0,0 +1,5 @@ +{#- SPDX-License-Identifier: BSD-3-Clause -#} +{#- Copyright (c) 2022 University of New Hampshire -#} +{% extends 'containers/rpm.dockerfile.j2' %} + +{# All of the distros in the Redhat Linux Lineage, ex: RHEL, Fedora, CentOS #} \ No newline at end of file diff --git a/containers/template_engine/templates/containers/rhel.dockerfile.j2 b/containers/template_engine/templates/containers/rhel.dockerfile.j2 new file mode 100644 index 0000000..a350e84 --- /dev/null +++ b/containers/template_engine/templates/containers/rhel.dockerfile.j2 @@ -0,0 +1,12 @@ +{#- SPDX-License-Identifier: BSD-3-Clause -#} +{#- Copyright (c) 2022 University of New Hampshire -#} +{% extends 'containers/redhat_family.dockerfile.j2' %} + +{% block pip_installs %} +RUN python3 -m pip install pyelftools +{% endblock %} + + +{% block before_meson_after_pip %} +RUN yum --disableplugin=subscription-manager clean all +{% endblock %} \ No newline at end of file diff --git a/containers/template_engine/templates/containers/rhel7.dockerfile.j2 b/containers/template_engine/templates/containers/rhel7.dockerfile.j2 new file mode 100644 index 0000000..ccfc0ec --- /dev/null +++ b/containers/template_engine/templates/containers/rhel7.dockerfile.j2 @@ -0,0 +1,19 @@ +{#- SPDX-License-Identifier: BSD-3-Clause -#} +{#- Copyright (c) 2022 University of New Hampshire -#} +{% extends 'containers/rhel.dockerfile.j2' %} + +{% block pre_package_manager %} +# repolist is needed to refresh the RHEL repos from the host this is being built on +RUN yum repolist +# Yes this next step is gross, there is no better way to enable the repos in the UBI containers. +RUN sed -i '/\[rhel-7-server-extras-rpms\]/,/^ *\[/ s/enabled\ =\ 0/enabled\ =\ 1/' /etc/yum.repos.d/redhat.repo \ + && sed -i '/\[rhel-7-server-optional-rpms\]/,/^ *\[/ s/enabled\ =\ 0/enabled\ =\ 1/' /etc/yum.repos.d/redhat.repo +RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm +RUN yum --disableplugin=subscription-manager update -y + +RUN yum groupinstall -y 'Development Tools' +{% endblock %} + +{% block install_libabigail %} +{# Install via package manager #} +{% endblock install_libabigail %} \ No newline at end of file diff --git a/containers/template_engine/templates/containers/rhel8.dockerfile.j2 b/containers/template_engine/templates/containers/rhel8.dockerfile.j2 new file mode 100644 index 0000000..dcaffc9 --- /dev/null +++ b/containers/template_engine/templates/containers/rhel8.dockerfile.j2 @@ -0,0 +1,19 @@ +{#- SPDX-License-Identifier: BSD-3-Clause -#} +{#- Copyright (c) 2022 University of New Hampshire -#} +{% extends 'containers/rhel.dockerfile.j2' %} + +{% block pre_package_manager %} +# repolist is needed to refresh the RHEL repos from the host this is being built on +RUN yum repolist +RUN yum --disableplugin=subscription-manager update -y +RUN yum --disableplugin=subscription-manager config-manager --set-enable codeready-builder-for-rhel-8-$(uname -i)-rpms + +# Required to install ccache +RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm && yum upgrade -y + +RUN yum groupinstall -y 'Development Tools' +{% endblock %} + +{% block install_libabigail %} +{# Install via package manager #} +{% endblock install_libabigail %} \ No newline at end of file diff --git a/containers/template_engine/templates/containers/rhel9.dockerfile.j2 b/containers/template_engine/templates/containers/rhel9.dockerfile.j2 new file mode 100644 index 0000000..8f0eccc --- /dev/null +++ b/containers/template_engine/templates/containers/rhel9.dockerfile.j2 @@ -0,0 +1,25 @@ +{#- SPDX-License-Identifier: BSD-3-Clause -#} +{#- Copyright (c) 2022 University of New Hampshire -#} +{% extends 'containers/rhel.dockerfile.j2' %} + +{% block pre_package_manager %} +# repolist is needed to refresh the RHEL repos from the host this is being built on +RUN yum repolist +RUN yum --disableplugin=subscription-manager config-manager --set-enable codeready-builder-for-rhel-9-$(uname -i)-rpms +RUN yum --disableplugin=subscription-manager update -y + +# Required to install ccache +RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm && yum upgrade -y + +RUN yum groupinstall -y 'Development Tools' +{% endblock %} + +{% block pip_installs %} +RUN python3 -m pip install pyelftools ninja +{% endblock %} + +{% block install_libabigail %} +COPY libabigail libabigail +RUN cd libabigail && mkdir build && autoreconf -i && cd build && ../configure --prefix=/usr/local && make all install && \ + ldconfig && cd .. && rm -rf libabigail +{% endblock install_libabigail %} \ No newline at end of file diff --git a/containers/template_engine/templates/containers/rpm.dockerfile.j2 b/containers/template_engine/templates/containers/rpm.dockerfile.j2 new file mode 100644 index 0000000..f386b42 --- /dev/null +++ b/containers/template_engine/templates/containers/rpm.dockerfile.j2 @@ -0,0 +1,3 @@ +{#- SPDX-License-Identifier: BSD-3-Clause -#} +{#- Copyright (c) 2022 University of New Hampshire -#} +{% extends 'containers/base.dockerfile.j2' %} \ No newline at end of file diff --git a/containers/template_engine/templates/containers/ubuntu.dockerfile.j2 b/containers/template_engine/templates/containers/ubuntu.dockerfile.j2 new file mode 100644 index 0000000..c52f866 --- /dev/null +++ b/containers/template_engine/templates/containers/ubuntu.dockerfile.j2 @@ -0,0 +1,3 @@ +{#- SPDX-License-Identifier: BSD-3-Clause -#} +{#- Copyright (c) 2022 University of New Hampshire -#} +{% extends 'containers/debian.dockerfile.j2' %} \ No newline at end of file diff --git a/containers/template_engine/templates/containers/ubuntu20.04.dockerfile.j2 b/containers/template_engine/templates/containers/ubuntu20.04.dockerfile.j2 new file mode 100644 index 0000000..59d2c28 --- /dev/null +++ b/containers/template_engine/templates/containers/ubuntu20.04.dockerfile.j2 @@ -0,0 +1,12 @@ +{#- SPDX-License-Identifier: BSD-3-Clause -#} +{#- Copyright (c) 2022 University of New Hampshire -#} +{% extends 'containers/ubuntu.dockerfile.j2' %} + +{% block pip_installs -%} +RUN python3 -m pip install --no-cache-dir requests +{%- endblock pip_installs %} + +{% block before_meson_after_pip -%} +ADD https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.6.2.2472-linux.zip / +ADD https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip / +{%- endblock %} \ No newline at end of file diff --git a/containers/template_engine/templates/containers/ubuntu22.04.dockerfile.j2 b/containers/template_engine/templates/containers/ubuntu22.04.dockerfile.j2 new file mode 100644 index 0000000..7a8b971 --- /dev/null +++ b/containers/template_engine/templates/containers/ubuntu22.04.dockerfile.j2 @@ -0,0 +1,7 @@ +{#- SPDX-License-Identifier: BSD-3-Clause -#} +{#- Copyright (c) 2022 University of New Hampshire -#} +{% extends 'containers/ubuntu.dockerfile.j2' %} + +{% block install_libabigail %} +# installed by package manager +{% endblock install_libabigail %} \ No newline at end of file diff --git a/containers/template_engine/templates/containers/ubuntu_cross.dockerfile.j2 b/containers/template_engine/templates/containers/ubuntu_cross.dockerfile.j2 new file mode 100644 index 0000000..236efbc --- /dev/null +++ b/containers/template_engine/templates/containers/ubuntu_cross.dockerfile.j2 @@ -0,0 +1,11 @@ +{#- SPDX-License-Identifier: BSD-3-Clause -#} +{#- Copyright (c) 2022 University of New Hampshire -#} +{% extends 'containers/ubuntu20.04.dockerfile.j2' %} + +{% block cross_compilation_setup %} +# Link ccache to different compilers + # aarch64 -> ccache +RUN ln -s $(which ccache) /usr/local/bin/aarch64-linux-gnu-gcc && \ + # aarch32 -> ccache + ln -s $(which ccache) /usr/local/bin/arm-linux-gnueabihf-gcc +{% endblock cross_compilation_setup %} \ No newline at end of file diff --git a/containers/template_engine/templates/containers/ubuntu_sve.dockerfile.j2 b/containers/template_engine/templates/containers/ubuntu_sve.dockerfile.j2 new file mode 100644 index 0000000..3c3e471 --- /dev/null +++ b/containers/template_engine/templates/containers/ubuntu_sve.dockerfile.j2 @@ -0,0 +1,10 @@ +{#- SPDX-License-Identifier: BSD-3-Clause -#} +{#- Copyright (c) 2022 University of New Hampshire -#} +{% extends 'containers/ubuntu20.04.dockerfile.j2' %} +{% block cross_compilation_setup %} +RUN ln -s $(which ccache) /usr/local/bin/gcc-10 +{% endblock cross_compilation_setup %} + +{% block build_abi %} +# ABI is disabled for this container +{% endblock build_abi %} \ No newline at end of file -- 2.34.1