From 6a1c3dd42e434af2c386c23e320eb2e172049866 Mon Sep 17 00:00:00 2001 From: Martin Taillefer Date: Wed, 9 Oct 2019 15:49:59 -0700 Subject: [PATCH] Update common files. (#429) --- Makefile | 27 +++++++++++++-------------- Makefile.core.mk | 10 ++++------ common/.commonfiles.sha | 2 +- test/demo.mk | 2 +- test/noauth.mk | 2 +- test/tests.mk | 2 +- 6 files changed, 21 insertions(+), 24 deletions(-) diff --git a/Makefile b/Makefile index ad088d91e48e..ee59476d3568 100644 --- a/Makefile +++ b/Makefile @@ -36,28 +36,27 @@ else ifeq ($(shell echo $(LOCAL_ARCH) | head -c 5),armv8) else ifeq ($(shell echo $(LOCAL_ARCH) | head -c 4),armv) TARGET_ARCH ?= arm else - $(error "This system's architecture $(LOCAL_ARCH) isn't recognized/supported") + $(error This system's architecture $(LOCAL_ARCH) isn't supported) endif LOCAL_OS := $(shell uname) ifeq ($(LOCAL_OS),Linux) - TARGET_OS ?= linux - READLINK_FLAGS="-f" + TARGET_OS ?= linux + READLINK_FLAGS="-f" else ifeq ($(LOCAL_OS),Darwin) - TARGET_OS ?= darwin - READLINK_FLAGS="" + TARGET_OS ?= darwin + READLINK_FLAGS="" else - $(error "This system's OS $(LOCAL_OS) isn't recognized/supported") + $(error This system's OS $(LOCAL_OS) isn't supported) endif -REPO_ROOT = $(shell git rev-parse --show-toplevel) -REPO_NAME = $(shell basename $(REPO_ROOT)) -TARGET_OUT ?= $(HOME)/istio_out/$(REPO_NAME) +export TARGET_OUT ?= $(shell pwd)/out/$(TARGET_ARCH)_$(TARGET_OS) ifeq ($(BUILD_WITH_CONTAINER),1) +export TARGET_OUT = /work/out/$(TARGET_ARCH)_$(TARGET_OS) CONTAINER_CLI ?= docker DOCKER_SOCKET_MOUNT ?= -v /var/run/docker.sock:/var/run/docker.sock -IMG ?= gcr.io/istio-testing/build-tools:2019-10-08T03-13-17 +IMG ?= gcr.io/istio-testing/build-tools:2019-10-09T18-20-54 UID = $(shell id -u) PWD = $(shell pwd) @@ -73,26 +72,26 @@ RUN = $(CONTAINER_CLI) run --net=host -t -i --sig-proxy=true -u $(UID):docker -- -e TZ="$(TIMEZONE)" \ -e TARGET_ARCH="$(TARGET_ARCH)" \ -e TARGET_OS="$(TARGET_OS)" \ + -e TARGET_OUT="$(TARGET_OUT)" \ -v /etc/passwd:/etc/passwd:ro \ $(DOCKER_SOCKET_MOUNT) \ $(CONTAINER_OPTIONS) \ --mount type=bind,source="$(PWD)",destination="/work" \ - --mount type=bind,source="$(TARGET_OUT)",destination="/targetout" \ - --mount type=volume,source=home,destination="/home" \ + --mount type=volume,source=go,destination="/go" \ + --mount type=volume,source=gocache,destination="/gocache" \ -w /work $(IMG) else $(info Building with your local toolchain.) RUN = +GOBIN ?= $(GOPATH)/bin endif MAKE = $(RUN) make --no-print-directory -e -f Makefile.core.mk %: - @mkdir -p $(TARGET_OUT) @$(MAKE) $@ default: - @mkdir -p $(TARGET_OUT) @$(MAKE) .PHONY: default diff --git a/Makefile.core.mk b/Makefile.core.mk index dee82398ac93..63f11267c997 100644 --- a/Makefile.core.mk +++ b/Makefile.core.mk @@ -318,12 +318,12 @@ ${TOP}/src/sigs.k8s.io/kind: # Istio releases: deb and charts on https://storage.googleapis.com/istio-release # -${TOP}/bin/kind: ${TOP}/src/sigs.k8s.io/kind +${GOBIN}/kind: ${TOP}/src/sigs.k8s.io/kind echo ${TOP} mkdir -p ${TMPDIR} GO111MODULE="on" go get -u sigs.k8s.io/kind@master -${TOP}/bin/dep: +${GOBIN}/dep: go get -u github.com/golang/dep/cmd/dep lint: lint_modern @@ -333,12 +333,10 @@ lint-helm-global: lint_modern: lint-go lint-python lint-copyright-banner lint-markdown lint-protos lint-helm-global - .PHONY: istioctl -istioctl: ${TOP}/bin/istioctl -${TOP}/bin/istioctl: +istioctl: ${GOBIN}/istioctl +${GOBIN}/istioctl: mkdir -p ${TMPDIR} - mkdir -p ${TOP}/bin cd ${TOP}/src/istio.io/istio; go install ./istioctl/cmd/istioctl include test/install.mk diff --git a/common/.commonfiles.sha b/common/.commonfiles.sha index c4936390782c..aea30b4ab3b9 100644 --- a/common/.commonfiles.sha +++ b/common/.commonfiles.sha @@ -1 +1 @@ -d097cd9ec11c7bade823cedc64601ac0ba37d0e3 +23964a61fe765efb932204b72458f2915e1e17b7 diff --git a/test/demo.mk b/test/demo.mk index a092bcadb8e0..45ef4ea7ac59 100644 --- a/test/demo.mk +++ b/test/demo.mk @@ -8,7 +8,7 @@ INSTALL_OPTS="--set global.istioNamespace=${ISTIO_CONTROL_NS} --set global.confi # The demo environment should be compatible and we should be able to upgrade from 1.2 # # If you repeat the test without deleting the cluster the config will be fast, and will just run the curl calls. -run-test-demo: ${TOP}/bin/istioctl run-build-cluster run-build-demo ${TMPDIR} +run-test-demo: ${GOBIN}/istioctl run-build-cluster run-build-demo ${TMPDIR} kubectl apply -k kustomize/cluster kubectl apply -k test/demo --prune -l release=istio-system-istio diff --git a/test/noauth.mk b/test/noauth.mk index 835081a6e07e..fbe7f728d050 100644 --- a/test/noauth.mk +++ b/test/noauth.mk @@ -4,7 +4,7 @@ # Security is not enabled - this can be used for users who have ipsec or other secure VPC, or don't need the # security features. It is also intended to verify that Istio can work without citadel for a-la-carte modes. -run-test-noauth: ${TOP}/bin/istioctl run-test-noauth-micro run-test-noauth-full run-test-knative +run-test-noauth: ${GOBIN}/istioctl run-test-noauth-micro run-test-noauth-full run-test-knative # Run a test with the smallest/simplest install possible run-test-noauth-micro: diff --git a/test/tests.mk b/test/tests.mk index 657ba10edb86..758432ac369c 100644 --- a/test/tests.mk +++ b/test/tests.mk @@ -167,7 +167,7 @@ run-prometheus-operator-config-test: install-prometheus-operator install-prometh kubectl -n ${ISTIO_CONTROL_NS} wait pod/prometheus-prometheus-0 --for=condition=Ready --timeout=${WAIT_TIMEOUT} run-base-reachability: ENABLE_NAMESPACES_BY-DEFAULT=false -run-base-reachability: ${TOP}/bin/istioctl install-base run-reachability-test +run-base-reachability: ${GOBIN}/istioctl install-base run-reachability-test run-reachability-test: mkdir -p ${GOPATH}/out/logs ${GOPATH}/out/tmp