From 75e84144c72e290f6f3e7b4c0cf92b32d9d573eb Mon Sep 17 00:00:00 2001 From: Nikolay Date: Mon, 14 Feb 2022 18:28:56 +0300 Subject: [PATCH] adds release build for macos darwin amd64 and arm64 (#2185) * adds release build for macos darwin amd64 and arm64 https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1896 https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1851 * wip Co-authored-by: Aliaksandr Valialkin --- Makefile | 84 +++++++++++++++++++++-------------- app/victoria-metrics/Makefile | 6 +++ app/vmagent/Makefile | 12 +++-- app/vmalert/Makefile | 12 +++-- app/vmauth/Makefile | 12 +++-- app/vmbackup/Makefile | 6 +++ app/vmctl/Makefile | 11 ++++- app/vmrestore/Makefile | 6 +++ deployment/docker/Makefile | 11 +++++ docs/CHANGELOG.md | 1 + 10 files changed, 116 insertions(+), 45 deletions(-) diff --git a/Makefile b/Makefile index ab7fc9bb3..1bd3ef570 100644 --- a/Makefile +++ b/Makefile @@ -100,66 +100,82 @@ release: \ release-victoria-metrics: \ release-victoria-metrics-amd64 \ release-victoria-metrics-arm \ - release-victoria-metrics-arm64 + release-victoria-metrics-arm64 \ + release-victoria-metrics-darwin-amd64 \ + release-victoria-metrics-darwin-arm64 release-victoria-metrics-amd64: - GOARCH=amd64 $(MAKE) release-victoria-metrics-generic + OSARCH=amd64 $(MAKE) release-victoria-metrics-generic release-victoria-metrics-arm: - GOARCH=arm $(MAKE) release-victoria-metrics-generic + OSARCH=arm $(MAKE) release-victoria-metrics-generic release-victoria-metrics-arm64: - GOARCH=arm64 $(MAKE) release-victoria-metrics-generic + OSARCH=arm64 $(MAKE) release-victoria-metrics-generic -release-victoria-metrics-generic: victoria-metrics-$(GOARCH)-prod +release-victoria-metrics-darwin-amd64: + OSARCH=darwin-arm64 $(MAKE) release-victoria-metrics-generic + +release-victoria-metrics-darwin-arm64: + OSARCH=darwin-arm64 $(MAKE) release-victoria-metrics-generic + +release-victoria-metrics-generic: victoria-metrics-$(OSARCH)-prod cd bin && \ - tar --transform="flags=r;s|-$(GOARCH)||" -czf victoria-metrics-$(GOARCH)-$(PKG_TAG).tar.gz \ - victoria-metrics-$(GOARCH)-prod \ - && sha256sum victoria-metrics-$(GOARCH)-$(PKG_TAG).tar.gz \ - victoria-metrics-$(GOARCH)-prod \ - | sed s/-$(GOARCH)-prod/-prod/ > victoria-metrics-$(GOARCH)-$(PKG_TAG)_checksums.txt + tar --transform="flags=r;s|-$(OSARCH)||" -czf victoria-metrics-$(OSARCH)-$(PKG_TAG).tar.gz \ + victoria-metrics-$(OSARCH)-prod \ + && sha256sum victoria-metrics-$(OSARCH)-$(PKG_TAG).tar.gz \ + victoria-metrics-$(OSARCH)-prod \ + | sed s/-$(OSARCH)-prod/-prod/ > victoria-metrics-$(OSARCH)-$(PKG_TAG)_checksums.txt release-vmutils: \ release-vmutils-amd64 \ release-vmutils-arm64 \ release-vmutils-arm \ + release-vmutils-darwin-amd64 \ + release-vmutils-darwin-arm64 \ release-vmutils-windows-amd64 release-vmutils-amd64: - GOARCH=amd64 $(MAKE) release-vmutils-generic + OSARCH=amd64 $(MAKE) release-vmutils-generic release-vmutils-arm64: - GOARCH=arm64 $(MAKE) release-vmutils-generic + OSARCH=arm64 $(MAKE) release-vmutils-generic release-vmutils-arm: - GOARCH=arm $(MAKE) release-vmutils-generic + OSARCH=arm $(MAKE) release-vmutils-generic + +release-vmutils-darwin-amd64: + OSARCH=darwin-amd64 $(MAKE) release-vmutils-generic + +release-vmutils-darwin-arm64: + OSARCH=darwin-arm64 $(MAKE) release-vmutils-generic release-vmutils-windows-amd64: GOARCH=amd64 $(MAKE) release-vmutils-windows-generic release-vmutils-generic: \ - vmagent-$(GOARCH)-prod \ - vmalert-$(GOARCH)-prod \ - vmauth-$(GOARCH)-prod \ - vmbackup-$(GOARCH)-prod \ - vmrestore-$(GOARCH)-prod \ - vmctl-$(GOARCH)-prod + vmagent-$(OSARCH)-prod \ + vmalert-$(OSARCH)-prod \ + vmauth-$(OSARCH)-prod \ + vmbackup-$(OSARCH)-prod \ + vmrestore-$(OSARCH)-prod \ + vmctl-$(OSARCH)-prod cd bin && \ - tar --transform="flags=r;s|-$(GOARCH)||" -czf vmutils-$(GOARCH)-$(PKG_TAG).tar.gz \ - vmagent-$(GOARCH)-prod \ - vmalert-$(GOARCH)-prod \ - vmauth-$(GOARCH)-prod \ - vmbackup-$(GOARCH)-prod \ - vmrestore-$(GOARCH)-prod \ - vmctl-$(GOARCH)-prod \ - && sha256sum vmutils-$(GOARCH)-$(PKG_TAG).tar.gz \ - vmagent-$(GOARCH)-prod \ - vmalert-$(GOARCH)-prod \ - vmauth-$(GOARCH)-prod \ - vmbackup-$(GOARCH)-prod \ - vmrestore-$(GOARCH)-prod \ - vmctl-$(GOARCH)-prod \ - | sed s/-$(GOARCH)-prod/-prod/ > vmutils-$(GOARCH)-$(PKG_TAG)_checksums.txt + tar --transform="flags=r;s|-$(OSARCH)||" -czf vmutils-$(OSARCH)-$(PKG_TAG).tar.gz \ + vmagent-$(OSARCH)-prod \ + vmalert-$(OSARCH)-prod \ + vmauth-$(OSARCH)-prod \ + vmbackup-$(OSARCH)-prod \ + vmrestore-$(OSARCH)-prod \ + vmctl-$(OSARCH)-prod \ + && sha256sum vmutils-$(OSARCH)-$(PKG_TAG).tar.gz \ + vmagent-$(OSARCH)-prod \ + vmalert-$(OSARCH)-prod \ + vmauth-$(OSARCH)-prod \ + vmbackup-$(OSARCH)-prod \ + vmrestore-$(OSARCH)-prod \ + vmctl-$(OSARCH)-prod \ + | sed s/-$(OSARCH)-prod/-prod/ > vmutils-$(OSARCH)-$(PKG_TAG)_checksums.txt release-vmutils-windows-generic: \ vmagent-windows-$(GOARCH)-prod \ diff --git a/app/victoria-metrics/Makefile b/app/victoria-metrics/Makefile index f463adfc5..bb97674c7 100644 --- a/app/victoria-metrics/Makefile +++ b/app/victoria-metrics/Makefile @@ -27,6 +27,12 @@ victoria-metrics-ppc64le-prod: victoria-metrics-386-prod: APP_NAME=victoria-metrics $(MAKE) app-via-docker-386 +victoria-metrics-darwin-amd64-prod: + APP_NAME=victoria-metrics $(MAKE) app-via-docker-darwin-amd64 + +victoria-metrics-darwin-arm64-prod: + APP_NAME=victoria-metrics $(MAKE) app-via-docker-darwin-arm64 + package-victoria-metrics: APP_NAME=victoria-metrics $(MAKE) package-via-docker diff --git a/app/vmagent/Makefile b/app/vmagent/Makefile index 7677340f4..55785189e 100644 --- a/app/vmagent/Makefile +++ b/app/vmagent/Makefile @@ -27,6 +27,15 @@ vmagent-ppc64le-prod: vmagent-386-prod: APP_NAME=vmagent $(MAKE) app-via-docker-386 +vmagent-darwin-amd64-prod: + APP_NAME=vmagent $(MAKE) app-via-docker-darwin-amd64 + +vmagent-darwin-arm64-prod: + APP_NAME=vmagent $(MAKE) app-via-docker-darwin-arm64 + +vmagent-windows-amd64-prod: + APP_NAME=vmagent $(MAKE) app-via-docker-windows-amd64 + package-vmagent: APP_NAME=vmagent $(MAKE) package-via-docker @@ -81,6 +90,3 @@ vmagent-pure: vmagent-windows-amd64: GOARCH=amd64 APP_NAME=vmagent $(MAKE) app-local-windows-with-goarch - -vmagent-windows-amd64-prod: - APP_NAME=vmagent $(MAKE) app-via-docker-windows-amd64 diff --git a/app/vmalert/Makefile b/app/vmalert/Makefile index c56d28f61..87f08e6a6 100644 --- a/app/vmalert/Makefile +++ b/app/vmalert/Makefile @@ -27,6 +27,15 @@ vmalert-ppc64le-prod: vmalert-386-prod: APP_NAME=vmalert $(MAKE) app-via-docker-386 +vmalert-darwin-amd64-prod: + APP_NAME=vmalert $(MAKE) app-via-docker-darwin-amd64 + +vmalert-darwin-arm64-prod: + APP_NAME=vmalert $(MAKE) app-via-docker-darwin-arm64 + +vmalert-windows-amd64-prod: + APP_NAME=vmalert $(MAKE) app-via-docker-windows-amd64 + package-vmalert: APP_NAME=vmalert $(MAKE) package-via-docker @@ -109,6 +118,3 @@ vmalert-pure: vmalert-windows-amd64: GOARCH=amd64 APP_NAME=vmalert $(MAKE) app-local-windows-with-goarch - -vmalert-windows-amd64-prod: - APP_NAME=vmalert $(MAKE) app-via-docker-windows-amd64 diff --git a/app/vmauth/Makefile b/app/vmauth/Makefile index 2997d47d6..93f4504fc 100644 --- a/app/vmauth/Makefile +++ b/app/vmauth/Makefile @@ -27,6 +27,15 @@ vmauth-ppc64le-prod: vmauth-386-prod: APP_NAME=vmauth $(MAKE) app-via-docker-386 +vmauth-darwin-amd64-prod: + APP_NAME=vmauth $(MAKE) app-via-docker-darwin-amd64 + +vmauth-darwin-arm64-prod: + APP_NAME=vmauth $(MAKE) app-via-docker-darwin-arm64 + +vmauth-windows-amd64-prod: + APP_NAME=vmauth $(MAKE) app-via-docker-windows-amd64 + package-vmauth: APP_NAME=vmauth $(MAKE) package-via-docker @@ -80,6 +89,3 @@ vmauth-pure: vmauth-windows-amd64: GOARCH=amd64 APP_NAME=vmauth $(MAKE) app-local-windows-with-goarch - -vmauth-windows-amd64-prod: - APP_NAME=vmauth $(MAKE) app-via-docker-windows-amd64 diff --git a/app/vmbackup/Makefile b/app/vmbackup/Makefile index 711820a94..4e72b0fad 100644 --- a/app/vmbackup/Makefile +++ b/app/vmbackup/Makefile @@ -27,6 +27,12 @@ vmbackup-ppc64le-prod: vmbackup-386-prod: APP_NAME=vmbackup $(MAKE) app-via-docker-386 +vmbackup-darwin-amd64-prod: + APP_NAME=vmbackup $(MAKE) app-via-docker-darwin-amd64 + +vmbackup-darwin-arm64-prod: + APP_NAME=vmbackup $(MAKE) app-via-docker-darwin-arm64 + package-vmbackup: APP_NAME=vmbackup $(MAKE) package-via-docker diff --git a/app/vmctl/Makefile b/app/vmctl/Makefile index 6b28a1323..d9c604fd6 100644 --- a/app/vmctl/Makefile +++ b/app/vmctl/Makefile @@ -27,6 +27,15 @@ vmctl-ppc64le-prod: vmctl-386-prod: APP_NAME=vmctl $(MAKE) app-via-docker-386 +vmctl-darwin-amd64-prod: + APP_NAME=vmctl $(MAKE) app-via-docker-darwin-amd64 + +vmctl-darwin-arm64-prod: + APP_NAME=vmctl $(MAKE) app-via-docker-darwin-arm64 + +vmctl-windows-amd64-prod: + APP_NAME=vmctl $(MAKE) app-via-docker-windows-amd64 + package-vmctl: APP_NAME=vmctl $(MAKE) package-via-docker @@ -75,5 +84,3 @@ vmctl-pure: vmctl-windows-amd64: GOARCH=amd64 APP_NAME=vmctl $(MAKE) app-local-windows-with-goarch -vmctl-windows-amd64-prod: - APP_NAME=vmctl $(MAKE) app-via-docker-windows-amd64 diff --git a/app/vmrestore/Makefile b/app/vmrestore/Makefile index dd390fdce..48e5c9281 100644 --- a/app/vmrestore/Makefile +++ b/app/vmrestore/Makefile @@ -27,6 +27,12 @@ vmrestore-ppc64le-prod: vmrestore-386-prod: APP_NAME=vmrestore $(MAKE) app-via-docker-386 +vmrestore-darwin-amd64-prod: + APP_NAME=vmrestore $(MAKE) app-via-docker-darwin-amd64 + +vmrestore-darwin-arm64-prod: + APP_NAME=vmrestore $(MAKE) app-via-docker-darwin-arm64 + package-vmrestore: APP_NAME=vmrestore $(MAKE) package-via-docker diff --git a/deployment/docker/Makefile b/deployment/docker/Makefile index a913655a7..046eeb14c 100644 --- a/deployment/docker/Makefile +++ b/deployment/docker/Makefile @@ -94,6 +94,17 @@ app-via-docker-goarch: DOCKER_OPTS='--env CGO_ENABLED=$(CGO_ENABLED) --env GOOS=linux --env GOARCH=$(GOARCH)' \ $(MAKE) app-via-docker +app-via-docker-darwin-amd64: + CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 $(MAKE) app-via-docker-goos-goarch + +app-via-docker-darwin-arm64: + CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 $(MAKE) app-via-docker-goos-goarch + +app-via-docker-goos-goarch: + APP_SUFFIX='-$(GOOS)-$(GOARCH)' \ + DOCKER_OPTS='--env CGO_ENABLED=$(CGO_ENABLED) --env GOOS=$(GOOS) --env GOARCH=$(GOARCH)' \ + $(MAKE) app-via-docker + app-via-docker-goarch-arm64: APP_SUFFIX='-arm64' \ DOCKER_OPTS='--env CGO_ENABLED=1 --env GOOS=linux --env GOARCH=arm64 --env CC=/opt/cross-builder/aarch64-linux-musl-cross/bin/aarch64-linux-musl-gcc' \ diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index f865d4d81..dbdd531f0 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -14,6 +14,7 @@ The following tip changes can be tested by building VictoriaMetrics components f ## tip +* FEATURE: publish VictoriaMetrics binaries for MacOS amd64 and MacOS arm64 (aka MacBook M1) at [releases page](https://github.com/VictoriaMetrics/VictoriaMetrics/releases). See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1896) and [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1851). * FEATURE: reduce CPU and disk IO usage during `indexdb` rotation once per `-retentionPeriod`. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1401). * FEATURE: [VictoriaMetrics cluster](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html): add `-dropSamplesOnOverload` command-line flag for `vminsert`. If this flag is set, then `vminsert` drops incoming data if the destination `vmstorage` is temporarily unavailable or cannot keep up with the ingestion rate. The number of dropped rows can be [monitored](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html#monitoring) via `vm_rpc_rows_dropped_on_overload_total` metric at `vminsert`. * FEATURE: [VictoriaMetrics cluster](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html): improve re-routing logic, so it re-routes incoming data more evenly if some of `vmstorage` nodes are temporarily unavailable and/or accept data at slower rate than other `vmstorage` nodes. Also significantly reduce possible re-routing storm when `vminsert` runs with `-disableRerouting=false` command-line flag. This should help the following issues: [one](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1337), [two](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1165), [three](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1054), [four](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/791), [five](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1544).