You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by ha...@apache.org on 2024/09/12 09:54:12 UTC
(skywalking-banyandb) 01/01: Update release related files
This is an automated email from the ASF dual-hosted git repository.
hanahmily pushed a commit to branch release
in repository https://gitbox.apache.org/repos/asf/skywalking-banyandb.git
commit 97d5e9a3485ff9a03d667c698886ee215bcc5d57
Author: Gao Hongtao <ha...@gmail.com>
AuthorDate: Thu Sep 12 09:49:42 2024 +0000
Update release related files
Signed-off-by: Gao Hongtao <ha...@gmail.com>
---
Makefile | 6 ++-
banyand/metadata/schema/property.go | 2 +-
docs/release.md | 12 ++---
pkg/index/inverted/metrics.go | 1 +
scripts/build/build.mk | 2 +-
scripts/push-release.sh | 95 +++++++++++++++++++++++++++++++++++++
scripts/release.sh | 15 ++++--
7 files changed, 117 insertions(+), 16 deletions(-)
diff --git a/Makefile b/Makefile
index aa5449df..0d6a1747 100644
--- a/Makefile
+++ b/Makefile
@@ -186,7 +186,7 @@ RELEASE_SCRIPTS := $(mk_dir)/scripts/release.sh
release-binary: release-source ## Package binary archive
${RELEASE_SCRIPTS} -b
-release-source: clean ## Package source archive
+release-source: ## Package source archive
${RELEASE_SCRIPTS} -s
release-sign: ## Sign artifacts
@@ -196,7 +196,11 @@ release-sign: ## Sign artifacts
release-assembly: release-binary release-sign ## Generate release package
+PUSH_RELEASE_SCRIPTS := $(mk_dir)/scripts/push-release.sh
+release-push-candidate: ## Push release candidate
+ ${PUSH_RELEASE_SCRIPTS}
+
.PHONY: all $(PROJECTS) clean build default nuke
.PHONY: lint check tidy format pre-push
.PHONY: test test-race test-coverage test-ci
diff --git a/banyand/metadata/schema/property.go b/banyand/metadata/schema/property.go
index 8c72e7db..8c87ef02 100644
--- a/banyand/metadata/schema/property.go
+++ b/banyand/metadata/schema/property.go
@@ -190,7 +190,7 @@ func (e *etcdSchemaRegistry) replaceProperty(ctx context.Context, key string, pr
func tagLen(property *propertyv1.Property) (uint32, error) {
tagsCount := len(property.Tags)
- if tagsCount < 0 || tagsCount > math.MaxUint32 {
+ if tagsCount < 0 || uint64(tagsCount) > math.MaxUint32 {
return 0, errors.New("integer overflow: tags count exceeds uint32 range")
}
tagsNum := uint32(tagsCount)
diff --git a/docs/release.md b/docs/release.md
index 4201b70e..561c9696 100644
--- a/docs/release.md
+++ b/docs/release.md
@@ -29,16 +29,12 @@ The `skywalking-banyandb-${VERSION}-bin.tgz`, `skywalking-banyandb-${VERSION}-sr
## Upload to Apache svn
```shell
-svn co https://dist.apache.org/repos/dist/dev/skywalking/
-mkdir -p skywalking/banyandb/"$VERSION"
-cp skywalking-banyandb/build/skywalking-banyandb*.tgz skywalking/banyandb/"$VERSION"
-cp skywalking-banyandb/build/skywalking-banyandb*.tgz.asc skywalking/banyandb/"$VERSION"
-cp skywalking-banyandb/build/skywalking-banyandb*.tgz.sha512 skywalking/banyandb/"$VERSION"
-
-cd skywalking/banyandb && svn add "$VERSION" && svn commit -m "Draft Apache SkyWalking BanyanDB release $VERSION"
+make release-push-candidate
```
-## Call for vote in dev@ mailing list
+The script will upload the source code package and binary package to the Apache SVN staging repository. The script will ask for your Apache ID and password. **You can do this only if you are a PMC member**.
+
+After the script is finished, you will get the vote mail subject and content based on the following template.
Call for vote in `dev@skywalking.apache.org`
diff --git a/pkg/index/inverted/metrics.go b/pkg/index/inverted/metrics.go
index 6816b90e..98b6d7a3 100644
--- a/pkg/index/inverted/metrics.go
+++ b/pkg/index/inverted/metrics.go
@@ -112,6 +112,7 @@ func (s *store) CollectMetrics(labelValues ...string) {
if s.metrics == nil {
return
}
+ // fixme: data race here
status := s.writer.Status()
s.metrics.totalUpdates.Set(float64(status.TotUpdates), labelValues...)
s.metrics.totalDeletes.Set(float64(status.TotDeletes), labelValues...)
diff --git a/scripts/build/build.mk b/scripts/build/build.mk
index 647f0a89..899dfef0 100644
--- a/scripts/build/build.mk
+++ b/scripts/build/build.mk
@@ -86,7 +86,7 @@ clean-build: ## Clean all artifacts
# be rebuilt again.
$(BUILD_LOCK):
@echo "cleaning up stale build artifacts..."
- $(MAKE) clean
+ $(MAKE) clean-build
mkdir -p $(BUILD_DIR)
touch $@
diff --git a/scripts/push-release.sh b/scripts/push-release.sh
new file mode 100755
index 00000000..0a0ed328
--- /dev/null
+++ b/scripts/push-release.sh
@@ -0,0 +1,95 @@
+#!/usr/bin/env bash
+
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+set -ex
+
+if [ "$VERSION" == "" ]; then
+ echo "VERSION environment variable not found, Please setting the VERSION."
+ echo "For example: export VERSION=1.0.0"
+ exit 1
+fi
+
+VERSION=${VERSION}
+TAG_NAME=v${VERSION}
+PRODUCT_NAME="skywalking-banyandb-${VERSION}"
+
+echo "Release version "${VERSION}
+echo "Source tag "${TAG_NAME}
+
+SCRIPTDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
+ROOTDIR=${SCRIPTDIR}/..
+BUILDDIR=${ROOTDIR}/build
+
+pushd ${BUILDDIR}
+trap 'popd' EXIT
+
+rm -rf skywalking
+
+svn co https://dist.apache.org/repos/dist/dev/skywalking/
+mkdir -p skywalking/banyandb/"$VERSION"
+cp ${PRODUCT_NAME}-*.tgz skywalking/banyandb/"$VERSION"
+cp ${PRODUCT_NAME}-*.tgz.asc skywalking/banyandb/"$VERSION"
+cp ${PRODUCT_NAME}-*.tgz.sha512 skywalking/banyandb/"$VERSION"
+
+cd skywalking/banyandb && svn add "$VERSION" && svn commit -m "Draft Apache SkyWalking BanyanDB release $VERSION"
+
+cat << EOF
+=========================================================================
+Subject: [VOTE] Release Apache SkyWalking BanyanDB version $VERSION
+
+Content:
+
+Hi the SkyWalking Community:
+This is a call for vote to release Apache SkyWalking BanyanDB version $VERSION.
+
+Release notes:
+
+ * https://github.com/apache/skywalking-banyandb/blob/v$VERSION/CHANGES.md
+
+Release Candidate:
+
+ * https://dist.apache.org/repos/dist/dev/skywalking/banyandb/$VERSION
+ * sha512 checksums
+ - $(cat ${PRODUCT_NAME}-src.tgz.sha512)
+ - $(cat ${PRODUCT_NAME}-banyand.tgz.sha512)
+ - $(cat ${PRODUCT_NAME}-bydbctl.tgz.sha512)
+
+Release Tag :
+
+ * (Git Tag) $TAG_NAME
+
+Release Commit Hash :
+
+ * https://github.com/apache/skywalking-banyandb/tree/$(git rev-list -n 1 "$TAG_NAME")
+
+Keys to verify the Release Candidate :
+
+ * https://dist.apache.org/repos/dist/release/skywalking/KEYS
+
+Guide to build the release from source :
+
+ * https://github.com/apache/skywalking-banyandb/blob/v$VERSION/docs/installation/binaries.md#Build-From-Source
+
+Voting will start now and will remain open for at least 72 hours, all PMC members are required to give their votes.
+
+[ ] +1 Release this package.
+[ ] +0 No opinion.
+[ ] -1 Do not release this package because....
+
+Thanks.
+
+[1] https://github.com/apache/skywalking/blob/master/docs/en/guides/How-to-release.md#vote-check
+EOF
diff --git a/scripts/release.sh b/scripts/release.sh
index 8e16d117..ab619fa4 100755
--- a/scripts/release.sh
+++ b/scripts/release.sh
@@ -24,7 +24,8 @@ BUILDDIR=${ROOTDIR}/build
RELEASE_TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
RELEASE_VERSION=${RELEASE_TAG#"v"}
-SOURCE_FILE=${BUILDDIR}/skywalking-banyandb-${RELEASE_VERSION}-src.tgz
+SOURCE_FILE_NAME=skywalking-banyandb-${RELEASE_VERSION}-src.tgz
+SOURCE_FILE=${BUILDDIR}/${SOURCE_FILE_NAME}
binary(){
if [ ! -f "${SOURCE_FILE}" ]; then
@@ -34,8 +35,9 @@ binary(){
tmpdir=`mktemp -d`
trap "rm -rf ${tmpdir}" EXIT
pushd ${tmpdir}
+ trap 'popd' EXIT
tar -xvf ${SOURCE_FILE}
- make generate
+ make generate && make -C ui build
TARGET_OS=linux PLATFORMS=linux/amd64,linux/arm64 make -C banyand release
bindir=./build
mkdir -p ${bindir}/bin
@@ -57,7 +59,6 @@ binary(){
copy_binaries bydbctl
# Package
tar -czf ${BUILDDIR}/skywalking-banyandb-${RELEASE_VERSION}-bydbctl.tgz -C ${bindir} .
- popd
}
copy_binaries() {
@@ -73,7 +74,8 @@ copy_binaries() {
source(){
# Package
- mkdir -p ${BUILDDIR}
+ tmpdir=`mktemp -d`
+ trap "rm -rf ${tmpdir}" EXIT
rm -rf ${SOURCE_FILE}
pushd ${ROOTDIR}
echo "RELEASE_VERSION=${RELEASE_VERSION}" > .env
@@ -85,8 +87,11 @@ source(){
--exclude=".idea" \
--exclude=".vscode" \
--exclude="bin" \
- -czf ${SOURCE_FILE} \
+ -czf ${tmpdir}/${SOURCE_FILE_NAME} \
.
+
+ mkdir -p ${BUILDDIR}
+ mv ${tmpdir}/${SOURCE_FILE_NAME} ${BUILDDIR}
popd
}