-
Notifications
You must be signed in to change notification settings - Fork 379
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
Add static keepalived build #4182
Conversation
Signed-off-by: Juan-Luis de Sousa-Valadas Castaño <jvaladas@mirantis.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've noticed this:
$ embedded-bins/staging/linux/bin/keepalived --version 2>&1 | head -n1
Keepalived v2.2.8 (04/04,2023), git commit v2.2.7-154-g292b299e+
Not sure if we can do something about this strange git commit. We're building from "the official" tarball, so the tarball might have been generated from the wrong commit? The diff to the actual git tag is minimal: acassen/keepalived@292b299...v2.2.8
@@ -22,6 +22,8 @@ RUN strip /usr/local/sbin/xtables-nft-multi | |||
RUN scanelf -Rn /usr/local && file /usr/local/sbin/* | |||
|
|||
FROM scratch | |||
ARG VERSION |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure this is necessary? (Same for line 18 in the keepalived Dockerfile.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
D'oh, it's not. This must have slipped through while I was doing some debugging.
RUN apk add build-base curl \ | ||
linux-headers \ | ||
openssl-dev openssl-libs-static \ | ||
libnl3-dev libnl3-static |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RUN apk add build-base curl \ | |
linux-headers \ | |
openssl-dev openssl-libs-static \ | |
libnl3-dev libnl3-static | |
RUN apk add build-base curl \ | |
linux-headers \ | |
openssl-dev openssl-libs-static \ | |
libnl3-dev libnl3-static |
(Or change all other indentation to spaces?)
RUN cd /keepalived-$VERSION && \ | ||
CFLAGS='-static -s' LDFLAGS=-static ./configure --disable-dynamic-linking && \ | ||
make -j$(nproc) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formatting nit
RUN cd /keepalived-$VERSION && \ | |
CFLAGS='-static -s' LDFLAGS=-static ./configure --disable-dynamic-linking && \ | |
make -j$(nproc) | |
RUN cd /keepalived-$VERSION \ | |
&& CFLAGS='-static -s' LDFLAGS=-static ./configure --disable-dynamic-linking \ | |
&& make -j$(nproc) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll change it no problem.
Is this some convention I'm not aware of? I'm asking because we also have && \
in the konnectivity's and iptables' dockerfile. Maybe we should change it there as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the stuff my auto formatter does 👼
I'd only change that in other places when they're actually touched in some way, though.
@@ -11,7 +11,7 @@ export TARGET_OS | |||
SOURCE_DATE_EPOCH ?= $(shell git log -1 --pretty=%ct || date -u +%s) | |||
|
|||
bindir = staging/${TARGET_OS}/bin | |||
posix_bins = runc kubelet containerd containerd-shim containerd-shim-runc-v1 containerd-shim-runc-v2 kube-apiserver kube-scheduler kube-controller-manager etcd kine konnectivity-server xtables-legacy-multi xtables-nft-multi | |||
posix_bins = runc kubelet containerd containerd-shim containerd-shim-runc-v1 containerd-shim-runc-v2 kube-apiserver kube-scheduler kube-controller-manager etcd kine konnectivity-server xtables-legacy-multi xtables-nft-multi keepalived |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we keep keepalived out of this list until we actually use it?
BTW the Alpine package behaves the same: $ docker run --rm alpine:3.19 sh -c 'apk add keepalived && keepalived --version 2>&1 | head -n1'
fetch https://dl-cdn.alpinelinux.org/alpine/v3.19/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.19/community/x86_64/APKINDEX.tar.gz
(1/3) Installing keepalived-common (2.2.8-r0)
(2/3) Installing libnl3 (3.9.0-r1)
(3/3) Installing keepalived (2.2.8-r0)
Executing busybox-1.36.1-r15.trigger
OK: 9 MiB in 18 packages
Keepalived v2.2.8 (04/04,2023), git commit v2.2.7-154-g292b299e+ |
Hmm I could but the thing is that keepalived in posix_bins is also a test that proves that the build works, so I'm not very happy about adding the build code if we are not verifying that the build. I think I'll just close this PR and make the 2nd PR slightly larger. I'll make the 2nd PR today or tomorrow and in the meantime I'll close this one... |
Fair enough, albeit we verified it already manually and via CI. I don't know how this could regress until the 1.30 release. Even if it would, fixing would probably be trivial and could be done when actually enabling the build. |
Description
This is part of keepalived support, which is tracked in #4181.
This is the first and easiest step to get merged, this adds keepalived to the build.
Type of change
How Has This Been Tested?
As there are multiple steps to this process, there will be inttests added in the next two steps of keepalived.
Checklist: