Skip to content

Commit

Permalink
Release cce-network-v1/1.4.6
Browse files Browse the repository at this point in the history
  • Loading branch information
gola committed Feb 9, 2024
1 parent eb63098 commit 4dacd7a
Show file tree
Hide file tree
Showing 175 changed files with 2,194 additions and 22,535 deletions.
18 changes: 8 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ OUTDIR := $(HOMEDIR)/output
GO := $(GO_1_18_BIN)/go
ifeq ($(GO), /go)
GO = go
endif
endif
GOROOT := $(GO_1_18_HOME)
GOPATH := $(shell $(GO) env GOPATH)
GOMOD := $(GO) mod
GOARCH := $(shell $(GO) env GOARCH)
GOBUILD = CGO_ENABLED=0 GOOS=linux GOARCH=$(GOARCH) $(GO) build
GOTEST := $(GO) test
GOPKGS := $$($(GO) list ./...| grep "pkg" |grep -v "vendor" | grep -v "cmd" |grep -v "test" | grep -v 'api' |grep -v "generated" | grep -v 'pkg/bce' | grep -v config | grep -v metric | grep -v rpc | grep -v version | grep -v wrapper | grep -v util | grep -v testing)
GOPKGS := $$($(GO) list ./...| grep -vE "vendor" | grep -vE "cmd" |grep -vE "test" |grep -v 'apis/networking'| grep -v 'generated')
GOGCFLAGS := -gcflags=all="-trimpath=$(GOPATH)" -asmflags=all="-trimpath=$(GOPATH)"
GOLDFLAGS := -ldflags '-s -w'
GO_PACKAGE := github.com/baidubce/baiducloud-cce-cni-driver
Expand All @@ -23,7 +23,7 @@ COVFUNC := $(HOMEDIR)/covfunc.txt # coverage profile information for each funct
COVHTML := $(HOMEDIR)/covhtml.html # HTML representation of coverage profile

# versions
VERSION := v1.9.6
VERSION := v1.4.6
FELIX_VERSION := v3.5.8
K8S_VERSION := 1.18.9

Expand All @@ -41,16 +41,16 @@ EXTRALDFLAGS += -X $(GO_PACKAGE)/pkg/version.Version=$(VERSION)
# pro or dev
PROFILES := dev
IMAGE_TAG := registry.baidubce.com/cce-plugin-$(PROFILES)/cce-cni
PUSH_CNI_IMAGE_FLAGS = --push
PUSH_CNI_IMAGE_FLAGS = --load --push

# make, make all
all: prepare compile

fmt: ## Run go fmt against code.
$(GO) fmt $(shell $(GO) list ./... | grep -v /vendor/)
$(GO) fmt $(shell go list ./... | grep -v /vendor/)

vet: ## Run go vet against code.
$(GO) vet $(shell $(GO) list ./... | grep -v /vendor/)
$(GO) vet $(shell go list ./... | grep -v /vendor/)

# set proxy env
set-env:
Expand All @@ -68,19 +68,17 @@ gomod: set-env
outdir:
mkdir -p $(OUTDIR)/cni-bin
# Compile all cni plug-ins
cni_target := eni-ipam ipvlan macvlan bandwidth ptp sysctl unnumbered-ptp crossvpc-eni rdma eri roce
cni_target := eni-ipam ipvlan macvlan bandwidth ptp sysctl unnumbered-ptp crossvpc-eni
$(cni_target): fmt outdir
@echo "===> Building cni $@ <==="
$(GOBUILD) $(GOLDFLAGS) $(GOGCFLAGS) -o $(HOMEDIR)/$@ $(HOMEDIR)/cni/$@
strip $(HOMEDIR)/$@
mv $(HOMEDIR)/$@ $(OUTDIR)/cni-bin/

# Compile all container network programs
exec_target := cce-ipam cni-node-agent ip-masq-agent
$(exec_target): fmt outdir
@echo "===> Building cni $@ <==="
$(GOBUILD) $(GOLDFLAGS) $(GOGCFLAGS) -ldflags '$(EXTRALDFLAGS)' -o $(HOMEDIR)/$@ $(HOMEDIR)/cmd/$@
strip $(HOMEDIR)/$@
mv $(HOMEDIR)/$@ $(OUTDIR)

#make compile
Expand All @@ -90,7 +88,7 @@ build: compile
# make test, test your code
test: prepare test-case
test-case:
$(GOTEST) -v -cover -parallel 16 $(GOPKGS)
$(GOTEST) -v -cover $(GOPKGS)

debian-iptables-image:
@echo "===> Building debian iptables base image <==="
Expand Down
8 changes: 3 additions & 5 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
#!/bin/bash

rm -rf output

export PATH=/opt/compiler/gcc-8.2/bin:$PATH
make -f Makefile prepare compile GOARCH=amd64
mv output amd64
make -f Makefile prepare compile GOARCH=arm64
mv output arm64

mkdir -p output
mv arm64 output
mv amd64 output

