Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Use Ubuntu 24.04 LTS (Noble Numbat) as container base image #67

Merged
merged 3 commits into from
May 29, 2024
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
2 changes: 1 addition & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
Checks: '-*,bugprone-*,cert-*,clang-analyzer-*,misc-*,performance-*,portability-*,-bugprone-easily-swappable-parameters,-bugprone-unused-return-value,-cert-err33-c,-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling'
Checks: '-*,bugprone-*,cert-*,clang-analyzer-*,misc-*,performance-*,portability-*,-bugprone-easily-swappable-parameters,-bugprone-unused-return-value,-cert-err33-c,-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,-misc-include-cleaner'
WarningsAsErrors: '*'
13 changes: 7 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# libpfm dependency builder image
FROM ubuntu:22.04 as libpfm-builder
FROM ubuntu:24.04 as libpfm-builder
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update && \
apt install -y build-essential git devscripts debhelper dpatch python3-dev libncurses-dev swig && \
update-alternatives --install /usr/bin/python python /usr/bin/python3 1 && \
apt install -y build-essential git devscripts debhelper libncurses-dev && \
git clone -b smartwatts https://github.com/gfieni/libpfm4.git /root/libpfm4 && \
cd /root/libpfm4 && \
sed -i 's/CONFIG_PFMLIB_NOPYTHON=n/CONFIG_PFMLIB_NOPYTHON=y/' debian/rules && \
sed -i '/^Package: python-libpfm4$/,/^$/d' debian/control && \
fakeroot debian/rules binary

# sensor builder image (build tools + development dependencies):
FROM ubuntu:22.04 as sensor-builder
FROM ubuntu:24.04 as sensor-builder
ENV DEBIAN_FRONTEND=noninteractive
ARG BUILD_TYPE=Debug
ARG MONGODB_SUPPORT=ON
Expand All @@ -27,7 +28,7 @@ RUN cd /usr/src/hwpc-sensor && \
cmake --build build --parallel $(getconf _NPROCESSORS_ONLN)

# sensor runner image (only runtime depedencies):
FROM ubuntu:22.04 as sensor-runner
FROM ubuntu:24.04 as sensor-runner
ENV DEBIAN_FRONTEND=noninteractive
ARG BUILD_TYPE=Debug
ARG MONGODB_SUPPORT=ON
Expand All @@ -36,7 +37,7 @@ RUN useradd -d /opt/powerapi -m powerapi && \
apt update && \
apt install -y libczmq4 libjson-c5 libcap2-bin && \
echo "${MONGODB_SUPPORT}" |grep -iq "on" && apt install -y libmongoc-1.0-0 || true && \
echo "${BUILD_TYPE}" |grep -iq "debug" && apt install -y libasan6 libubsan1 || true && \
echo "${BUILD_TYPE}" |grep -iq "debug" && apt install -y libasan8 libubsan1 || true && \
rm -rf /var/lib/apt/lists/*
COPY --from=libpfm-builder /root/libpfm4*.deb /tmp/
RUN dpkg -i /tmp/libpfm4_*.deb && \
Expand Down
2 changes: 1 addition & 1 deletion src/config_json.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ setup_storage_type(struct config *config, json_object *storage)
}

static int
setup_storage_null_parameters(struct config *config __unused, json_object *storage_obj)
setup_storage_null_parameters(struct config *config __attribute__((unused)), json_object *storage_obj)
{
json_object_object_foreach(storage_obj, key, value) {
if (!strcasecmp(key, "type")) {
Expand Down
10 changes: 0 additions & 10 deletions src/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,6 @@

#include <stdint.h>

/*
* __unused is a helper macro to set the unused attribute on a variable.
*/
#define __unused __attribute__((unused))

/*
* __format_printf is a helper macro to set the printf format attribute for the given arguments range.
*/
#define __format_printf(a, b) __attribute__((__format__(printf, a, b)))

/*
* intdup returns a pointer to a new integer having the same value as val.
*/
Expand Down