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

base: compile OpenBFDD locally #4683

Merged
merged 1 commit into from
Oct 31, 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
23 changes: 17 additions & 6 deletions dist/images/Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,22 @@ RUN cd /usr/src/ovn && \
if [ "$ARCH" = "amd64" ] && [ "$LEGACY" != "true" ]; then CONFIGURE_OPTS="--with-ovs-build=/usr/src/ovs/_debian CFLAGS='-O2 -g -msse4.2 -mpopcnt -fPIC'"; fi && \
OVSDIR=/usr/src/ovs EXTRA_CONFIGURE_OPTS=$CONFIGURE_OPTS DEB_BUILD_OPTIONS='parallel=8 nocheck' fakeroot debian/rules binary

RUN mkdir -p /usr/src/openbfdd && \
curl -sSf -L --retry 5 https://github.com/dyninc/OpenBFDD/archive/e35f43ad8d2b3f084e96a84c392528a90d05a287.tar.gz | \
tar -xz -C /usr/src/openbfdd --strip-components=1

ADD OpenBFDD-compile.patch /usr/src/

RUN cd /usr/src/openbfdd && \
rm -vf missing && \
git apply --no-apply /usr/src/OpenBFDD-compile.patch && \
autoupdate && \
./autogen.sh && \
./configure --enable-silent-rules && \
make

RUN mkdir /packages/ && \
mv /usr/src/openbfdd/bfdd-beacon /usr/src/openbfdd/bfdd-control /packages/ && \
cp /usr/src/openvswitch-*deb /packages && \
cp /usr/src/python3-openvswitch*deb /packages && \
cp /usr/src/ovn-*deb /packages && \
Expand Down Expand Up @@ -143,19 +158,15 @@ ARG DUMB_INIT_VERSION="1.2.5"
RUN curl -sSf -L --retry 5 -o /usr/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v${DUMB_INIT_VERSION}/dumb-init_${DUMB_INIT_VERSION}_$(arch) && \
chmod +x /usr/bin/dumb-init

ARG BFDD_VERSION="v0.5.5"
RUN curl -sSf -L --retry 3 -o /usr/local/bin/bfdd-control https://github.com/bobz965/bfd-binary-for-kube-ovn-cni/releases/download/${BFDD_VERSION}/bfdd-control-linux-$(arch) && \
curl -sSf -L --retry 3 -o /usr/local/bin/bfdd-beacon https://github.com/bobz965/bfd-binary-for-kube-ovn-cni/releases/download/${BFDD_VERSION}/bfdd-beacon-linux-$(arch) && \
chmod +x /usr/local/bin/bfdd-control /usr/local/bin/bfdd-beacon && \
setcap CAP_NET_BIND_SERVICE+eip $(readlink -f $(which bfdd-beacon))

RUN --mount=type=bind,target=/godeps,from=go-deps,source=/godeps \
cp /godeps/loopback /godeps/portmap /godeps/macvlan ./ && \
cp /godeps/kubectl /godeps/gobgp /usr/bin/

ARG DEBUG=false

RUN --mount=type=bind,target=/packages,from=ovs-builder,source=/packages \
cp /packages/bfdd-beacon /packages/bfdd-control /usr/bin/ && \
setcap CAP_NET_BIND_SERVICE+eip /usr/bin/bfdd-beacon && \
dpkg -i /packages/openvswitch-*.deb /packages/python3-openvswitch*.deb && \
dpkg -i --ignore-depends=openvswitch-switch,openvswitch-common /packages/ovn-*.deb && \
rm -rf /var/lib/openvswitch/pki/ && \
Expand Down
39 changes: 39 additions & 0 deletions dist/images/OpenBFDD-compile.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
diff --git a/Logger.cpp b/Logger.cpp
index f375b20..e72afba 100755
--- a/Logger.cpp
+++ b/Logger.cpp
@@ -11,6 +11,8 @@
#include <errno.h>
#include <string.h>
#include <unistd.h>
+#include <time.h>
+#include <pthread.h>

const size_t Logger::MaxMessageLen;

diff --git a/SchedulerBase.cpp b/SchedulerBase.cpp
index 3eab298..c1dffc4 100755
--- a/SchedulerBase.cpp
+++ b/SchedulerBase.cpp
@@ -11,6 +11,8 @@
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
+#include <time.h>
+#include <pthread.h>

using namespace std;

diff --git a/utils.cpp b/utils.cpp
index 79c7b68..f846459 100755
--- a/utils.cpp
+++ b/utils.cpp
@@ -13,6 +13,8 @@
#include <sys/stat.h>
#include <sys/param.h>
#include <sys/socket.h>
+#include <time.h>
+#include <pthread.h>

using namespace std;

Loading