Skip to content

Commit

Permalink
Add support to run Windows OVS in container
Browse files Browse the repository at this point in the history
For antrea-io#4952

Signed-off-by: Shuyang Xin <[email protected]>
Signed-off-by: Naman Agarwal <[email protected]>
Signed-off-by: Kumar Atish <[email protected]>
  • Loading branch information
Atish-iaf committed Jul 25, 2023
1 parent 09ff732 commit 1eb9e12
Show file tree
Hide file tree
Showing 17 changed files with 598 additions and 43 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ CNI_BINARIES_VERSION := $(shell head -n 1 build/images/deps/cni-binaries-version
NANOSERVER_VERSION := $(shell head -n 1 build/images/deps/nanoserver-version)
BUILD_TAG := $(shell build/images/build-tag.sh)
WIN_BUILD_TAG := $(shell echo $(GO_VERSION) $(CNI_BINARIES_VERSION) $(NANOSERVER_VERSION)|md5sum|head -c 10)
WIN_OVS_VERSION := $(shell head -n 1 build/images/deps/ovs-version-windows)
WIN_BUILD_OVS_TAG := $(NANOSERVER_VERSION)-$(WIN_OVS_VERSION)
GIT_HOOKS := $(shell find hack/git_client_side_hooks -type f -print)
DOCKER_NETWORK ?= default
TRIVY_TARGET_IMAGE ?=
Expand All @@ -29,6 +31,7 @@ WIN_BUILD_ARGS := --build-arg GO_VERSION=$(GO_VERSION)
WIN_BUILD_ARGS += --build-arg CNI_BINARIES_VERSION=$(CNI_BINARIES_VERSION)
WIN_BUILD_ARGS += --build-arg NANOSERVER_VERSION=$(NANOSERVER_VERSION)
WIN_BUILD_ARGS += --build-arg WIN_BUILD_TAG=$(WIN_BUILD_TAG)
WIN_BUILD_ARGS += --build-arg WIN_BUILD_OVS_TAG=$(WIN_BUILD_OVS_TAG)

.PHONY: all
all: build
Expand Down Expand Up @@ -383,6 +386,7 @@ manifest:
$(CURDIR)/hack/generate-standard-manifests.sh --mode dev --out build/yamls
$(CURDIR)/hack/generate-manifest-windows.sh --mode dev > build/yamls/antrea-windows.yml
$(CURDIR)/hack/generate-manifest-windows.sh --mode dev --containerd > build/yamls/antrea-windows-containerd.yml
$(CURDIR)/hack/generate-manifest-windows.sh --mode dev --containerd --include-ovs > build/yamls/antrea-windows-containerd-with-ovs.yml
$(CURDIR)/hack/generate-manifest-flow-aggregator.sh --mode dev > build/yamls/flow-aggregator.yml

.PHONY: manifest-scale
Expand Down
8 changes: 8 additions & 0 deletions build/images/Dockerfile.build.windows
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

ARG WIN_BUILD_TAG
ARG NANOSERVER_VERSION
ARG WIN_BUILD_OVS_TAG

FROM antrea/base-windows:${WIN_BUILD_TAG} as antrea-build-windows

Expand All @@ -27,6 +28,8 @@ COPY . /antrea

RUN sh -c 'make windows-bin'

FROM antrea/windows-ovs:${WIN_BUILD_OVS_TAG} as windows-ovs

FROM mcr.microsoft.com/powershell:lts-nanoserver-${NANOSERVER_VERSION}
SHELL ["pwsh", "-NoLogo", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

Expand All @@ -44,3 +47,8 @@ COPY --from=antrea-build-windows /antrea/bin/antrea-cni.exe /k/antrea/cni/antre

RUN mkdir C:\k\antrea\utils
COPY --from=antrea-build-windows /wins/wins.exe /k/antrea/utils/wins.exe

COPY --from=windows-ovs /Windows/System32/vcruntime140.dll /Windows/System32/
COPY --from=windows-ovs /Windows/System32/libeay32.dll /Windows/System32/
COPY --from=windows-ovs /Windows/System32/ssleay32.dll /Windows/System32/
COPY --from=windows-ovs /openvswitch/usr/bin /k/antrea/bin/
Loading

0 comments on commit 1eb9e12

Please sign in to comment.