Skip to content

Commit 0a9d5ea

Browse files
webbnhportante
authored andcommitted
Tweak container builds for CentOS 9
1 parent 11f959b commit 0a9d5ea

File tree

4 files changed

+34
-19
lines changed

4 files changed

+34
-19
lines changed

agent/containers/images/Dockerfile.base.j2

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{% set is_centos_8 = true if image_name == 'centos' and image_rev == '8' else false %}
2+
{% set is_centos_9 = true if image_name == 'centos' and image_rev == '9' else false %}
23
{% set image_tag = 'stream' + image_rev if image_name == 'centos' else image_rev %}
34
# {{ distro_name }} pbench-agent base image
45
FROM {{ image_repo }}/{{ image_name }}:{{ image_tag }}
@@ -17,8 +18,12 @@ RUN \
1718
{% if image_name == 'centos' %}
1819
{{ pkgmgr }} install -y --setopt=tsflags=nodocs https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ image_rev }}.noarch.rpm && \
1920
{% endif %}
20-
{{ pkgmgr }} install -y --setopt=tsflags=nodocs {% if is_centos_8 %}--enablerepo powertools glibc-locale-source {% endif %} pbench-agent && \
21-
{% if is_centos_8 %}
21+
{{ pkgmgr }} install -y --setopt=tsflags=nodocs \
22+
{% if is_centos_8 %}--enablerepo powertools {% endif %} \
23+
{% if is_centos_9 %}--enablerepo crb {% endif %} \
24+
{% if is_centos_8 or is_centos_9 %} glibc-locale-source {% endif %} \
25+
pbench-agent && \
26+
{% if is_centos_8 or is_centos_9 %}
2227
localedef -i en_US -f UTF-8 en_US.UTF-8 && \
2328
{% endif %}
2429
{{ pkgmgr }} -y clean all && \

agent/containers/images/Dockerfile.layered.j2

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,25 @@
22
FROM pbench-agent-base-{{ distro }}:{{ tag }}
33

44
{% if kind in ('tools', 'all') %}
5+
{% if distro.startswith('fedora') or distro == 'centos-7' or distro == 'centos-8' %}
56
COPY ./{{ distro }}-pcp.repo /etc/yum.repos.d/pcp.repo
67
{% if distro.startswith('centos') %}
78
COPY ./{{ distro }}-prometheus.repo /etc/yum.repos.d/prometheus.repo
89
{% endif %}
910
{% endif %}
11+
{% endif %}
1012

1113
# Install all the RPMs required for this image.
1214
#
1315
# FIXME: this is not exhaustive, it does not include RPMs to support
1416
# Kubernetes or RHV environments.
1517
{% set pkgmgr = 'yum' if distro == 'centos-7' else 'dnf' %}
1618
RUN {{ pkgmgr }} install -y --setopt=tsflags=nodocs \
19+
{% if distro == 'centos-9' %}--enablerepo crb \
20+
{% else %}
1721
{% if distro == 'centos-8' %}--enablerepo powertools {% endif %} \
18-
{% if kind in ('tools', 'all') %}--enablerepo pcp-rpm-release {% endif %}{{ rpms }} && \
22+
{% if kind in ('tools', 'all') %}--enablerepo pcp-rpm-release {% endif %} \
23+
{% endif %}
24+
{{ rpms }} && \
1925
{{ pkgmgr }} -y clean all && \
2026
rm -rf /var/cache/{{ pkgmgr }}

agent/containers/images/Makefile

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,6 @@ _PCP_RPMS = \
7070
pcp-system-tools \
7171
pcp-zeroconf
7272

73-
# These are the lists of Prometheus RPMs -- the packages are the same, but they
74-
# have different names in the different distributions -- so we have two lists
75-
# keyed by the distro name.
76-
_centos_PROMETHEUS_RPMS = \
77-
node_exporter \
78-
prometheus2
79-
_fedora_PROMETHEUS_RPMS = \
80-
golang-github-prometheus-node-exporter \
81-
golang-github-prometheus
82-
8373
# The list of RPMs which provide the various tools we offer.
8474
# Not intended to be overridden with an environment variable.
8575
# Please keep the lists sorted.
@@ -96,7 +86,7 @@ _TOOL_RPMS = \
9686
${_PCP_RPMS} \
9787
perf \
9888
procps-ng \
99-
${_${DIST_NAME}_PROMETHEUS_RPMS} \
89+
${_PROMETHEUS_RPMS} \
10090
strace \
10191
tcpdump \
10292
trace-cmd
@@ -154,6 +144,15 @@ $(_DISTROS:%=%-tm): %-tm: pkgmgr-clean %-tool-meister-tagged
154144
%: DIST_NAME = $(wordlist 1, 1, $(subst -, ,$*))
155145
%: DIST_VERSION = $(wordlist 2, 2, $(subst -, ,$*))
156146

147+
# These are the lists of Prometheus RPMs -- the packages are the same, but they
148+
# have different names in the different distributions
149+
fedora-% centos-9-%: _PROMETHEUS_RPMS = \
150+
golang-github-prometheus-node-exporter \
151+
golang-github-prometheus
152+
centos-7-% centos-8-%: _PROMETHEUS_RPMS = \
153+
node_exporter \
154+
prometheus2
155+
157156

158157
# Tagging targets
159158
#
@@ -212,11 +211,13 @@ $(_TAG_TYPES:%=push-%): push-%: $(_DEFAULT_DISTROS:%=%-push-%)
212211
%-tools-tagged: %-tools %-tags.lis
213212
./apply-tags pbench-agent-tools-$* $*-tags.lis
214213

215-
# Add an additional dependency for centos-%-tools targets (this .repo file is
216-
# not required on Fedora).
217-
$(_ALL_centos_VERSIONS:%=%-tools): centos-%-tools: centos-%-prometheus.repo
214+
# CentOS 7 & 8 (but not 9) require an additional .repo file for Prometheus for
215+
# the tools container; analogously, they as well as Fedora require an additional
216+
# .repo file for PCP.
217+
centos-7-tools centos-8-tools: centos-%-tools: centos-%-prometheus.repo
218+
$(_ALL_fedora_VERSIONS:%=%-tools) centos-7-tools centos-8-tools: %-tools: %-pcp.repo
218219

219-
%-tools: %-base-tagged %-tools.Dockerfile %-pcp.repo %-tags.lis
220+
%-tools: %-base-tagged %-tools.Dockerfile %-tags.lis
220221
./build-image tools $* $*-tags.lis
221222

222223
%-tools.Dockerfile: Dockerfile.layered.j2 %-tags.lis

server/containers/images/Dockerfile.base.j2

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ RUN \
1010
{% if distro_image.startswith('centos') %}
1111
{{ pkgmgr }} install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ distro_image.split(':', 1)[1] }}.noarch.rpm && \
1212
{% endif %}
13-
{{ pkgmgr }} install -y {% if distro_image == 'centos:8' %}--enablerepo PowerTools {% endif %}--enablerepo copr-pbench pbench-server && \
13+
{{ pkgmgr }} install -y \
14+
{% if distro_image == 'centos:8' %}--enablerepo PowerTools {% endif %} \
15+
{% if distro_image == 'centos:9' %}--enablerepo crb {% endif %} \
16+
--enablerepo copr-pbench pbench-server && \
1417
{{ pkgmgr }} -y clean all && \
1518
rm -rf /var/cache/yum

0 commit comments

Comments
 (0)