Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions agent/config/firewalld/pbench-dcgm-exporter.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<service>
<short>pbench-dcgm-exporter</short>
<description>Pbench Agent Prometheus dcgm-exporter</description>
<port protocol="tcp" port="9400"/>
</service>

6 changes: 3 additions & 3 deletions agent/config/firewalld/pbench-redis.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<service>
<short>pbench-tool-data-sink</short>
<description>Pbench Agent Tool Data Sink</description>
<port protocol="tcp" port="8080"/>
<short>pbench-redis</short>
<description>Pbench Agent Redis Server</description>
<port protocol="tcp" port="17001"/>
</service>
6 changes: 3 additions & 3 deletions agent/config/firewalld/pbench-tool-data-sink.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<service>
<short>pbench-redis</short>
<description>Pbench Agent Redis Server</description>
<port protocol="tcp" port="17001"/>
<short>pbench-tool-data-sink</short>
<description>Pbench Agent Tool Data Sink</description>
<port protocol="tcp" port="8080"/>
</service>
4 changes: 2 additions & 2 deletions agent/containers/images/Dockerfile.base.j2
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ RUN \
{{ pkgmgr }} module -y disable python38 && \
{% endif %}
{% if distro_image.startswith('centos') %}
{{ pkgmgr }} install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ distro_image.split(':', 1)[1] }}.noarch.rpm && \
{{ pkgmgr }} install -y --setopt=tsflags=nodocs https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ distro_image.split(':', 1)[1] }}.noarch.rpm && \
{% endif %}
{{ pkgmgr }} install -y {% if distro_image == 'centos:8' %}--enablerepo powertools glibc-locale-source {% endif %} pbench-agent && \
{{ pkgmgr }} install -y --setopt=tsflags=nodocs {% if distro_image == 'centos:8' %}--enablerepo powertools glibc-locale-source {% endif %} pbench-agent && \
{% if distro_image == 'centos:8' %}
localedef -i en_US -f UTF-8 en_US.UTF-8 && \
{% endif %}
Expand Down
15 changes: 15 additions & 0 deletions agent/containers/images/Dockerfile.dcgmEX.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# NOTE: Must be run with --privileged
# RECOMMENDED: Use with the fedora image variants for direct compatibility
FROM pbench-agent-tool-meister-{{ distro }}:{{ tag }}

RUN {% if distro == 'centos-7' %}yum{% else %}dnf{% endif %} install -y 'dnf-command(config-manager)' && \
{% if distro == 'centos-7' %}yum{% else %}dnf{% endif %} config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/{{ distro.split("-")|join("") }}/x86_64/cuda-{{ distro.split("-")|join("") }}.repo && \
{% if distro == 'centos-7' %}yum{% else %}dnf{% endif %} clean expire-cache && \
{% if distro == 'centos-7' %}yum{% else %}dnf{% endif %} install -y nvidia-driver-cuda nvidia-modprobe datacenter-gpu-manager-2.1.4 golang && \
git clone https://github.com/NVIDIA/gpu-monitoring-tools.git && \
(cd gpu-monitoring-tools; git checkout tags/2.1.2 -b build; make binary install) && \
{% if distro == 'centos-7' %}yum{% else %}dnf{% endif %} -y clean all && \
rm -rf /var/cache/{% if distro == 'centos-7' %}yum{% else %}dnf{% endif %}

ENV NVIDIA_DISABLE_REQUIRE="true" \
NVIDIA_VISIBLE_DEVICES=all
6 changes: 5 additions & 1 deletion agent/containers/images/Dockerfile.layered.j2
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
# {{ distro }} pbench-agent {{ kind }} image
FROM pbench-agent-base-{{ distro }}:{{ tag }}

{% if kind in ('tools', 'all') %}
COPY ./{{ distro }}-pcp.repo /etc/yum.repos.d/pcp.repo
{% endif %}

# Install all the RPMs required for this image.
#
# FIXME: this is not exhaustive, it does not include RPMs to support
# Kubernetes or RHV environments.
RUN {% if distro == 'centos-7' %}yum{% else %}dnf{% endif %} install -y {% if distro == 'centos-8' %}--enablerepo powertools {% endif %}{{ rpms }} && \
RUN {% if distro == 'centos-7' %}yum{% else %}dnf{% endif %} install -y --setopt=tsflags=nodocs {% if distro == 'centos-8' %}--enablerepo powertools {% endif %}{% if kind in ('tools', 'all') %}--enablerepo pcp {% endif %}{{ rpms }} && \
{% if distro == 'centos-7' %}yum{% else %}dnf{% endif %} -y clean all && \
rm -rf /var/cache/{% if distro == 'centos-7' %}yum{% else %}dnf{% endif %}
9 changes: 9 additions & 0 deletions agent/containers/images/Dockerfile.tds.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# {{ distro }} pbench-agent-tool-data-sink image
FROM pbench-agent-tools-{{ distro }}:{{ tag }}

