Skip to content

Commit 986cfb6

Browse files
authored
base: use local patch files (#5201)
Signed-off-by: zhangzujian <zhangzujian.7@gmail.com>
1 parent 509ec59 commit 986cfb6

28 files changed

Lines changed: 3382 additions & 48 deletions

dist/images/Dockerfile.base

Lines changed: 58 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,68 +6,95 @@ FROM ubuntu:24.04 AS ovs-builder
66
ARG ARCH
77
ARG LEGACY
88
ARG DEBIAN_FRONTEND=noninteractive
9-
ENV SRC_DIR='/usr/src'
9+
ARG SRC_DIR='/usr/src'
10+
11+
ADD patches/4228eab1d722087ba795e310eadc9e25c4513ec1.patch $SRC_DIR
12+
ADD patches/54056ea65dc28aa1c4c721a2a34d7913f79f8376.patch $SRC_DIR
13+
ADD patches/6b4dcb311f171d81a5d40ea51a273fc356c123db.patch $SRC_DIR
14+
ADD patches/f627b7721ec282f2edaf798913b1559b939687f0.patch $SRC_DIR
15+
ADD patches/3f3e3a436ff5eb2eaafbeeae8ea9dc0c514fe8a3.patch $SRC_DIR
16+
ADD patches/a6cb8215a80635129e4fada4c0d25c25fb746bf7.patch $SRC_DIR
17+
ADD patches/d4d76ddb2e12cdd9e73bb5e008ebb9fd1b4d6ca6.patch $SRC_DIR
18+
ADD patches/ffd2328d4a55271569e2b89e54a2c18f4e186af8.patch $SRC_DIR
19+
ADD patches/d088c5d8c263552c5a31d87813991aee30ab74de.patch $SRC_DIR
20+
ADD patches/1b31f07dc60c016153fa35d936cdda0e02e58492.patch $SRC_DIR
21+
ADD patches/54b767822916606dbb78335a3197983f435b5b8a.patch $SRC_DIR
22+
ADD patches/e490f5ac0b644101913c2a3db8e03d85e859deff.patch $SRC_DIR
23+
ADD patches/b973ec477b43df1c3ef3cdb69f8646948fcf94ae.patch $SRC_DIR
24+
ADD patches/5593e614e51a5dce28941e5bf760f9ee5397cede.patch $SRC_DIR
25+
ADD patches/f9e97031b56ab5747b5d73629198331a6daacdfd.patch $SRC_DIR
26+
ADD patches/53d961492036f1d41d9d1b04bab628375a9c6eb5.patch $SRC_DIR
27+
ADD patches/44229317de74d1e97f7499b371a86c015be6b7a6.patch $SRC_DIR
28+
ADD patches/786756870f12ac69a5d7bc498693574c6591c5e9.patch $SRC_DIR
29+
ADD patches/505dc82f54d4ce54e0378fd3bac1052ee644ac59.patch $SRC_DIR
30+
ADD patches/f4b1f5fbf0f5aff68299efaa2d0577c90cb2568e.patch $SRC_DIR
31+
ADD patches/b3af07690e7b2328c02318b1bd812c5665c0632b.patch $SRC_DIR
32+
ADD patches/49834fdd3fa3b066650bc8b7a8b05a773d217d95.patch $SRC_DIR
33+
ADD patches/03e35ed9c5b4de0fa8acbc2c057cdd5957a8d605.patch $SRC_DIR
34+
ADD patches/b5e2975eb65f37315545300254fc0f58a9df52b1.patch $SRC_DIR
35+
ADD patches/e7d3ba53cdcbc524bb29c54ddb07b83cc4258ed7.patch $SRC_DIR
36+
ADD patches/a9e009136a42cf6d985f97e2bf1ec41df6b5ca29.patch $SRC_DIR
1037

1138
RUN apt update && apt install -y git curl
1239

1340
RUN cd /usr/src/ && \
1441
git clone -b branch-3.3 --depth=1 https://github.com/openvswitch/ovs.git && \
1542
cd ovs && \
1643
# fix memory leak by ofport_usage and trim memory periodically
17-
curl -s https://github.com/kubeovn/ovs/commit/4228eab1d722087ba795e310eadc9e25c4513ec1.patch | git apply && \
44+
git apply $SRC_DIR/4228eab1d722087ba795e310eadc9e25c4513ec1.patch && \
1845
# increase election timer
19-
curl -s https://github.com/kubeovn/ovs/commit/54056ea65dc28aa1c4c721a2a34d7913f79f8376.patch | git apply && \
46+
git apply $SRC_DIR/54056ea65dc28aa1c4c721a2a34d7913f79f8376.patch && \
2047
# add fdb update logging
21-
curl -s https://github.com/kubeovn/ovs/commit/6b4dcb311f171d81a5d40ea51a273fc356c123db.patch | git apply && \
48+
git apply $SRC_DIR/6b4dcb311f171d81a5d40ea51a273fc356c123db.patch && \
2249
# fdb: fix mac learning in environments with hairpin enabled
23-
curl -s https://github.com/kubeovn/ovs/commit/f627b7721ec282f2edaf798913b1559b939687f0.patch | git apply && \
50+
git apply $SRC_DIR/f627b7721ec282f2edaf798913b1559b939687f0.patch && \
2451
# ovsdb-tool: add optional server id parameter for "join-cluster" command
25-
curl -s https://github.com/kubeovn/ovs/commit/3f3e3a436ff5eb2eaafbeeae8ea9dc0c514fe8a3.patch | git apply && \
52+
git apply $SRC_DIR/3f3e3a436ff5eb2eaafbeeae8ea9dc0c514fe8a3.patch && \
2653
# fix memory leak in qos
27-
curl -s https://github.com/kubeovn/ovs/commit/a6cb8215a80635129e4fada4c0d25c25fb746bf7.patch | git apply && \
54+
git apply $SRC_DIR/a6cb8215a80635129e4fada4c0d25c25fb746bf7.patch && \
2855
# ovsdb-tool: add command fix-cluster
29-
curl -s https://github.com/kubeovn/ovs/commit/d4d76ddb2e12cdd9e73bb5e008ebb9fd1b4d6ca6.patch | git apply && \
56+
git apply $SRC_DIR/d4d76ddb2e12cdd9e73bb5e008ebb9fd1b4d6ca6.patch && \
3057
# netdev: reduce cpu utilization for getting device addresses
31-
curl -s https://github.com/kubeovn/ovs/commit/ffd2328d4a55271569e2b89e54a2c18f4e186af8.patch | git apply && \
58+
git apply $SRC_DIR/ffd2328d4a55271569e2b89e54a2c18f4e186af8.patch && \
3259
# ovs-router: skip getting source address for kube-ipvs0
33-
curl -s https://github.com/kubeovn/ovs/commit/d088c5d8c263552c5a31d87813991aee30ab74de.patch | git apply && \
60+
git apply $SRC_DIR/d088c5d8c263552c5a31d87813991aee30ab74de.patch && \
3461
# increase the default probe interval for large cluster
35-
curl -s https://github.com/kubeovn/ovs/commit/1b31f07dc60c016153fa35d936cdda0e02e58492.patch | git apply && \
62+
git apply $SRC_DIR/1b31f07dc60c016153fa35d936cdda0e02e58492.patch && \
3663
# update ovs-sandbox for docker run
37-
curl -s https://github.com/kubeovn/ovs/commit/54b767822916606dbb78335a3197983f435b5b8a.patch | git apply
64+
git apply $SRC_DIR/54b767822916606dbb78335a3197983f435b5b8a.patch
3865

3966
RUN cd /usr/src/ && git clone -b branch-24.03 --depth=1 https://github.com/ovn-org/ovn.git && \
4067
cd ovn && \
4168
# change hash type from dp_hash to hash with field src_ip
42-
curl -s https://github.com/kubeovn/ovn/commit/e490f5ac0b644101913c2a3db8e03d85e859deff.patch | git apply && \
69+
git apply $SRC_DIR/e490f5ac0b644101913c2a3db8e03d85e859deff.patch && \
4370
# modify src route priority
44-
curl -s https://github.com/kubeovn/ovn/commit/b973ec477b43df1c3ef3cdb69f8646948fcf94ae.patch | git apply && \
71+
git apply $SRC_DIR/b973ec477b43df1c3ef3cdb69f8646948fcf94ae.patch && \
4572
# fix reaching resubmit limit in underlay
46-
curl -s https://github.com/kubeovn/ovn/commit/5593e614e51a5dce28941e5bf760f9ee5397cede.patch | git apply && \
73+
git apply $SRC_DIR/5593e614e51a5dce28941e5bf760f9ee5397cede.patch && \
4774
# ovn-controller: do not send GARP on localnet for Kube-OVN ports
48-
curl -s https://github.com/kubeovn/ovn/commit/f9e97031b56ab5747b5d73629198331a6daacdfd.patch | git apply && \
75+
git apply $SRC_DIR/f9e97031b56ab5747b5d73629198331a6daacdfd.patch && \
4976
# northd: add nb option version_compatibility
50-
curl -s https://github.com/kubeovn/ovn/commit/53d961492036f1d41d9d1b04bab628375a9c6eb5.patch | git apply && \
77+
git apply $SRC_DIR/53d961492036f1d41d9d1b04bab628375a9c6eb5.patch && \
5178
# add support for conditionally skipping conntrack
52-
curl -s https://github.com/kubeovn/ovn/commit/44229317de74d1e97f7499b371a86c015be6b7a6.patch | git apply && \
79+
git apply $SRC_DIR/44229317de74d1e97f7499b371a86c015be6b7a6.patch && \
5380
# northd: skip conntrack when access node local dns ip
54-
curl -s https://github.com/kubeovn/ovn/commit/786756870f12ac69a5d7bc498693574c6591c5e9.patch | git apply && \
81+
git apply $SRC_DIR/786756870f12ac69a5d7bc498693574c6591c5e9.patch && \
5582
# lflow: do not send direct traffic between lports to conntrack
56-
curl -s https://github.com/kubeovn/ovn/commit/505dc82f54d4ce54e0378fd3bac1052ee644ac59.patch | git apply && \
83+
git apply $SRC_DIR/505dc82f54d4ce54e0378fd3bac1052ee644ac59.patch && \
5784
# direct output to lsp for dnat packets in logical switch ingress pipelines
58-
curl -s https://github.com/kubeovn/ovn/commit/f4b1f5fbf0f5aff68299efaa2d0577c90cb2568e.patch | git apply && \
85+
git apply $SRC_DIR/f4b1f5fbf0f5aff68299efaa2d0577c90cb2568e.patch && \
5986
# fix lr-lb dnat with multiple distributed gateway ports
60-
curl -s https://github.com/kubeovn/ovn/commit/b3af07690e7b2328c02318b1bd812c5665c0632b.patch | git apply && \
87+
git apply $SRC_DIR/b3af07690e7b2328c02318b1bd812c5665c0632b.patch && \
6188
# northd: skip arp/nd request for lrp addresses from localnet ports
62-
curl -s https://github.com/kubeovn/ovn/commit/49834fdd3fa3b066650bc8b7a8b05a773d217d95.patch | git apply && \
89+
git apply $SRC_DIR/49834fdd3fa3b066650bc8b7a8b05a773d217d95.patch && \
6390
# ovn-controller: make activation strategy work for single chassis
64-
curl -s https://github.com/kubeovn/ovn/commit/03e35ed9c5b4de0fa8acbc2c057cdd5957a8d605.patch | git apply && \
91+
git apply $SRC_DIR/03e35ed9c5b4de0fa8acbc2c057cdd5957a8d605.patch && \
6592
# support dedicated BFD LRP
66-
curl -s https://github.com/kubeovn/ovn/commit/b5e2975eb65f37315545300254fc0f58a9df52b1.patch | git apply && \
93+
git apply $SRC_DIR/b5e2975eb65f37315545300254fc0f58a9df52b1.patch && \
6794
# skip node local dns ip conntrack when set acl
68-
curl -s https://github.com/kubeovn/ovn/commit/e7d3ba53cdcbc524bb29c54ddb07b83cc4258ed7.patch | git apply && \
95+
git apply $SRC_DIR/e7d3ba53cdcbc524bb29c54ddb07b83cc4258ed7.patch && \
6996
# select local backend first
70-
curl -s https://github.com/kubeovn/ovn/commit/a9e009136a42cf6d985f97e2bf1ec41df6b5ca29.patch | git apply
97+
git apply $SRC_DIR/a9e009136a42cf6d985f97e2bf1ec41df6b5ca29.patch
7198

7299
RUN apt install -y build-essential fakeroot \
73100
autoconf automake bzip2 debhelper-compat dh-exec dh-python dh-sequence-python3 dh-sequence-sphinxdoc \
@@ -117,10 +144,10 @@ RUN mkdir /packages/ && \
117144
FROM ghcr.io/aquasecurity/trivy:latest AS trivy
118145

119146
ARG ARCH
120-
ENV CNI_PLUGINS_VERSION="v1.7.1"
121-
ENV KUBECTL_VERSION="v1.32.4"
122-
ENV GOBGP_VERSION="3.36.0"
123-
ENV TRIVY_DB_REPOSITORY="public.ecr.aws/aquasecurity/trivy-db:2"
147+
ARG CNI_PLUGINS_VERSION="v1.7.1"
148+
ARG KUBECTL_VERSION="v1.32.4"
149+
ARG GOBGP_VERSION="3.36.0"
150+
ARG TRIVY_DB_REPOSITORY="public.ecr.aws/aquasecurity/trivy-db:2"
124151

125152
RUN apk --no-cache add curl jq
126153
ADD go-deps/download-go-deps.sh /

dist/images/Dockerfile.base-dpdk

Lines changed: 32 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,23 @@ FROM ubuntu:24.04 AS ovs-builder
44
ARG ARCH
55
ARG DPDK_VERSION=23.11.1
66
ARG DEBIAN_FRONTEND=noninteractive
7-
ENV SRC_DIR='/usr/src'
8-
ENV PIP_BREAK_SYSTEM_PACKAGES=1
7+
ARG SRC_DIR='/usr/src'
8+
ARG PIP_BREAK_SYSTEM_PACKAGES=1
9+
10+
ADD patches/4228eab1d722087ba795e310eadc9e25c4513ec1.patch $SRC_DIR
11+
ADD patches/54056ea65dc28aa1c4c721a2a34d7913f79f8376.patch $SRC_DIR
12+
ADD patches/6b4dcb311f171d81a5d40ea51a273fc356c123db.patch $SRC_DIR
13+
ADD patches/f627b7721ec282f2edaf798913b1559b939687f0.patch $SRC_DIR
14+
ADD patches/3f3e3a436ff5eb2eaafbeeae8ea9dc0c514fe8a3.patch $SRC_DIR
15+
ADD patches/a6cb8215a80635129e4fada4c0d25c25fb746bf7.patch $SRC_DIR
16+
ADD patches/d4d76ddb2e12cdd9e73bb5e008ebb9fd1b4d6ca6.patch $SRC_DIR
17+
ADD patches/ffd2328d4a55271569e2b89e54a2c18f4e186af8.patch $SRC_DIR
18+
ADD patches/d088c5d8c263552c5a31d87813991aee30ab74de.patch $SRC_DIR
19+
ADD patches/1b31f07dc60c016153fa35d936cdda0e02e58492.patch $SRC_DIR
20+
ADD patches/e490f5ac0b644101913c2a3db8e03d85e859deff.patch $SRC_DIR
21+
ADD patches/b973ec477b43df1c3ef3cdb69f8646948fcf94ae.patch $SRC_DIR
22+
ADD patches/5593e614e51a5dce28941e5bf760f9ee5397cede.patch $SRC_DIR
23+
ADD patches/f9e97031b56ab5747b5d73629198331a6daacdfd.patch $SRC_DIR
924

1025
RUN apt update && apt install -y git curl
1126

@@ -14,36 +29,36 @@ RUN cd /usr/src/ && \
1429
git clone -b branch-3.3 --depth=1 https://github.com/openvswitch/ovs.git && \
1530
cd ovs && \
1631
# fix memory leak by ofport_usage and trim memory periodically
17-
curl -s https://github.com/kubeovn/ovs/commit/4228eab1d722087ba795e310eadc9e25c4513ec1.patch | git apply && \
32+
git apply $SRC_DIR/4228eab1d722087ba795e310eadc9e25c4513ec1.patch && \
1833
# increase election timer
19-
curl -s https://github.com/kubeovn/ovs/commit/54056ea65dc28aa1c4c721a2a34d7913f79f8376.patch | git apply && \
34+
git apply $SRC_DIR/54056ea65dc28aa1c4c721a2a34d7913f79f8376.patch && \
2035
# add fdb update logging
21-
curl -s https://github.com/kubeovn/ovs/commit/6b4dcb311f171d81a5d40ea51a273fc356c123db.patch | git apply && \
36+
git apply $SRC_DIR/6b4dcb311f171d81a5d40ea51a273fc356c123db.patch && \
2237
# fdb: fix mac learning in environments with hairpin enabled
23-
curl -s https://github.com/kubeovn/ovs/commit/f627b7721ec282f2edaf798913b1559b939687f0.patch | git apply && \
38+
git apply $SRC_DIR/f627b7721ec282f2edaf798913b1559b939687f0.patch && \
2439
# ovsdb-tool: add optional server id parameter for "join-cluster" command
25-
curl -s https://github.com/kubeovn/ovs/commit/3f3e3a436ff5eb2eaafbeeae8ea9dc0c514fe8a3.patch | git apply && \
40+
git apply $SRC_DIR/3f3e3a436ff5eb2eaafbeeae8ea9dc0c514fe8a3.patch && \
2641
# fix memory leak in qos
27-
curl -s https://github.com/kubeovn/ovs/commit/a6cb8215a80635129e4fada4c0d25c25fb746bf7.patch | git apply && \
42+
git apply $SRC_DIR/a6cb8215a80635129e4fada4c0d25c25fb746bf7.patch && \
2843
# ovsdb-tool: add command fix-cluster
29-
curl -s https://github.com/kubeovn/ovs/commit/d4d76ddb2e12cdd9e73bb5e008ebb9fd1b4d6ca6.patch | git apply && \
44+
git apply $SRC_DIR/d4d76ddb2e12cdd9e73bb5e008ebb9fd1b4d6ca6.patch && \
3045
# netdev: reduce cpu utilization for getting device addresses
31-
curl -s https://github.com/kubeovn/ovs/commit/ffd2328d4a55271569e2b89e54a2c18f4e186af8.patch | git apply && \
46+
git apply $SRC_DIR/ffd2328d4a55271569e2b89e54a2c18f4e186af8.patch && \
3247
# ovs-router: skip getting source address for kube-ipvs0
33-
curl -s https://github.com/kubeovn/ovs/commit/d088c5d8c263552c5a31d87813991aee30ab74de.patch | git apply && \
48+
git apply $SRC_DIR/d088c5d8c263552c5a31d87813991aee30ab74de.patch && \
3449
# increase the default probe interval for large cluster
35-
curl -s https://github.com/kubeovn/ovs/commit/1b31f07dc60c016153fa35d936cdda0e02e58492.patch | git apply
50+
git apply $SRC_DIR/1b31f07dc60c016153fa35d936cdda0e02e58492.patch
3651

3752
RUN cd /usr/src/ && git clone -b branch-24.03 --depth=1 https://github.com/ovn-org/ovn.git && \
3853
cd ovn && \
3954
# change hash type from dp_hash to hash with field src_ip
40-
curl -s https://github.com/kubeovn/ovn/commit/e490f5ac0b644101913c2a3db8e03d85e859deff.patch | git apply && \
55+
git apply $SRC_DIR/e490f5ac0b644101913c2a3db8e03d85e859deff.patch && \
4156
# modify src route priority
42-
curl -s https://github.com/kubeovn/ovn/commit/b973ec477b43df1c3ef3cdb69f8646948fcf94ae.patch | git apply && \
57+
git apply $SRC_DIR/b973ec477b43df1c3ef3cdb69f8646948fcf94ae.patch && \
4358
# fix reaching resubmit limit in underlay
44-
curl -s https://github.com/kubeovn/ovn/commit/5593e614e51a5dce28941e5bf760f9ee5397cede.patch | git apply && \
59+
git apply $SRC_DIR/5593e614e51a5dce28941e5bf760f9ee5397cede.patch && \
4560
# ovn-controller: do not send GARP on localnet for Kube-OVN ports
46-
curl -s https://github.com/kubeovn/ovn/commit/f9e97031b56ab5747b5d73629198331a6daacdfd.patch | git apply
61+
git apply $SRC_DIR/f9e97031b56ab5747b5d73629198331a6daacdfd.patch
4762

4863
RUN apt install -y build-essential fakeroot \
4964
autoconf automake bzip2 debhelper-compat dh-exec dh-python dh-sequence-python3 dh-sequence-sphinxdoc \
@@ -92,7 +107,7 @@ RUN mkdir /packages/ && \
92107
FROM ubuntu:24.04
93108

94109
ARG DEBIAN_FRONTEND=noninteractive
95-
ENV PIP_BREAK_SYSTEM_PACKAGES=1
110+
ARG PIP_BREAK_SYSTEM_PACKAGES=1
96111

97112
RUN apt update && apt upgrade -y && apt install ca-certificates python3 hostname libunwind8 netbase \
98113
ethtool iproute2 ncat libunbound8 procps libatomic1 kmod iptables python3-netifaces python3-sortedcontainers \
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
From 03e35ed9c5b4de0fa8acbc2c057cdd5957a8d605 Mon Sep 17 00:00:00 2001
2+
From: zhangzujian <zhangzujian.7@gmail.com>
3+
Date: Thu, 10 Apr 2025 01:31:33 +0000
4+
Subject: [PATCH] ovn-controller: make activation strategy work for single
5+
chassis
6+
7+
Signed-off-by: zhangzujian <zhangzujian.7@gmail.com>
8+
---
9+
controller/lport.c | 4 ++++
10+
1 file changed, 4 insertions(+)
11+
12+
diff --git a/controller/lport.c b/controller/lport.c
13+
index b3721024b1..062b6612b1 100644
14+
--- a/controller/lport.c
15+
+++ b/controller/lport.c
16+
@@ -123,6 +123,10 @@ lport_can_bind_on_this_chassis(const struct sbrec_chassis *chassis_rec,
17+
const struct sbrec_port_binding *pb)
18+
{
19+
if (pb->requested_chassis == chassis_rec) {
20+
+ if (pb->n_requested_additional_chassis == 1 &&
21+
+ pb->requested_additional_chassis[0] == chassis_rec) {
22+
+ return CAN_BIND_AS_ADDITIONAL;
23+
+ }
24+
return CAN_BIND_AS_MAIN;
25+
}
26+
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
From 1b31f07dc60c016153fa35d936cdda0e02e58492 Mon Sep 17 00:00:00 2001
2+
From: oilbeater <liumengxinfly@gmail.com>
3+
Date: Sun, 30 Mar 2025 06:16:46 +0000
4+
Subject: [PATCH] increase the default probe to 60s
5+
6+
---
7+
lib/reconnect.h | 2 +-
8+
1 file changed, 1 insertion(+), 1 deletion(-)
9+
10+
diff --git a/lib/reconnect.h b/lib/reconnect.h
11+
index 40cc569c42d..fec413ef676 100644
12+
--- a/lib/reconnect.h
13+
+++ b/lib/reconnect.h
14+
@@ -43,7 +43,7 @@ void reconnect_set_name(struct reconnect *, const char *name);
15+
/* Defaults, all in msecs. */
16+
#define RECONNECT_DEFAULT_MIN_BACKOFF 1000
17+
#define RECONNECT_DEFAULT_MAX_BACKOFF 8000
18+
-#define RECONNECT_DEFAULT_PROBE_INTERVAL 5000
19+
+#define RECONNECT_DEFAULT_PROBE_INTERVAL 60000
20+
21+
int reconnect_get_min_backoff(const struct reconnect *);
22+
int reconnect_get_max_backoff(const struct reconnect *);

0 commit comments

Comments
 (0)