mv arm64 output/arm64
mv amd64 output/amd64
9 changes: 2 additions & 7 deletions build/images/cce-cni/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM registry.baidubce.com/cce-plugin-pro/cce-cni-base:v1.0.0-slim
FROM registry.baidubce.com/cce-plugin-pro/cce-cni-base:v1.0.0

LABEL maintainer="Chen Yaqi<[email protected]>"

Expand All @@ -11,9 +11,6 @@ COPY output/cni-bin/ptp /ptp
COPY output/cni-bin/eni-ipam /eni-ipam
COPY output/cni-bin/sysctl /sysctl
COPY output/cni-bin/crossvpc-eni /crossvpc-eni
COPY output/cni-bin/rdma /rdma
COPY output/cni-bin/eri /eri
COPY output/cni-bin/roce /roce

# install cce ipam binary
COPY output/cce-ipam /bin/cce-ipam
Expand All @@ -24,6 +21,4 @@ COPY output/cni-node-agent /bin/cni-node-agent
# install cce node agent binary
COPY output/ip-masq-agent /bin/cce-ip-masq-agent

COPY build/images/cce-cni/entrypoint.sh /entrypoint.sh

CMD ["/bin/sh", "/entrypoint.sh"]
CMD ["/bin/bash", "/entrypoint.sh"]
1 change: 0 additions & 1 deletion build/images/cce-cni/arm64.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ COPY output/cni-bin/ptp /ptp
COPY output/cni-bin/eni-ipam /eni-ipam
COPY output/cni-bin/sysctl /sysctl
COPY output/cni-bin/crossvpc-eni /crossvpc-eni
COPY output/cni-bin/roce /roce

# install cce ipam binary
COPY output/cce-ipam /bin/cce-ipam
Expand Down
75 changes: 0 additions & 75 deletions build/images/cce-cni/entrypoint.sh

This file was deleted.

11 changes: 4 additions & 7 deletions build/images/cni-base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
FROM alpine:3.18
FROM cce-cni-debian-iptables:v1.0.0

LABEL maintainer="Chen Yaqi<[email protected]>"

RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories
RUN apk --no-cache add curl

# ensure cni bin from https://github.com/containernetworking/plugins/releases/download/v1.0.1/cni-plugins-linux-${arch}-v1.0.1.tgz
RUN arch=$(arch | sed s/aarch64/arm64/ | sed s/x86_64/amd64/) && \
curl -L -k --retry 5 https://github.com/containernetworking/plugins/releases/download/v1.0.1/cni-plugins-linux-${arch}-v1.0.1.tgz | tar -xz -C / ./loopback ./host-local ./portmap ./bridge

# install entrypoint.sh and uninstall-cni.sh
COPY entrypoint.sh /entrypoint.sh
COPY uninstall-cni.sh /uninstall-cni.sh
COPY build/images/cce-cni/entrypoint.sh /entrypoint.sh
COPY build/images/cce-cni/uninstall-cni.sh /uninstall-cni.sh

CMD ["/bin/sh", "/entrypoint.sh"]
CMD ["/bin/bash", "/entrypoint.sh"]
4 changes: 2 additions & 2 deletions build/images/cni-base/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/sh
#!/bin/bash
set -u -e

CNI_BINARY_DIR=/opt/cni/bin/
CNI_PLUGIN_LIST="bridge unnumbered-ptp ipvlan macvlan bandwidth loopback host-local ptp eni-ipam sysctl portmap crossvpc-eni rdma eri"
CNI_PLUGIN_LIST="bridge unnumbered-ptp ipvlan macvlan bandwidth loopback host-local ptp eni-ipam sysctl portmap crossvpc-eni"

# mv cni binary to dest
for PLUGIN in $CNI_PLUGIN_LIST
Expand Down
3 changes: 1 addition & 2 deletions build/images/codegen/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ RUN go env -w GO111MODULE="on" && \
go env -w GONOPROXY=\*\*.baidu.com\*\* && \
go env -w GONOSUMDB=\* && \
go env -w GOPROXY=https://goproxy.baidu-int.com && \
go env -w GOPRIVATE=\*.baidu.com && \
go env -w GOFLAGS="-mod=mod"
go env -w GOPRIVATE=\*.baidu.com

ARG K8S_VERSION=1.18.9

Expand Down
21 changes: 0 additions & 21 deletions build/yamls/cce-cni-driver/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -279,27 +279,6 @@ data:
"name":"{{ printf "{{ .NetworkName }}" }}",
"cniVersion":"0.3.1",
"plugins":[
{
"type":"ptp",
"enableARPProxy":true,
"vethPrefix":"veth",
"mtu": {{ printf "{{ .VethMTU }}" }},
"ipam":{
"type":"host-local",
"ranges":[
[
{
"subnet":"{{ printf "{{ .Subnet }}" }}"
}
]
],
"routes":[
{
"dst":"0.0.0.0/0"
}
]
}
},
{
"type": "crossvpc-eni",
"ifName": "eth0",
Expand Down
Loading

0 comments on commit 4dacd7a

Please sign in to comment.