Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 23 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ azure-ipam: azure-ipam-binary azure-ipam-archive

revision: ## print the current git revision
@echo $(REVISION)

version: ## prints the root version
@echo $(ACN_VERSION)

Expand All @@ -161,15 +161,15 @@ cni-dropgz-test-version: ## prints the cni-dropgz version
@echo $(CNI_DROPGZ_TEST_VERSION)

cns-version:
@echo $(CNS_VERSION)
@echo $(CNS_VERSION)

npm-version:
@echo $(NPM_VERSION)
@echo $(NPM_VERSION)

zapai-version: ## prints the zapai version
@echo $(ZAPAI_VERSION)

##@ Binaries
##@ Binaries

# Build the delegated IPAM plugin binary.
azure-ipam-binary:
Expand Down Expand Up @@ -509,8 +509,8 @@ manifest-build: # util target to compose multiarch container manifests from plat
$(MAKE) manifest-add PLATFORM=$(PLATFORM);\
)\
)\



manifest-push: # util target to push multiarch container manifest.
$(CONTAINER_BUILDER) manifest push --all $(IMAGE_REGISTRY)/$(IMAGE):$(TAG) docker://$(IMAGE_REGISTRY)/$(IMAGE):$(TAG)
Expand All @@ -534,7 +534,7 @@ acncli-manifest-push: ## push acncli multiplat container manifest
acncli-skopeo-archive: ## export tar archive of acncli multiplat container manifest.
$(MAKE) manifest-skopeo-archive \
IMAGE=$(ACNCLI_IMAGE) \
TAG=$(ACN_VERSION)
TAG=$(ACN_VERSION)

cni-dropgz-manifest-build: ## build cni-dropgz multiplat container manifest.
$(MAKE) manifest-build \
Expand Down Expand Up @@ -692,7 +692,7 @@ ifeq ($(GOOS),linux)
endif


##@ Utils
##@ Utils

clean: ## Clean build artifacts.
$(RMDIR) $(OUTPUT_DIR)
Expand Down Expand Up @@ -723,7 +723,7 @@ workspace: ## Set up the Go workspace.
go work use ./dropgz
go work use ./zapai

##@ Test
##@ Test

COVER_PKG ?= .
#Restart case is used for cni load test pipeline for restarting the nodes cluster.
Expand Down Expand Up @@ -762,6 +762,15 @@ test-azure-ipam: ## run the unit test for azure-ipam
kind:
kind create cluster --config ./test/kind/kind.yaml

test-k8se2e: test-k8se2e-build test-k8se2e-only ## Alias to run build and test

test-k8se2e-build: ## Build k8s e2e test suite
cd hack/scripts && bash ./k8se2e.sh $(GROUP) $(CLUSTER)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this work? Given we don't have variables Group or Cluster in the file ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, these scripts were heavily reliant on those arguments being present in command to begin with. Having a default did not provide any additional benefit.

cd ../..

test-k8se2e-only: ## Run k8s network conformance test, use TYPE=basic for only datapath tests
cd hack/scripts && bash ./k8se2e-tests.sh $(OS) $(TYPE)
cd ../..

##@ Utilities

Expand All @@ -781,7 +790,7 @@ gitconfig: ## configure the local git repository
setup: tools install-hooks gitconfig ## performs common required repo setup


##@ Tools
##@ Tools

$(TOOLS_DIR)/go.mod:
cd $(TOOLS_DIR); go mod init && go mod tidy
Expand All @@ -791,7 +800,7 @@ $(CONTROLLER_GEN): $(TOOLS_DIR)/go.mod

controller-gen: $(CONTROLLER_GEN) ## Build controller-gen

protoc:
protoc:
source ${REPO_ROOT}/scripts/install-protoc.sh

$(GOCOV): $(TOOLS_DIR)/go.mod
Expand Down Expand Up @@ -824,13 +833,13 @@ $(MOCKGEN): $(TOOLS_DIR)/go.mod

mockgen: $(MOCKGEN) ## Build mockgen

clean-tools:
clean-tools:
rm -r build/tools/bin

tools: acncli gocov gocov-xml go-junit-report golangci-lint gofumpt protoc ## Build bins for build tools


##@ Help
##@ Help

