Skip to content

Commit

Permalink
base: refactor ovn/ovs build (#1444)
Browse files Browse the repository at this point in the history
* base: refactor ovn/ovs build

Upgrade ovn/ovs to 22.03/2.17.0 to resolve the previous build failure. After upgrade the memory consumption for ovs-ovn startup drop from 1Gi to 200Mi. The reason that not upgrade ovs to 2.17.1 is that we will meet segment fault when startup
  • Loading branch information
oilbeater committed Apr 18, 2022
1 parent 4305116 commit 3a5ead6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
17 changes: 8 additions & 9 deletions dist/images/Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ RUN apt update && apt install build-essential git libnuma-dev autoconf curl \
flake8 python3-sphinx graphviz groff wget libjemalloc-dev -y

RUN cd /usr/src/ && \
git clone -b branch-2.16 --depth=1 https://github.com/openvswitch/ovs.git && \
git clone -b v2.17.0 --depth=1 https://github.com/openvswitch/ovs.git && \
cd ovs && \
# increase election timer
curl -s https://github.com/kubeovn/ovs/commit/22ea22c40b46ee5adeae977ff6cfca81b3ff25d7.patch | git apply && \
./boot.sh && \
rm -rf .git && \
Expand All @@ -22,14 +23,12 @@ RUN cd /usr/src/ && \

RUN dpkg -i /usr/src/python3-openvswitch*.deb /usr/src/libopenvswitch*.deb

RUN cd /usr/src/ && git clone -b branch-21.06 --depth=1 https://github.com/ovn-org/ovn.git && \
RUN cd /usr/src/ && git clone -b branch-22.03 --depth=1 https://github.com/ovn-org/ovn.git && \
cd ovn && \
curl -s https://github.com/kubeovn/ovn/commit/e24734913d25c0bffdf1cfd79e14ef43d01e1019.patch | git apply && \
curl -s https://github.com/kubeovn/ovn/commit/8f4e4868377afb5e980856755b9f6394f8b649e2.patch | git apply && \
curl -s https://github.com/kubeovn/ovn/commit/23a87cabb76fbdce5092a6b3d3b56f3fa8dd61f5.patch | git apply && \
curl -s https://github.com/kubeovn/ovn/commit/89ca60989df4af9a96cc6024e04f99b9b77bad22.patch | git apply && \
curl -s https://github.com/kubeovn/ovn/commit/aeafa43fc51be8ea1c7abfbe779c69205c1c5aa4.patch | git apply && \
curl -s https://github.com/kubeovn/ovn/commit/71f831b9cc5a6dc923af4ca90286857e2cf8b1d3.patch | git apply && \
# do not send traffic that not designate to svc to conntrack
curl -s https://github.com/kubeovn/ovn/commit/d26ae4de0ab070f6b602688ba808c8963f69d5c4.patch | git apply && \
# change hash type from dp_hash to hash with field src_ip
curl -s https://github.com/kubeovn/ovn/commit/ab923b252271cbbcccc8091e338ee7efe75e5fcd.patch | git apply && \
sed -i 's/OVN/ovn/g' debian/changelog && \
rm -rf .git && \
./boot.sh && \
Expand Down Expand Up @@ -63,7 +62,7 @@ RUN mkdir -p /var/run/openvswitch && \
mkdir -p /opt/cni/bin

ARG ARCH
ENV CNI_VERSION=v0.8.7
ENV CNI_VERSION=v1.0.1
RUN curl -sSf -L --retry 5 https://github.com/containernetworking/plugins/releases/download/${CNI_VERSION}/cni-plugins-linux-${ARCH}-${CNI_VERSION}.tgz | tar -xz -C . ./loopback ./portmap ./macvlan

RUN --mount=type=bind,target=/packages,from=ovs-builder,source=/packages \
Expand Down
2 changes: 1 addition & 1 deletion dist/images/Dockerfile.base-dpdk
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ RUN mkdir -p /var/run/openvswitch && \
mkdir -p /opt/cni/bin

ARG ARCH
ENV CNI_VERSION=v0.8.7
ENV CNI_VERSION=v1.0.1
RUN curl -sSf -L --retry 5 https://github.com/containernetworking/plugins/releases/download/${CNI_VERSION}/cni-plugins-linux-${ARCH}-${CNI_VERSION}.tgz | tar -xz -C . ./loopback ./portmap ./macvlan

RUN --mount=type=bind,target=/packages,from=ovs-builder,source=/packages \
Expand Down
2 changes: 1 addition & 1 deletion dist/images/Dockerfile.rpm
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ RUN mkdir -p /var/run/openvswitch && \
mkdir -p /opt/cni/bin

ARG ARCH
ENV CNI_VERSION=v0.8.6
ENV CNI_VERSION=v1.0.1
RUN curl -sSf -L --retry 5 https://github.com/containernetworking/plugins/releases/download/${CNI_VERSION}/cni-plugins-linux-${ARCH}-${CNI_VERSION}.tgz | tar -xz -C . ./loopback ./portmap

ENV KUBE_VERSION="v1.13.2"
Expand Down
2 changes: 1 addition & 1 deletion dist/images/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1867,7 +1867,7 @@ spec:
memory: 200Mi
limits:
cpu: 1000m
memory: 800Mi
memory: 1000Mi
nodeSelector:
kubernetes.io/os: "linux"
ovn.kubernetes.io/ovs_dp_type: kernel
Expand Down

0 comments on commit 3a5ead6

Please sign in to comment.