From 9c6b3ba355b67e6c6d5ae6c4c1f69ea780bb6da4 Mon Sep 17 00:00:00 2001 From: Chever John Date: Wed, 26 Jun 2024 00:58:44 +0800 Subject: [PATCH 1/9] chore: ignore goland .idea dir --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 6f5d1068..6b183b3e 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,4 @@ external/* e2e/log # helm charts manifests/charts/**/*.tgz +.idea \ No newline at end of file From 7131b292ffb86e6d1f4c5b705b7590ac3dcea842 Mon Sep 17 00:00:00 2001 From: Chever John Date: Wed, 26 Jun 2024 02:31:10 +0800 Subject: [PATCH 2/9] chore: finish the unite the bin cache dir for controller project --- controller/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controller/Makefile b/controller/Makefile index 9f3db4f9..6255ec84 100644 --- a/controller/Makefile +++ b/controller/Makefile @@ -89,7 +89,7 @@ KIND ?= kind ##@ Build Dependencies ## Location to install dependencies to -LOCALBIN ?= $(shell pwd)/bin +LOCALBIN ?= $(shell cd .. && pwd)/bin # Remember to remove tools downloaded into bin directory manually before updating them. # If they need to be updated frequently, we can consider to store them in the `Dockerfile.dev`. $(LOCALBIN): From 8a1bbb3f70d35e35f7b26b102f926e7fbda3dc4e Mon Sep 17 00:00:00 2001 From: Chever John Date: Wed, 26 Jun 2024 03:01:51 +0800 Subject: [PATCH 3/9] chore: finish the unite the bin cache dir for e2e project --- e2e/Makefile | 2 +- e2e/istio.sh | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/e2e/Makefile b/e2e/Makefile index b752a57f..1c05a8d0 100644 --- a/e2e/Makefile +++ b/e2e/Makefile @@ -14,7 +14,7 @@ include ../common.mk -LOCALBIN ?= $(shell pwd)/bin +LOCALBIN ?= $(shell cd .. && pwd)/bin $(LOCALBIN): @mkdir -p $(LOCALBIN) diff --git a/e2e/istio.sh b/e2e/istio.sh index aec88d36..4d2bf13a 100755 --- a/e2e/istio.sh +++ b/e2e/istio.sh @@ -17,7 +17,9 @@ set -eo pipefail set -x -HELM="$(pwd)/bin/helm" +PARENT_DIR="$(cd .. && pwd)" + +HELM="${PARENT_DIR}/bin/helm" E2E_DIR="$(pwd)" install() { From f6be1748b0d28340425ee196a491bd30852a904c Mon Sep 17 00:00:00 2001 From: Chever John Date: Wed, 26 Jun 2024 13:02:31 +0800 Subject: [PATCH 4/9] chore: update test.yml in .github --- .github/workflows/test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6914651d..7b2674ba 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -178,7 +178,7 @@ jobs: - name: binary cache uses: actions/cache@v4 with: - path: ./controller/bin + path: ./bin key: ${{ runner.os }}-${{ hashFiles('./controller/Makefile') }} - name: Set up services @@ -261,13 +261,13 @@ jobs: - name: binary cache uses: actions/cache@v4 with: - path: ./e2e/bin + path: ./bin key: ${{ runner.os }}-${{ hashFiles('./Makefile') }} - name: binary cache (for controller) uses: actions/cache@v4 with: - path: ./controller/bin + path: ./bin key: ${{ runner.os }}-${{ hashFiles('./controller/Makefile') }} - name: Prepare cluster From 3edbe2975e4035dfe852f690048d4bcaed013b4d Mon Sep 17 00:00:00 2001 From: Chever John Date: Sun, 30 Jun 2024 09:35:08 +0800 Subject: [PATCH 5/9] chore(makefile): use realpath to replace the $LOCALBIN var replace `LOCALBIN ?=$(cd .. && pwd)/bin` to the ```makefile ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) LOCALBIN := $(ROOT_DIR)/bin ``` --- common.mk | 5 +++++ controller/Makefile | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/common.mk b/common.mk index 1ee17b5c..7dd827cd 100644 --- a/common.mk +++ b/common.mk @@ -16,6 +16,11 @@ SHELL = /bin/bash OS = $(shell uname) IN_CI ?= +ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) +LOCALBIN := $(ROOT_DIR)/bin +$(LOCALBIN): + @mkdir -p $(LOCALBIN) + TARGET_SO = libgolang.so PROJECT_NAME = mosn.io/htnn # Both images use glibc 2.31. Ensure libc in the images match each other. diff --git a/controller/Makefile b/controller/Makefile index 6255ec84..b658e855 100644 --- a/controller/Makefile +++ b/controller/Makefile @@ -89,11 +89,11 @@ KIND ?= kind ##@ Build Dependencies ## Location to install dependencies to -LOCALBIN ?= $(shell cd .. && pwd)/bin +#LOCALBIN ?= $(shell cd .. && pwd)/bin # Remember to remove tools downloaded into bin directory manually before updating them. # If they need to be updated frequently, we can consider to store them in the `Dockerfile.dev`. -$(LOCALBIN): - mkdir -p $(LOCALBIN) +#$(LOCALBIN): +# mkdir -p $(LOCALBIN) ## Tool Binaries KUBECTL ?= kubectl From 53e855c99b9e307d3bcbf4cee2f9f6769cce4c9f Mon Sep 17 00:00:00 2001 From: Chever John Date: Tue, 2 Jul 2024 03:07:39 +0800 Subject: [PATCH 6/9] chore: update all makefile which use th e LOCALBIN var --- common.mk | 2 +- controller/Makefile | 7 ------- e2e/Makefile | 4 ---- 3 files changed, 1 insertion(+), 12 deletions(-) diff --git a/common.mk b/common.mk index 7dd827cd..415fd7c9 100644 --- a/common.mk +++ b/common.mk @@ -16,7 +16,7 @@ SHELL = /bin/bash OS = $(shell uname) IN_CI ?= -ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) +ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) LOCALBIN := $(ROOT_DIR)/bin $(LOCALBIN): @mkdir -p $(LOCALBIN) diff --git a/controller/Makefile b/controller/Makefile index b658e855..11b37008 100644 --- a/controller/Makefile +++ b/controller/Makefile @@ -88,13 +88,6 @@ KIND ?= kind ##@ Build Dependencies -## Location to install dependencies to -#LOCALBIN ?= $(shell cd .. && pwd)/bin -# Remember to remove tools downloaded into bin directory manually before updating them. -# If they need to be updated frequently, we can consider to store them in the `Dockerfile.dev`. -#$(LOCALBIN): -# mkdir -p $(LOCALBIN) - ## Tool Binaries KUBECTL ?= kubectl CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen diff --git a/e2e/Makefile b/e2e/Makefile index 1c05a8d0..dfbc09e8 100644 --- a/e2e/Makefile +++ b/e2e/Makefile @@ -14,10 +14,6 @@ include ../common.mk -LOCALBIN ?= $(shell cd .. && pwd)/bin -$(LOCALBIN): - @mkdir -p $(LOCALBIN) - KUBECTL ?= $(LOCALBIN)/kubectl KIND ?= $(LOCALBIN)/kind HELM ?= $(LOCALBIN)/helm From 3c9167593e48232bf38b766b38fc32c25a81cba8 Mon Sep 17 00:00:00 2001 From: Chever John Date: Tue, 2 Jul 2024 14:33:49 +0800 Subject: [PATCH 7/9] chore: update istio localbin var --- e2e/Makefile | 2 +- e2e/istio.sh | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/e2e/Makefile b/e2e/Makefile index dfbc09e8..74d5c868 100644 --- a/e2e/Makefile +++ b/e2e/Makefile @@ -53,7 +53,7 @@ e2e-prepare-data-plane-image: kind .PHONY: deploy-istio deploy-istio: helm - ISTIO_VERSION=$(ISTIO_VERSION) ./istio.sh install + ISTIO_VERSION=$(ISTIO_VERSION) LOCALBIN=$(LOCALBIN) ./istio.sh install .PHONY: run-e2e run-e2e: diff --git a/e2e/istio.sh b/e2e/istio.sh index 4d2bf13a..67aa767d 100755 --- a/e2e/istio.sh +++ b/e2e/istio.sh @@ -17,9 +17,7 @@ set -eo pipefail set -x -PARENT_DIR="$(cd .. && pwd)" - -HELM="${PARENT_DIR}/bin/helm" +HELM="${LOCALBIN}/helm" E2E_DIR="$(pwd)" install() { From 6d5c547260dab5c4b03be5192181842b870882a3 Mon Sep 17 00:00:00 2001 From: Chever John Date: Tue, 2 Jul 2024 14:38:58 +0800 Subject: [PATCH 8/9] chore: update site && Makefile --- Makefile | 4 ---- common.mk | 2 ++ site/Makefile | 8 ++------ 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 3f1d6f8b..14fb4251 100644 --- a/Makefile +++ b/Makefile @@ -17,10 +17,6 @@ include common.mk # For some tools, like golangci-lint, we prefer to use the latest version so that we can have the new feature. # For the other tools, like kind, we don't upgrade it until there is a strong reason. -LOCALBIN ?= $(shell pwd)/bin -$(LOCALBIN): - @mkdir -p $(LOCALBIN) - GO_FMTTER_VERSION = 0.3.8 .PHONY: install-go-fmtter install-go-fmtter: $(LOCALBIN) diff --git a/common.mk b/common.mk index 415fd7c9..cdc2e788 100644 --- a/common.mk +++ b/common.mk @@ -16,6 +16,8 @@ SHELL = /bin/bash OS = $(shell uname) IN_CI ?= +# Remember to remove tools downloaded into bin directory manually before updating them. +# If they need to be updated frequently, we can consider to store them in the `Dockerfile.dev`. ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) LOCALBIN := $(ROOT_DIR)/bin $(LOCALBIN): diff --git a/site/Makefile b/site/Makefile index 4ab98e58..6432fdb6 100644 --- a/site/Makefile +++ b/site/Makefile @@ -12,13 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -SHELL = /bin/bash +include ../common.mk -LOCALBIN ?= $(shell pwd)/bin -# Remember to remove tools downloaded into bin directory manually before updating them. -# If they need to be updated frequently, we can consider to store them in the `Dockerfile.dev`. -$(LOCALBIN): - @mkdir -p $(LOCALBIN) +SHELL = /bin/bash .PHONY: build build: From 76d4771165287e9f8bf38a2d53a9b9a08bc53b47 Mon Sep 17 00:00:00 2001 From: Chever John Date: Tue, 2 Jul 2024 15:16:27 +0800 Subject: [PATCH 9/9] chore: remove duplicate SHELL var --- site/Makefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/site/Makefile b/site/Makefile index 6432fdb6..e8136dab 100644 --- a/site/Makefile +++ b/site/Makefile @@ -14,8 +14,6 @@ include ../common.mk -SHELL = /bin/bash - .PHONY: build build: docker-compose build