help: ## Display this help
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[0-9a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
8 changes: 4 additions & 4 deletions hack/aks/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ VNET ?= $(CLUSTER)
##@ Help

help: ## Display this help
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[0-9a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)


##@ Utilities

azlogin:
azlogin: ## Login and set account to $SUB
@$(AZCLI) login
@$(AZCLI) account set -s $(SUB)

azcfg:
azcfg: ## Set the $AZCLI to use aks-preview
@$(AZCLI) extension add --name aks-preview --yes
@$(AZCLI) extension update --name aks-preview

Expand Down Expand Up @@ -214,7 +214,7 @@ windows-cniv1-up: rg-up overlay-net-up ## Bring up a Windows CNIv1 cluster

@$(MAKE) set-kubeconf

linux-cniv1-up: rg-up overlay-net-up
linux-cniv1-up: rg-up overlay-net-up ## Bring up a Linux CNIv1 cluster
$(AZCLI) aks create -n $(CLUSTER) -g $(GROUP) -l $(REGION) \
--node-count $(NODE_COUNT) \
--node-vm-size $(VM_SIZE) \
Expand Down
61 changes: 61 additions & 0 deletions hack/scripts/k8se2e-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Taint Linux nodes so that windows tests do not run on them and ensure no LinuxOnly tests run on windows nodes
if [[ 'windows' == $OS ]]
then
SKIP="|LinuxOnly"
kubectl taint nodes -l kubernetes.azure.com/mode=system node-role.kubernetes.io/control-plane:NoSchedule
fi



if [[ 'basic' == $TYPE ]]
then
echo "Testing Datapath"
echo "./ginkgo --nodes=4 \
./e2e.test -- \
--num-nodes=2 \
--provider=skeleton \
--ginkgo.focus='(.*).Networking.should|(.*).Networking.Granular|(.*)kubernetes.api' \
--ginkgo.skip='SCTP|Disruptive|Slow|hostNetwork|kube-proxy|IPv6' \
--ginkgo.flakeAttempts=3 \
--ginkgo.v \
--node-os-distro=$OS \
--kubeconfig=$HOME/.kube/config"
./ginkgo --nodes=4 \
./e2e.test -- \
--num-nodes=2 \
--provider=skeleton \
--ginkgo.focus='(.*).Networking.should|(.*).Networking.Granular|(.*)kubernetes.api' \
--ginkgo.skip='SCTP|Disruptive|Slow|hostNetwork|kube-proxy|IPv6' \
--ginkgo.flakeAttempts=3 \
--ginkgo.v \
--node-os-distro=$OS \
--kubeconfig=$HOME/.kube/config
else
echo "Testing Datapath, DNS, PortForward, Service, and Hostport"
echo "./ginkgo --nodes=4 \
./e2e.test -- \
--num-nodes=2 \
--provider=skeleton \
--ginkgo.focus='(.*).Networking.should|(.*).Networking.Granular|(.*)kubernetes.api|\[sig-network\].DNS.should|\[sig-cli\].Kubectl.Port|Services.*\[Conformance\].*|\[sig-network\](.*)HostPort|\[sig-scheduling\](.*)hostPort' \
--ginkgo.skip='SCTP|Disruptive|Slow|hostNetwork|kube-proxy|IPv6|resolv|exists conflict$SKIP' \
--ginkgo.flakeAttempts=3 \
--ginkgo.v \
--node-os-distro=$OS \
--kubeconfig=$HOME/.kube/config"
./ginkgo --nodes=4 \
./e2e.test -- \
--num-nodes=2 \
--provider=skeleton \
--ginkgo.focus='(.*).Networking.should|(.*).Networking.Granular|(.*)kubernetes.api|\[sig-network\].DNS.should|\[sig-cli\].Kubectl.Port|Services.*\[Conformance\].*|\[sig-network\](.*)HostPort|\[sig-scheduling\](.*)hostPort' \
--ginkgo.skip="SCTP|Disruptive|Slow|hostNetwork|kube-proxy|IPv6|resolv|exists conflict$SKIP" \
--ginkgo.flakeAttempts=3 \
--ginkgo.v \
--node-os-distro=$OS \
--kubeconfig=$HOME/.kube/config
fi

# Untaint Linux nodes once testing is complete
if [[ 'windows' == $OS ]]
then
kubectl taint nodes -l kubernetes.azure.com/mode=system node-role.kubernetes.io/control-plane:NoSchedule-
fi
8 changes: 8 additions & 0 deletions hack/scripts/k8se2e.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
echo "Cluster -g $GROUP -n $CLUSTER"

eval k8sVersion="v"$( az aks show -g $GROUP -n $CLUSTER --query "currentKubernetesVersion")
echo $k8sVersion "e2e Test Suite"

curl -L https://dl.k8s.io/$k8sVersion/kubernetes-test-linux-amd64.tar.gz -o ./kubernetes-test-linux-amd64.tar.gz

tar -xvzf kubernetes-test-linux-amd64.tar.gz --strip-components=3 kubernetes/test/bin/ginkgo kubernetes/test/bin/e2e.test