VOLUME /var/lib/pbench-agent

# Port 8080 should be Bottle server, 9090 optional Prometheus server, and 44566
# the optional pmproxy server.
EXPOSE 8080 9090 44566
ENTRYPOINT [ "/opt/pbench-agent/util-scripts/tool-meister/tool-data-sink-ep" ]
7 changes: 7 additions & 0 deletions agent/containers/images/Dockerfile.tm.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# {{ distro }} pbench-agent-tool-meister image
FROM pbench-agent-tools-{{ distro }}:{{ tag }}

# Port 9400 should be the optional dcgm tool, 9100 the optional node_exporter
# tool, and 55677 the pcp (pmcd) tool.
EXPOSE 9100 9400 55677
ENTRYPOINT [ "/opt/pbench-agent/util-scripts/tool-meister/tool-meister-ep" ]
110 changes: 100 additions & 10 deletions agent/containers/images/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,43 @@ IMAGE_REPO = docker://quay.io/pbench
# Not intended to be overridden with an environment variable.
_REPO_TEMPLATE = ../../ansible/pbench/agent/roles/pbench_repo_install/templates/etc/yum.repos.d/pbench.repo.j2

# NOTE: Currently we require 5.2.2 of the PCP RPMs because using the 5.2.3
# version prevents us from integrating with Grafana, see PCP Issue #1183,
# https://github.com/performancecopilot/pcp/issues/1183.
# NOTE: We also have to enumerate so many RPMs because for CentOS 7 the RPM
# dependency resolver does not properly resolve to the same version RPMs. Once
# we no longer have to use v5.2.2, we can just list 3 RPMs: pcp-zeroconf,
# pcp-system-tools, and pcp-gui.
_PCP_RPMS = \
pcp-doc-5.2.2 \
pcp-gui-5.2.2 \
pcp-pmda-dm-5.2.2 \
pcp-pmda-nfsclient-5.2.2 \
pcp-pmda-openmetrics-5.2.2 \
pcp-system-tools-5.2.2 \
pcp-zeroconf-5.2.2 \
python3-pcp-5.2.2
# The list of RPMs which provide the various tools we offer.
# Not intended to be overridden with an environment variable.
_TOOL_RPMS = prometheus2 node_exporter blktrace bpftrace cpupowerutils golang kernel-tools libvirt-client nmap-ncat numactl pbench-sysstat pcp-system-tools perf procps-ng strace tcpdump trace-cmd
# Please keep the lists sorted.
_TOOL_RPMS = \
blktrace \
bpftrace \
cpupowerutils \
golang \
kernel-tools \
libvirt-client \
nmap-ncat \
node_exporter \
numactl \
pbench-sysstat \
${_PCP_RPMS} \
perf \
procps-ng \
prometheus2 \
strace \
tcpdump \
trace-cmd

# The list of RPMs for the default workloads we offer.
# Not intended to be overridden with an environment variable.
Expand All @@ -41,8 +75,38 @@ _ALL_RPMS = ${_TOOL_RPMS} ${_WORKLOAD_RPMS}
# By default we only build images for the following distributions:
_DISTROS = centos-8 centos-7 fedora-33 fedora-32

# By default we won't build the Tool Data Sink and Tool Meister images
all: all-tags $(foreach distro, ${_DISTROS}, ${distro}-all-tagged)

tds: all-tags $(foreach distro, ${_DISTROS}, ${distro}-tool-data-sink-tagged)

tm: all-tags $(foreach distro, ${_DISTROS}, ${distro}-tool-meister-tagged)

# We also offer targets per distribution target
centos-8: all-tags centos-8-all-tagged

centos-7: all-tags centos-7-all-tagged

fedora-33: all-tags fedora-33-all-tagged

fedora-32: all-tags fedora-32-all-tagged

centos-8-tds: all-tags centos-8-tool-data-sink-tagged

centos-7-tds: all-tags centos-7-tool-data-sink-tagged

fedora-33-tds: all-tags fedora-33-tool-data-sink-tagged

fedora-32-tds: all-tags fedora-32-tool-data-sink-tagged

centos-8-tm: all-tags centos-8-tool-meister-tagged

centos-7-tm: all-tags centos-7-tool-meister-tagged

fedora-33-tm: all-tags fedora-33-tool-meister-tagged

fedora-32-tm: all-tags fedora-32-tool-meister-tagged

#+
# Tagging targets
#-
Expand Down Expand Up @@ -97,16 +161,34 @@ push-major-minor: $(foreach distro, ${_DISTROS}, ${distro}-push-major-minor)
%-all-tagged: %-all %-tags.lis
./apply-tags pbench-agent-all-$* $*-tags.lis

%-all: %-tools-tagged %-workloads-tagged %-all.Dockerfile
%-all: %-workloads-tagged %-tool-data-sink-tagged %-tool-meister-tagged %-all.Dockerfile
./build-image all $* $*-tags.lis

