Skip to content

Commit

Permalink
Upgrade OVS to 2.14.0 (antrea-io#1121)
Browse files Browse the repository at this point in the history
* Upgrade OVS version in repo to 2.14.0
* Reorganize apply-patches.sh
  • Loading branch information
lzhecheng authored and antoninbas committed Sep 3, 2020
1 parent e482e01 commit e3461e1
Show file tree
Hide file tree
Showing 12 changed files with 43 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/update_ovs_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
OVS_VERSION: 2.13.1
OVS_VERSION: 2.14.0
run: |
cd build/images/ovs/
docker pull antrea/openvswitch-debs:$OVS_VERSION || true
Expand Down
2 changes: 1 addition & 1 deletion build/images/Dockerfile.build.ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ COPY . /antrea
RUN make antrea-agent antrea-controller antrea-cni antctl-ubuntu


FROM antrea/base-ubuntu:2.13.1
FROM antrea/base-ubuntu:2.14.0

LABEL maintainer="Antrea <[email protected]>"
LABEL description="The Docker image to deploy the Antrea CNI. "
Expand Down
2 changes: 1 addition & 1 deletion build/images/Dockerfile.ubuntu
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM antrea/base-ubuntu:2.13.1
FROM antrea/base-ubuntu:2.14.0

LABEL maintainer="Antrea <[email protected]>"
LABEL description="The Docker image to deploy the Antrea CNI. "
Expand Down
2 changes: 1 addition & 1 deletion build/images/base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG OVS_VERSION=2.13.1
ARG OVS_VERSION=2.14.0
FROM ubuntu:20.04 as cni-binaries

RUN apt-get update && \
Expand Down
2 changes: 1 addition & 1 deletion build/images/base/build_and_push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function echoerr {
}

if [ -z "$OVS_VERSION" ]; then
echoerr "The OVS_VERSION env variable must be set to a valid value (e.g. 2.13.1)"
echoerr "The OVS_VERSION env variable must be set to a valid value (e.g. 2.14.0)"
exit 1
fi

Expand Down
2 changes: 1 addition & 1 deletion build/images/ovs/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM ubuntu:20.04 as ovs-debs

# Some patches may not apply cleanly if another version is provided.
ARG OVS_VERSION=2.13.1
ARG OVS_VERSION=2.14.0

# Install dependencies for building OVS deb packages
# We only install python3 packages and we only support building OVS >= 2.13.0.
Expand Down
2 changes: 1 addition & 1 deletion build/images/ovs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ directory. For example:

```bash
cd build/images/ovs
OVS_VERSION=2.13.1 ./build_and_push.sh
OVS_VERSION=2.14.0 ./build_and_push.sh
```

The image will be pushed to Dockerhub as `antrea/openvswitch:$OVS_VERSION`.
Expand Down
58 changes: 30 additions & 28 deletions build/images/ovs/apply-patches.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,48 +35,50 @@ function version_let() { test "$(printf '%s\n' "$@" | sort -V | head -n 1)" == "
# greater than or equal to
function version_get() { test "$(printf '%s\n' "$@" | sort -rV | head -n 1)" == "$1"; }

if version_lt "$OVS_VERSION" "2.13.0" || version_gt "$OVS_VERSION" "2.13.1"; then
echoerr "OVS_VERSION $OVS_VERSION is not supported (must be >= 2.13.0 and <= 2.13.1)"
if version_lt "$OVS_VERSION" "2.13.0" || version_gt "$OVS_VERSION" "2.14.0"; then
echoerr "OVS_VERSION $OVS_VERSION is not supported (must be >= 2.13.0 and <= 2.14.0)"
exit 1
fi

# We cannot use 3-way merge unless we are in a git repository. If we need 3-way
# merge, we will need to clone the repository with git instead of downloading a
# release tarball (see Dockerfile).

# These 2 patches (post 2.13.x) ensures that datapath flows are not deleted on
# ovs-vswitchd exit by default. Antrea relies on this to support hitless upgrade
# of the Agent DaemonSet.
# The second patch depends on the first one.
curl https://github.com/openvswitch/ovs/commit/586cd3101e7fda54d14fb5bf12d847f35d968627.patch | \
git apply
# We exclude 2 files which are likely to cause conflicts.
curl https://github.com/openvswitch/ovs/commit/79eadafeb1b47a3871cb792aa972f6e4d89d1a0b.patch | \
git apply --exclude NEWS --exclude vswitchd/ovs-vswitchd.8.in

# This patch (post 2.13.x) ensures that ovs-vswitchd does not delete datapath
# ports on exit.
curl https://github.com/openvswitch/ovs/commit/7cc77b301f80a63cd4893198d82be0eef303f731.patch | \
git apply

# This patch (post 2.13.0) ensures that ct_nw_src/ct_nw_dst supports IP Mask.
if version_let "$OVS_VERSION" "2.13.0"; then
curl https://github.com/openvswitch/ovs/commit/1740aaf49dad6f533705dc3dce8d955a1840052a.patch | \
git apply
fi

# These patches (post 2.13.x) are needed to fix the debian build on Ubuntu 20.04.
curl https://github.com/openvswitch/ovs/commit/c101cd4171cfe04e214f858b4bbe089e56f13f9b.patch | \
git apply
curl https://github.com/openvswitch/ovs/commit/3c18bb0fe9f23308061217f72e2245f0e311b20b.patch | \
git apply
curl https://github.com/openvswitch/ovs/commit/fe175ac17352ceb2dbc9958112b4b1bc114d82f0.patch | \
git apply
if version_get "$OVS_VERSION" "2.13.0" && version_lt "$OVS_VERSION" "2.14.0" ; then
# These 2 patches (post 2.13.x) ensures that datapath flows are not deleted on
# ovs-vswitchd exit by default. Antrea relies on this to support hitless upgrade
# of the Agent DaemonSet.
# The second patch depends on the first one.
curl https://github.com/openvswitch/ovs/commit/586cd3101e7fda54d14fb5bf12d847f35d968627.patch | \
git apply
# We exclude 2 files which are likely to cause conflicts.
curl https://github.com/openvswitch/ovs/commit/79eadafeb1b47a3871cb792aa972f6e4d89d1a0b.patch | \
git apply --exclude NEWS --exclude vswitchd/ovs-vswitchd.8.in

# This patch (post 2.13.x) ensures that ovs-vswitchd does not delete datapath
# ports on exit.
curl https://github.com/openvswitch/ovs/commit/7cc77b301f80a63cd4893198d82be0eef303f731.patch | \
git apply

# The OVS ovs-monitor-ipsec script has a Python3 shebang but still includes some Python2-specific code.
# Until the patch which fixes the script is merged upstream, we apply it here, or Antrea IPsec support will be broken.
curl https://github.com/lzhecheng/ovs/commit/869b06356e389079861962160e864df609d033e5.patch | \
git apply
# These patches (post 2.13.x) are needed to fix the debian build on Ubuntu 20.04.
curl https://github.com/openvswitch/ovs/commit/c101cd4171cfe04e214f858b4bbe089e56f13f9b.patch | \
git apply
curl https://github.com/openvswitch/ovs/commit/3c18bb0fe9f23308061217f72e2245f0e311b20b.patch | \
git apply
curl https://github.com/openvswitch/ovs/commit/fe175ac17352ceb2dbc9958112b4b1bc114d82f0.patch | \
git apply

# The OVS ovs-monitor-ipsec script has a Python3 shebang but still includes some Python2-specific code.
# Until the patch which fixes the script is merged upstream, we apply it here, or Antrea IPsec support will be broken.
curl https://github.com/openvswitch/ovs/commit/8a09c2590ef2ea0edc250ec46e3d41bd5874b4ab.patch | \
git apply
fi

# OVS hardcodes the installation path to /usr/lib/python3.7/dist-packages/ but this location
# does not seem to be in the Python path in Ubuntu 20.04. There may be a better way to do this,
Expand Down
2 changes: 1 addition & 1 deletion build/images/ovs/build_and_push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function echoerr {
}

if [ -z "$OVS_VERSION" ]; then
echoerr "The OVS_VERSION env variable must be set to a valid value (e.g. 2.13.1)"
echoerr "The OVS_VERSION env variable must be set to a valid value (e.g. 2.14.0)"
exit 1
fi

Expand Down
2 changes: 1 addition & 1 deletion build/images/test/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM antrea/openvswitch:2.13.1
FROM antrea/openvswitch:2.14.0

LABEL maintainer="Antrea <[email protected]>"
LABEL description="A Docker image for antrea integration tests."
Expand Down
2 changes: 2 additions & 0 deletions ci/jenkins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ should be deleted. This ensures that all tests are run on a clean testbed.
* Jenkins jobs validator [gated check-in]: this job only executes for PRs that include changes to
[ci/jenkins/jobs](/ci/jenkins/jobs). It validates the syntax of the jenkins jobs'
configuration.
* Jenkins Windows OVS validator: this job only executes for PRs that include changes to [hack/windows/Install-OVS.ps1](hack/windows/Install-OVS.ps1). It validates
if Windows OVS can be installed correctly.
* [EKS conformance/network policy [bi-daily]](http://jenkins.antrea-ci.rocks/view/cloud/job/cloud-antrea-eks-conformance-net-policy/)
community tests on EKS cluster using sonobuoy, focusing on "Conformance" and "Feature:NetworkPolicy", skipping the same regexes as in job __conformance__ above, as well as "NodePort" (See [#690](https://github.com/vmware-tanzu/antrea/issues/690)).\
Current test environment matrix:
Expand Down
4 changes: 2 additions & 2 deletions hack/windows/Install-OVS.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ $ErrorActionPreference = "Stop"
# TODO: set up HTTPS so that the archive can be downloaded securely. In the
# meantime, we use a SHA256 hash to ensure that the downloaded archive is
# correct.
$OVSDownloadURL = "http://downloads.antrea.io/ovs/ovs-2.13.1-antrea.1-win64.zip"
$OVSPublishedHash = '83AA08526D947B08A952339B849441D4896AAB7437B4101CFBCE1130888FF459'
$OVSDownloadURL = "http://downloads.antrea.io/ovs/ovs-2.14.0-antrea.1-win64.zip"
$OVSPublishedHash = 'E81800A6B8E157C948BAE548E5AFB425B2AD98CE18BC8C6148AB5B7F81E76B7D'
$OVSDownloadDir = [System.IO.Path]::GetDirectoryName($myInvocation.MyCommand.Definition)
$InstallLog = "$OVSDownloadDir\install.log"
$OVSZip = "$OVSDownloadDir\ovs-win64.zip"
Expand Down

0 comments on commit e3461e1

Please sign in to comment.