Skip to content

Commit 34fcd34

Browse files
committed
WIP: moved profiling tool install from crossbuild image to profiling image. profiling image no longer builds FR by default. profiling containers will not start FR automatically.
1 parent 18c8dbe commit 34fcd34

5 files changed

Lines changed: 91 additions & 94 deletions

File tree

scripts/docker/build/ubuntu24/Dockerfile.prof

Lines changed: 45 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,52 @@ FROM ${from}
99
# Copy profiling profile scripts into the container
1010
COPY scripts/docker/profiling/profiles/default-profiling /profile
1111

12-
RUN /profile/configure.sh
13-
RUN make
14-
RUN make install
12+
#
13+
# Install profiling tools
14+
#
15+
RUN apt-get update && \
16+
apt-get install $APT_OPTS \
17+
libgoogle-perftools-dev \
18+
google-perftools \
19+
valgrind \
20+
heaptrack \
21+
psmisc \
22+
kcachegrind \
23+
kio \
24+
libkf5iconthemes5 \
25+
libkf5parts5 \
26+
libkf5textwidgets5 \
27+
libqt5gui5 \
28+
libqt5widgets5 && \
29+
apt-get clean && \
30+
rm -r /var/lib/apt/lists/*
1531

16-
# Mirror the package image: both binary names and both config dir paths work
17-
RUN ln -s /usr/local/sbin/radiusd /usr/local/sbin/freeradius
18-
RUN ln -s /etc/freeradius/radiusd.conf /etc/freeradius/freeradius.conf
19-
RUN ln -s /etc/freeradius /etc/raddb
32+
#
33+
# Set up Ubuntu debug symbol repository and install OS library debug symbols.
34+
# These allow callgrind/valgrind to resolve system library calls (glibc,
35+
# OpenSSL, talloc, etc.) to named symbols instead of hex addresses.
36+
#
37+
RUN apt-get update && \
38+
apt-get install $APT_OPTS ubuntu-dbgsym-keyring && \
39+
printf 'deb http://ddebs.ubuntu.com noble main restricted universe multiverse\ndeb http://ddebs.ubuntu.com noble-updates main restricted universe multiverse\n' \
40+
> /etc/apt/sources.list.d/ddebs.list && \
41+
apt-get update && \
42+
apt-get install $APT_OPTS \
43+
libc6-dbg \
44+
libssl3t64-dbgsym \
45+
libtalloc2-dbgsym \
46+
libpcre2-8-0-dbgsym \
47+
libsqlite3-0-dbgsym && \
48+
apt-get clean && \
49+
rm -r /var/lib/apt/lists/*
50+
51+
#
52+
# Install FlameGraph scripts
53+
#
54+
RUN git clone --depth 1 https://github.com/brendangregg/FlameGraph /opt/flamegraph \
55+
&& chmod +x /opt/flamegraph/*.pl /opt/flamegraph/*.sh
2056

21-
WORKDIR /
22-
COPY scripts/docker/etc/docker-entrypoint.sh.deb docker-entrypoint.sh
23-
RUN chmod +x docker-entrypoint.sh
57+
ENV PATH="/opt/flamegraph:${PATH}"
2458

2559
EXPOSE 1812/udp 1813/udp
26-
ENTRYPOINT ["/docker-entrypoint.sh"]
27-
CMD ["/profile/start.sh"]
60+
CMD ["/bin/sh", "-c", "while true; do sleep 60; done"]

scripts/docker/crossbuild.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ $(DT)/${1}/Dockerfile.cb: $(DOCKER_TMPL) $(CB_DIR)/m4/crossbuild.deb.m4 $(CB_DIR
283283
.PHONY: crossbuild.${1}.profregen
284284
crossbuild.${1}.profregen: $(DT)/${1}/Dockerfile.prof
285285

286-
$(DT)/${1}/Dockerfile.prof: $(DOCKER_TMPL) $(CB_DIR)/m4/profiling.deb.m4 $(CB_DIR)/m4/profiling.rpm.m4
286+
$(DT)/${1}/Dockerfile.prof: $(DOCKER_TMPL) $(CB_DIR)/m4/profiling.deb.m4
287287
${Q}echo REGEN ${1}
288288
${Q}m4 -I $(CB_DIR)/m4 \
289289
-D D_NAME=${1} \

scripts/docker/m4/crossbuild.deb.m4

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -27,53 +27,6 @@ RUN apt-get update && \
2727
rm -r /var/lib/apt/lists/*
2828

2929

30-
#
31-
# Install profiling tools
32-
#
33-
RUN apt-get update && \
34-
apt-get install $APT_OPTS \
35-
libgoogle-perftools-dev \
36-
google-perftools \
37-
valgrind \
38-
heaptrack \
39-
psmisc \
40-
kcachegrind \
41-
kio \
42-
libkf5iconthemes5 \
43-
libkf5parts5 \
44-
libkf5textwidgets5 \
45-
libqt5gui5 \
46-
libqt5widgets5 && \
47-
apt-get clean && \
48-
rm -r /var/lib/apt/lists/*
49-
50-
#
51-
# Set up Ubuntu debug symbol repository and install OS library debug symbols.
52-
# These allow callgrind/valgrind to resolve system library calls (glibc,
53-
# OpenSSL, talloc, etc.) to named symbols instead of hex addresses.
54-
#
55-
RUN apt-get update && \
56-
apt-get install $APT_OPTS ubuntu-dbgsym-keyring && \
57-
printf 'deb http://ddebs.ubuntu.com OS_CODENAME main restricted universe multiverse\ndeb http://ddebs.ubuntu.com OS_CODENAME-updates main restricted universe multiverse\n' \
58-
> /etc/apt/sources.list.d/ddebs.list && \
59-
apt-get update && \
60-
apt-get install $APT_OPTS \
61-
libc6-dbg \
62-
libssl3t64-dbgsym \
63-
libtalloc2-dbgsym \
64-
libpcre2-8-0-dbgsym \
65-
libsqlite3-0-dbgsym && \
66-
apt-get clean && \
67-
rm -r /var/lib/apt/lists/*
68-
69-
#
70-
# Install FlameGraph scripts
71-
#
72-
RUN git clone --depth 1 https://github.com/brendangregg/FlameGraph /opt/flamegraph \
73-
&& chmod +x /opt/flamegraph/*.pl /opt/flamegraph/*.sh
74-
75-
ENV PATH="/opt/flamegraph:${PATH}"
76-
7730
#
7831
# Set up NetworkRADIUS extras repository
7932
#

scripts/docker/m4/profiling.deb.m4

Lines changed: 45 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,52 @@ FROM ${from}
44
# Copy profiling profile scripts into the container
55
COPY scripts/docker/profiling/profiles/PROFILE_NAME /profile
66

7-
RUN /profile/configure.sh
8-
RUN make
9-
RUN make install
7+
#
8+
# Install profiling tools
9+
#
10+
RUN apt-get update && \
11+
apt-get install $APT_OPTS \
12+
libgoogle-perftools-dev \
13+
google-perftools \
14+
valgrind \
15+
heaptrack \
16+
psmisc \
17+
kcachegrind \
18+
kio \
19+
libkf5iconthemes5 \
20+
libkf5parts5 \
21+
libkf5textwidgets5 \
22+
libqt5gui5 \
23+
libqt5widgets5 && \
24+
apt-get clean && \
25+
rm -r /var/lib/apt/lists/*
1026

11-
# Mirror the package image: both binary names and both config dir paths work
12-
RUN ln -s /usr/local/sbin/radiusd /usr/local/sbin/freeradius
13-
RUN ln -s /etc/freeradius/radiusd.conf /etc/freeradius/freeradius.conf
14-
RUN ln -s /etc/freeradius /etc/raddb
27+
#
28+
# Set up Ubuntu debug symbol repository and install OS library debug symbols.
29+
# These allow callgrind/valgrind to resolve system library calls (glibc,
30+
# OpenSSL, talloc, etc.) to named symbols instead of hex addresses.
31+
#
32+
RUN apt-get update && \
33+
apt-get install $APT_OPTS ubuntu-dbgsym-keyring && \
34+
printf 'deb http://ddebs.ubuntu.com OS_CODENAME main restricted universe multiverse\ndeb http://ddebs.ubuntu.com OS_CODENAME-updates main restricted universe multiverse\n' \
35+
> /etc/apt/sources.list.d/ddebs.list && \
36+
apt-get update && \
37+
apt-get install $APT_OPTS \
38+
libc6-dbg \
39+
libssl3t64-dbgsym \
40+
libtalloc2-dbgsym \
41+
libpcre2-8-0-dbgsym \
42+
libsqlite3-0-dbgsym && \
43+
apt-get clean && \
44+
rm -r /var/lib/apt/lists/*
1545

16-
WORKDIR /
17-
COPY scripts/docker/etc/docker-entrypoint.sh.PKG_TYPE docker-entrypoint.sh
18-
RUN chmod +x docker-entrypoint.sh
46+
#
47+
# Install FlameGraph scripts
48+
#
49+
RUN git clone --depth 1 https://github.com/brendangregg/FlameGraph /opt/flamegraph \
50+
&& chmod +x /opt/flamegraph/*.pl /opt/flamegraph/*.sh
51+
52+
ENV PATH="/opt/flamegraph:${PATH}"
1953

2054
EXPOSE 1812/udp 1813/udp
21-
ENTRYPOINT ["/docker-entrypoint.sh"]
22-
CMD ["/profile/start.sh"]
55+
CMD ["/bin/sh", "-c", "while true; do sleep 60; done"]

scripts/docker/m4/profiling.rpm.m4

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)