From 5533b8245082e88b7b116be04756340279e98246 Mon Sep 17 00:00:00 2001 From: ChrisCarini <6374067+ChrisCarini@users.noreply.github.com> Date: Fri, 3 Nov 2023 18:11:51 -0700 Subject: [PATCH 1/5] Add ARM architectures to Synology DSM7 --- pkg/synology/dsm7-docker/README.md | 5 +++++ pkg/synology/dsm7-docker/build.sh | 22 ++++++++++------------ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/pkg/synology/dsm7-docker/README.md b/pkg/synology/dsm7-docker/README.md index 14bacde76..99cd979cf 100644 --- a/pkg/synology/dsm7-docker/README.md +++ b/pkg/synology/dsm7-docker/README.md @@ -1,3 +1,8 @@ ## Docker image for Synology's DSM7 Documentation: [docs.zerotier.com/devices/synology](https://docs.zerotier.com/devices/synology) + +### Build & Push changes to DockerHub +```shell +./build.sh build +``` diff --git a/pkg/synology/dsm7-docker/build.sh b/pkg/synology/dsm7-docker/build.sh index acec5e0c9..1706ac686 100755 --- a/pkg/synology/dsm7-docker/build.sh +++ b/pkg/synology/dsm7-docker/build.sh @@ -3,19 +3,17 @@ ZTO_VER=$(git describe --tags $(git rev-list --tags --max-count=1)) ZTO_COMMIT=$(git rev-parse HEAD) -build() -{ - sudo docker build --load --rm -t zerotier-synology . --build-arg ZTO_COMMIT=${ZTO_COMMIT} --build-arg ZTO_VER=${ZTO_VER} - LATEST_DOCKER_IMAGE_HASH=$(sudo docker images -q zerotier-synology) - sudo docker tag ${LATEST_DOCKER_IMAGE_HASH} zerotier/zerotier-synology:${ZTO_VER} - sudo docker tag ${LATEST_DOCKER_IMAGE_HASH} zerotier/zerotier-synology:latest -} - -push() -{ +build() { sudo docker login --username=${DOCKERHUB_USERNAME} - sudo docker push zerotier/zerotier-synology:${ZTO_VER} - sudo docker push zerotier/zerotier-synology:latest + + sudo docker buildx build \ + --push \ + --platform linux/arm/v7,linux/arm64/v8,linux/amd64 \ + --tag zerotier/zerotier-synology:${ZTO_VER} \ + --tag zerotier/zerotier-synology:latest \ + --build-arg ZTO_COMMIT=${ZTO_COMMIT} \ + --build-arg ZTO_VER=${ZTO_VER} \ + . } "$@" From 9de2b90528d1fe7efe963acca3313defd1eb5662 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Wed, 27 Mar 2024 14:40:38 -0700 Subject: [PATCH 2/5] fix rebuild for x64 --- rustybits/zeroidc.vcxproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rustybits/zeroidc.vcxproj b/rustybits/zeroidc.vcxproj index b31ed0ee4..833437238 100644 --- a/rustybits/zeroidc.vcxproj +++ b/rustybits/zeroidc.vcxproj @@ -91,7 +91,7 @@ cargo clean - cargo clean & cargo build --release --target=x86_64-pc-windows-msvc + cargo clean & cargo build -p zeroidc --release --target=x86_64-pc-windows-msvc NDEBUG;$(NMakePreprocessorDefinitions) From 9ec6c2901cefa58cc246108564440dbf66cad178 Mon Sep 17 00:00:00 2001 From: Alfred Wingate Date: Sun, 29 Oct 2023 14:11:13 +0200 Subject: [PATCH 3/5] Respect user LDFLAGS * Respect user LDFLAGS instead of replacing them. Signed-off-by: Alfred Wingate --- make-linux.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make-linux.mk b/make-linux.mk index bfa416aa0..97ff6215e 100644 --- a/make-linux.mk +++ b/make-linux.mk @@ -71,7 +71,7 @@ else override CFLAGS+=-Wall -Wno-deprecated -pthread $(INCLUDES) -DNDEBUG $(DEFS) CXXFLAGS?=-O3 -fstack-protector override CXXFLAGS+=-Wall -Wno-deprecated -std=c++17 -pthread $(INCLUDES) -DNDEBUG $(DEFS) - LDFLAGS=-pie -Wl,-z,relro,-z,now + LDFLAGS?=-pie -Wl,-z,relro,-z,now ZT_CARGO_FLAGS=--release endif From f9c6ee0181acb1b77605d9a4e4106ac79aaacca3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 21 Jun 2024 13:18:42 +0200 Subject: [PATCH 4/5] macos: use more portable pwd instead of PWD MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In nixpkgs we use coreutils and do not have PWD available. This change have any downsides on normal macOS systems, but helps nixpkgs packaging a bit. Signed-off-by: Jörg Thalheim --- make-mac.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/make-mac.mk b/make-mac.mk index 018fb8325..7af200adc 100644 --- a/make-mac.mk +++ b/make-mac.mk @@ -1,8 +1,8 @@ CC=clang CXX=clang++ -TOPDIR=$(shell PWD) +TOPDIR=$(shell pwd) -INCLUDES=-I$(shell PWD)/rustybits/target -isystem $(TOPDIR)/ext -I$(TOPDIR)/ext/prometheus-cpp-lite-1.0/core/include -I$(TOPDIR)/ext-prometheus-cpp-lite-1.0/3rdparty/http-client-lite/include -I$(TOPDIR)/ext/prometheus-cpp-lite-1.0/simpleapi/include +INCLUDES=-I$(shell pwd)/rustybits/target -isystem $(TOPDIR)/ext -I$(TOPDIR)/ext/prometheus-cpp-lite-1.0/core/include -I$(TOPDIR)/ext-prometheus-cpp-lite-1.0/3rdparty/http-client-lite/include -I$(TOPDIR)/ext/prometheus-cpp-lite-1.0/simpleapi/include DEFS= LIBS= ARCH_FLAGS=-arch x86_64 -arch arm64 From 508527f7cdcf622b51cedab86d95be79a82d9a37 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Mon, 8 Jul 2024 14:08:54 -0700 Subject: [PATCH 5/5] break up redis tx inserts into smaller chunks --- controller/PostgreSQL.cpp | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/controller/PostgreSQL.cpp b/controller/PostgreSQL.cpp index 010df3b9d..e4a31ba28 100644 --- a/controller/PostgreSQL.cpp +++ b/controller/PostgreSQL.cpp @@ -780,11 +780,25 @@ void PostgreSQL::initializeNetworks() fprintf(stderr, "adding networks to redis...\n"); if (_rc->clusterMode) { auto tx = _cluster->transaction(_myAddressStr, true, false); - tx.sadd(setKey, networkSet.begin(), networkSet.end()); + uint64_t count = 0; + for (std::string nwid : networkSet) { + tx.sadd(setKey, nwid); + if (++count % 30000 == 0) { + tx.exec(); + tx = _cluster->transaction(_myAddressStr, true, false); + } + } tx.exec(); } else { auto tx = _redis->transaction(true, false); - tx.sadd(setKey, networkSet.begin(), networkSet.end()); + uint64_t count = 0; + for (std::string nwid : networkSet) { + tx.sadd(setKey, nwid); + if (++count % 30000 == 0) { + tx.exec(); + tx = _redis->transaction(true, false); + } + } tx.exec(); } fprintf(stderr, "done.\n"); @@ -1005,14 +1019,24 @@ void PostgreSQL::initializeMembers() fprintf(stderr, "Load member data into redis...\n"); if (_rc->clusterMode) { auto tx = _cluster->transaction(_myAddressStr, true, false); + uint64_t count = 0; for (auto it : networkMembers) { tx.sadd(it.first, it.second); + if (++count % 30000 == 0) { + tx.exec(); + tx = _cluster->transaction(_myAddressStr, true, false); + } } tx.exec(); } else { auto tx = _redis->transaction(true, false); + uint64_t count = 0; for (auto it : networkMembers) { tx.sadd(it.first, it.second); + if (++count % 30000 == 0) { + tx.exec(); + tx = _redis->transaction(true, false); + } } tx.exec(); }