%-all.Dockerfile: Dockerfile.layered.j2 %-tags.lis
jinja2 Dockerfile.layered.j2 -D distro=$* -D tag="$$(grep -v -E '^v' $*-tags.lis)" -D kind="all" -D rpms="${_ALL_RPMS}" > ./$@

%-tool-data-sink-tagged: %-tool-data-sink %-tags.lis
./apply-tags pbench-agent-tool-data-sink-$* $*-tags.lis

%-tool-data-sink: %-tools-tagged %-tool-data-sink.Dockerfile
./build-image tool-data-sink $* $*-tags.lis

%-tool-data-sink.Dockerfile: Dockerfile.tds.j2 %-tags.lis
jinja2 Dockerfile.tds.j2 -D distro=$* -D tag="$$(grep -v -E '^v' $*-tags.lis)" > ./$@

%-tool-meister-tagged: %-tool-meister %-tags.lis
./apply-tags pbench-agent-tool-meister-$* $*-tags.lis

%-tool-meister: %-tools-tagged %-tool-meister.Dockerfile
./build-image tool-meister $* $*-tags.lis

%-tool-meister.Dockerfile: Dockerfile.tm.j2 %-tags.lis
jinja2 Dockerfile.tm.j2 -D distro=$* -D tag="$$(grep -v -E '^v' $*-tags.lis)" > ./$@

%-tools-tagged: %-tools %-tags.lis
./apply-tags pbench-agent-tools-$* $*-tags.lis

%-tools: %-base-tagged %-tools.Dockerfile
%-tools: %-base-tagged %-tools.Dockerfile %-pcp.repo
./build-image tools $* $*-tags.lis

%-tools.Dockerfile: Dockerfile.layered.j2 %-tags.lis
Expand Down Expand Up @@ -204,15 +286,23 @@ fedora-32-base.Dockerfile: Dockerfile.base.j2 fedora-32-pbench.repo
# Helper target to build each distro's ".repo" and ".Dockerfile"
all-dockerfiles: $(foreach distro, ${_DISTROS}, ${distro}-base.Dockerfile ${distro}-tools.Dockerfile ${distro}-workloads.Dockerfile ${distro}-all.Dockerfile)

# Rule pattern dependencies on non-patterned targets have to be set up
# separately for some reason.
%.repo: ${_REPO_TEMPLATE}
%-pbench.repo: %-pbench.yml ${_REPO_TEMPLATE}
jinja2 ${_REPO_TEMPLATE} $*-pbench.yml -o $@

%-pbench.yml: repo.yml.j2
jinja2 repo.yml.j2 -D distro=$* -D url_prefix=${URL_PREFIX} -D test_suffix=${_TEST_SUFFIX} -D user=${USER} -o $@

fedora-33-pcp.repo: pcp.repo.j2
jinja2 pcp.repo.j2 -D target=f33 -o $@

fedora-32-pcp.repo: pcp.repo.j2
jinja2 pcp.repo.j2 -D target=f32 -o $@

%.repo: %.yml
jinja2 ${_REPO_TEMPLATE} $*.yml -o $@
centos-8-pcp.repo: pcp.repo.j2
jinja2 pcp.repo.j2 -D target=el8 -o $@

%.yml: repo.yml.j2
jinja2 repo.yml.j2 -D distro=${@:-pbench.yml=} -D url_prefix=${URL_PREFIX} -D test_suffix=${_TEST_SUFFIX} -D user=${USER} -o $@
centos-7-pcp.repo: pcp.repo.j2
jinja2 pcp.repo.j2 -D target=el7 -o $@

clean:
rm -f *.Dockerfile *.repo *.yml *-tags.lis
16 changes: 0 additions & 16 deletions agent/containers/images/pcp-pmcd/Dockerfile

This file was deleted.

30 changes: 0 additions & 30 deletions agent/containers/images/pcp-pmcd/config

This file was deleted.

14 changes: 0 additions & 14 deletions agent/containers/images/pcp-pmlogger/Dockerfile

This file was deleted.

6 changes: 6 additions & 0 deletions agent/containers/images/pcp.repo.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[pcp]
name=pcp
baseurl=https://dl.bintray.com/pcp/{{ target }}
gpgcheck=0
repo_gpgcheck=0
enabled=1
2 changes: 1 addition & 1 deletion agent/containers/images/push
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function pushit {
buildah push ${1} ${image_repo}/${1}
}

for image in base tools workloads all; do
for image in base tools tool-meister tool-data-sink workloads all; do
pushit pbench-agent-${image}-${distro}:${githash}
pushit pbench-agent-${image}-${distro}:${ver}
if [[ ! -z "${other}" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion agent/containers/images/tagit
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ function tagit {
buildah tag ${1}:${githash} ${1}:${tag}
}

for image in base tools workloads all; do
for image in base tools tool-meister tool-data-sink workloads all; do
tagit pbench-agent-${image}-${distro}
done
Loading