From 71027ad7edb1a8949d7442c64f0762ccdc86323b Mon Sep 17 00:00:00 2001 From: camrynl <31013536+camrynl@users.noreply.github.com> Date: Fri, 2 Sep 2022 10:13:03 -0700 Subject: [PATCH 1/6] build azure-ipam and zapai --- Makefile | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index a57ea83d97..9572a0c40f 100644 --- a/Makefile +++ b/Makefile @@ -53,7 +53,8 @@ CNS_DIR = $(REPO_ROOT)/cns/service NPM_DIR = $(REPO_ROOT)/npm/cmd OUTPUT_DIR = $(REPO_ROOT)/output BUILD_DIR = $(OUTPUT_DIR)/$(GOOS)_$(GOARCH) -AUZRE_IPAM_BUILD_DIR = $(BUILD_DIR)/azure-ipam +AZURE_IPAM_BUILD_DIR = $(BUILD_DIR)/azure-ipam +ZAPAI_BUILD_DIR = $(BUILD_DIR)/zapai IMAGE_DIR = $(OUTPUT_DIR)/images CNM_BUILD_DIR = $(BUILD_DIR)/cnm CNI_BUILD_DIR = $(BUILD_DIR)/cni @@ -74,6 +75,7 @@ ACN_PACKAGE_PATH = github.com/Azure/azure-container-networking CNI_AI_PATH=$(ACN_PACKAGE_PATH)/telemetry.aiMetadata CNS_AI_PATH=$(ACN_PACKAGE_PATH)/cns/logger.aiMetadata NPM_AI_PATH=$(ACN_PACKAGE_PATH)/npm.aiMetadata +ZAPAI_DIR = $(REPO_ROOT)/zapai/example # Tool paths CONTROLLER_GEN := $(TOOLS_BIN_DIR)/controller-gen @@ -115,10 +117,10 @@ all-binaries-platforms: ## Make all platform binaries # OS specific binaries/images ifeq ($(GOOS),linux) -all-binaries: acncli azure-cnm-plugin azure-cni-plugin azure-cns azure-npm +all-binaries: acncli azure-cnm-plugin azure-cni-plugin azure-cns azure-npm azure-ipam zapai all-images: npm-image cns-image cni-manager-image else -all-binaries: azure-cnm-plugin azure-cni-plugin azure-cns azure-npm +all-binaries: azure-cnm-plugin azure-cni-plugin azure-cns azure-npm azure-ipam zapai all-images: @echo "Nothing to build. Skip." endif @@ -130,6 +132,8 @@ azure-cns: azure-cns-binary cns-archive acncli: acncli-binary acncli-archive azure-cnms: azure-cnms-binary cnms-archive azure-npm: azure-npm-binary npm-archive +azure-ipam: azure-ipam-binary +zapai: zapai-binary ##@ Versioning @@ -164,7 +168,7 @@ zapai-version: ## prints the zapai version # Build the delegated IPAM plugin binary. azure-ipam-binary: - cd $(AZURE_IPAM_DIR) && CGO_ENABLED=0 go build -v -o $(AUZRE_IPAM_BUILD_DIR)/azure-ipam$(EXE_EXT) -ldflags "-X main.version=$(AZURE_IPAM_VERSION)" -gcflags="-dwarflocationlists=true" + cd $(AZURE_IPAM_DIR) && CGO_ENABLED=0 go build -v -o $(AZURE_IPAM_BUILD_DIR)/azure-ipam$(EXE_EXT) -ldflags "-X main.version=$(AZURE_IPAM_VERSION)" -gcflags="-dwarflocationlists=true" # Build the Azure CNM binary. cnm-binary: @@ -199,6 +203,9 @@ azure-npm-binary: cd $(CNI_TELEMETRY_DIR) && CGO_ENABLED=0 go build -v -o $(NPM_BUILD_DIR)/azure-vnet-telemetry$(EXE_EXT) -ldflags "-X main.version=$(NPM_VERSION)" -gcflags="-dwarflocationlists=true" cd $(NPM_DIR) && CGO_ENABLED=0 go build -v -o $(NPM_BUILD_DIR)/azure-npm$(EXE_EXT) -ldflags "-X main.version=$(NPM_VERSION) -X $(NPM_AI_PATH)=$(NPM_AI_ID)" -gcflags="-dwarflocationlists=true" +# Build the zapai binary. +zapai-binary: + cd $(ZAPAI_DIR) && CGO_ENABLED=0 go build -v -o $(ZAPAI_BUILD_DIR)/zapai$(EXE_EXT) -ldflags "-X main.version=$(ZAPAI_VERSION)" -gcflags="-dwarflocationlists=true" ##@ Containers From 5bfd1fa726c1e4d21cc68b64fb052cc3161b20cc Mon Sep 17 00:00:00 2001 From: camrynl <31013536+camrynl@users.noreply.github.com> Date: Fri, 2 Sep 2022 11:08:05 -0700 Subject: [PATCH 2/6] build ipam for linux only --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 9572a0c40f..4f98977b0b 100644 --- a/Makefile +++ b/Makefile @@ -120,7 +120,7 @@ ifeq ($(GOOS),linux) all-binaries: acncli azure-cnm-plugin azure-cni-plugin azure-cns azure-npm azure-ipam zapai all-images: npm-image cns-image cni-manager-image else -all-binaries: azure-cnm-plugin azure-cni-plugin azure-cns azure-npm azure-ipam zapai +all-binaries: azure-cnm-plugin azure-cni-plugin azure-cns azure-npm zapai all-images: @echo "Nothing to build. Skip." endif From 58528d147e8e46917a799533614580c529fbde7e Mon Sep 17 00:00:00 2001 From: camrynl <31013536+camrynl@users.noreply.github.com> Date: Fri, 2 Sep 2022 12:16:32 -0700 Subject: [PATCH 3/6] add archives --- Makefile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Makefile b/Makefile index 4f98977b0b..3286f9c599 100644 --- a/Makefile +++ b/Makefile @@ -97,6 +97,8 @@ CNI_BAREMETAL_ARCHIVE_NAME = azure-vnet-cni-baremetal-$(GOOS)-$(GOARCH)-$(CNI_VE CNM_ARCHIVE_NAME = azure-vnet-cnm-$(GOOS)-$(GOARCH)-$(ACN_VERSION).$(ARCHIVE_EXT) CNS_ARCHIVE_NAME = azure-cns-$(GOOS)-$(GOARCH)-$(CNS_VERSION).$(ARCHIVE_EXT) NPM_ARCHIVE_NAME = azure-npm-$(GOOS)-$(GOARCH)-$(NPM_VERSION).$(ARCHIVE_EXT) +AZURE_IPAM_ARCHIVE_NAME = azure-ipam-$(GOOS)-$(GOARCH)-$(AZURE_IPAM_VERSION).$(ARCHIVE_EXT) +ZAPAI_ARCHIVE_NAME = zapai-$(GOOS)-$(GOARCH)-$(ZAPAI_VERSION).$(ARCHIVE_EXT) # Image info file names. CNI_DROPGZ_IMAGE_INFO_FILE = cni-dropgz-$(CNI_DROPGZ_VERSION).txt @@ -593,6 +595,18 @@ ifeq ($(GOOS),linux) cd $(NPM_BUILD_DIR) && $(ARCHIVE_CMD) $(NPM_ARCHIVE_NAME) azure-npm$(EXE_EXT) endif +# Create a azure-ipam archive for the target platform. +.PHONY: azure-ipam-archive +npm-archive: azure-ipam-binary +ifeq ($(GOOS),linux) + cd $(AZURE_IPAM_BUILD_DIR) && $(ARCHIVE_CMD) $(AZURE_IPAM_ARCHIVE_NAME) azure-npm$(EXE_EXT) +endif + +# Create a zapai archive for the target platform. +.PHONY: zapai-archive +zapai-archive: zapai-binary + cd $(ZAPAI_BUILD_DIR) && $(ARCHIVE_CMD) $(ZAPAI_ARCHIVE_NAME) azure-vnet-plugin$(EXE_EXT) + ##@ Utils From ea83349352016239497a465cb8beb7cf0003b66a Mon Sep 17 00:00:00 2001 From: camrynl <31013536+camrynl@users.noreply.github.com> Date: Fri, 2 Sep 2022 12:43:41 -0700 Subject: [PATCH 4/6] remove zapai build --- Makefile | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 3286f9c599..00f1ce0801 100644 --- a/Makefile +++ b/Makefile @@ -54,7 +54,6 @@ NPM_DIR = $(REPO_ROOT)/npm/cmd OUTPUT_DIR = $(REPO_ROOT)/output BUILD_DIR = $(OUTPUT_DIR)/$(GOOS)_$(GOARCH) AZURE_IPAM_BUILD_DIR = $(BUILD_DIR)/azure-ipam -ZAPAI_BUILD_DIR = $(BUILD_DIR)/zapai IMAGE_DIR = $(OUTPUT_DIR)/images CNM_BUILD_DIR = $(BUILD_DIR)/cnm CNI_BUILD_DIR = $(BUILD_DIR)/cni @@ -75,7 +74,6 @@ ACN_PACKAGE_PATH = github.com/Azure/azure-container-networking CNI_AI_PATH=$(ACN_PACKAGE_PATH)/telemetry.aiMetadata CNS_AI_PATH=$(ACN_PACKAGE_PATH)/cns/logger.aiMetadata NPM_AI_PATH=$(ACN_PACKAGE_PATH)/npm.aiMetadata -ZAPAI_DIR = $(REPO_ROOT)/zapai/example # Tool paths CONTROLLER_GEN := $(TOOLS_BIN_DIR)/controller-gen @@ -98,7 +96,6 @@ CNM_ARCHIVE_NAME = azure-vnet-cnm-$(GOOS)-$(GOARCH)-$(ACN_VERSION).$(ARCHIVE_EXT CNS_ARCHIVE_NAME = azure-cns-$(GOOS)-$(GOARCH)-$(CNS_VERSION).$(ARCHIVE_EXT) NPM_ARCHIVE_NAME = azure-npm-$(GOOS)-$(GOARCH)-$(NPM_VERSION).$(ARCHIVE_EXT) AZURE_IPAM_ARCHIVE_NAME = azure-ipam-$(GOOS)-$(GOARCH)-$(AZURE_IPAM_VERSION).$(ARCHIVE_EXT) -ZAPAI_ARCHIVE_NAME = zapai-$(GOOS)-$(GOARCH)-$(ZAPAI_VERSION).$(ARCHIVE_EXT) # Image info file names. CNI_DROPGZ_IMAGE_INFO_FILE = cni-dropgz-$(CNI_DROPGZ_VERSION).txt @@ -119,10 +116,10 @@ all-binaries-platforms: ## Make all platform binaries # OS specific binaries/images ifeq ($(GOOS),linux) -all-binaries: acncli azure-cnm-plugin azure-cni-plugin azure-cns azure-npm azure-ipam zapai +all-binaries: acncli azure-cnm-plugin azure-cni-plugin azure-cns azure-npm azure-ipam all-images: npm-image cns-image cni-manager-image else -all-binaries: azure-cnm-plugin azure-cni-plugin azure-cns azure-npm zapai +all-binaries: azure-cnm-plugin azure-cni-plugin azure-cns azure-npm all-images: @echo "Nothing to build. Skip." endif @@ -135,7 +132,6 @@ acncli: acncli-binary acncli-archive azure-cnms: azure-cnms-binary cnms-archive azure-npm: azure-npm-binary npm-archive azure-ipam: azure-ipam-binary -zapai: zapai-binary ##@ Versioning @@ -205,10 +201,6 @@ azure-npm-binary: cd $(CNI_TELEMETRY_DIR) && CGO_ENABLED=0 go build -v -o $(NPM_BUILD_DIR)/azure-vnet-telemetry$(EXE_EXT) -ldflags "-X main.version=$(NPM_VERSION)" -gcflags="-dwarflocationlists=true" cd $(NPM_DIR) && CGO_ENABLED=0 go build -v -o $(NPM_BUILD_DIR)/azure-npm$(EXE_EXT) -ldflags "-X main.version=$(NPM_VERSION) -X $(NPM_AI_PATH)=$(NPM_AI_ID)" -gcflags="-dwarflocationlists=true" -# Build the zapai binary. -zapai-binary: - cd $(ZAPAI_DIR) && CGO_ENABLED=0 go build -v -o $(ZAPAI_BUILD_DIR)/zapai$(EXE_EXT) -ldflags "-X main.version=$(ZAPAI_VERSION)" -gcflags="-dwarflocationlists=true" - ##@ Containers ## Common variables for all containers. @@ -602,11 +594,6 @@ ifeq ($(GOOS),linux) cd $(AZURE_IPAM_BUILD_DIR) && $(ARCHIVE_CMD) $(AZURE_IPAM_ARCHIVE_NAME) azure-npm$(EXE_EXT) endif -# Create a zapai archive for the target platform. -.PHONY: zapai-archive -zapai-archive: zapai-binary - cd $(ZAPAI_BUILD_DIR) && $(ARCHIVE_CMD) $(ZAPAI_ARCHIVE_NAME) azure-vnet-plugin$(EXE_EXT) - ##@ Utils From c8b7e382f8c50a06cf85201c3059d87497a67ef2 Mon Sep 17 00:00:00 2001 From: camrynl <31013536+camrynl@users.noreply.github.com> Date: Fri, 2 Sep 2022 13:36:43 -0700 Subject: [PATCH 5/6] update azure-ipam archive --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 00f1ce0801..c3c65b1832 100644 --- a/Makefile +++ b/Makefile @@ -589,9 +589,9 @@ endif # Create a azure-ipam archive for the target platform. .PHONY: azure-ipam-archive -npm-archive: azure-ipam-binary +azure-ipam-archive: azure-ipam-binary ifeq ($(GOOS),linux) - cd $(AZURE_IPAM_BUILD_DIR) && $(ARCHIVE_CMD) $(AZURE_IPAM_ARCHIVE_NAME) azure-npm$(EXE_EXT) + cd $(AZURE_IPAM_BUILD_DIR) && $(ARCHIVE_CMD) $(AZURE_IPAM_ARCHIVE_NAME) azure-ipam$(EXE_EXT) endif From 6d4a4a1e9036f550463bf76483cc6a0a4dc10a37 Mon Sep 17 00:00:00 2001 From: camrynl <31013536+camrynl@users.noreply.github.com> Date: Fri, 2 Sep 2022 14:41:10 -0700 Subject: [PATCH 6/6] test --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c3c65b1832..a712ab28d2 100644 --- a/Makefile +++ b/Makefile @@ -131,7 +131,7 @@ azure-cns: azure-cns-binary cns-archive acncli: acncli-binary acncli-archive azure-cnms: azure-cnms-binary cnms-archive azure-npm: azure-npm-binary npm-archive -azure-ipam: azure-ipam-binary +azure-ipam: azure-ipam-binary azure-ipam-archive ##@ Versioning @@ -591,6 +591,7 @@ endif .PHONY: azure-ipam-archive azure-ipam-archive: azure-ipam-binary ifeq ($(GOOS),linux) + $(MKDIR) $(AZURE_IPAM_BUILD_DIR) cd $(AZURE_IPAM_BUILD_DIR) && $(ARCHIVE_CMD) $(AZURE_IPAM_ARCHIVE_NAME) azure-ipam$(EXE_EXT) endif