You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2021/02/11 06:55:20 UTC

[skywalking-satellite] branch main updated: Polish the doc and compact the GHA configs (#25)

This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-satellite.git


The following commit(s) were added to refs/heads/main by this push:
     new 029d021  Polish the doc and compact the GHA configs (#25)
029d021 is described below

commit 029d021d5459307ea9e5c0ecb3b57b1f5dcc9eba
Author: Zhenxu Ke <ke...@apache.org>
AuthorDate: Thu Feb 11 14:55:11 2021 +0800

    Polish the doc and compact the GHA configs (#25)
---
 .gitattributes                                     |  1 +
 .github/workflows/build-and-test.yaml              | 61 ++++------------------
 .licenserc.yaml                                    | 37 +++++++++++++
 Makefile                                           |  8 +--
 README.md                                          |  2 +-
 docs/en/concepts-and-designs/project-goals.md      |  8 +--
 docs/en/guides/contribuation/plugin.md             |  2 +-
 docs/en/setup/README.md                            |  4 +-
 docs/en/setup/configuration/common.md              |  6 +--
 .../en/setup/plugins/fallbacker_none-fallbacker.md |  2 +-
 plugins/fallbacker/none/none_fallbacker.go         |  2 +-
 .../{queue_opreation.go => queue_operation.go}     |  0
 tools/install_protoc.sh                            | 27 +++++++---
 tools/protocol_gen.sh                              |  2 +-
 14 files changed, 83 insertions(+), 79 deletions(-)

diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..d207b18
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1 @@
+*.go text eol=lf
diff --git a/.github/workflows/build-and-test.yaml b/.github/workflows/build-and-test.yaml
index 7eb20c1..bd2ddf0 100644
--- a/.github/workflows/build-and-test.yaml
+++ b/.github/workflows/build-and-test.yaml
@@ -23,57 +23,13 @@ on:
       - main
 
 jobs:
-  CI-Windows:
-    runs-on: windows-latest
-    timeout-minutes: 90
-    strategy:
-      matrix:
-        go-version: [ 1.14, 1.15 ]
-      fail-fast: true
-    steps:
-      - name: Set up Go ${{ matrix.go-version }}
-        uses: actions/setup-go@v2
-        with:
-          go-version: ${{ matrix.go-version }}
-      - name: Check out code into the Go module directory
-        uses: actions/checkout@v2
-        with:
-          submodules: true
-      - name: Get dependencies
-        run: make deps
-      - name: Test
-        run: make test
-      - name: Build
-        run: make build
-
-  CI-MacOS:
-    runs-on: macos-latest
-    timeout-minutes: 90
-    strategy:
-      matrix:
-        go-version: [ 1.14, 1.15 ]
-      fail-fast: true
-    steps:
-      - name: Set up Go ${{ matrix.go-version }}
-        uses: actions/setup-go@v2
-        with:
-          go-version: ${{ matrix.go-version }}
-      - name: Check out code into the Go module directory
-        uses: actions/checkout@v2
-        with:
-          submodules: true
-      - name: Get dependencies
-        run: make deps
-      - name: Test
-        run: make test
-      - name: Build
-        run: make build
   CI:
-    runs-on: ubuntu-latest
-    timeout-minutes: 90
+    runs-on: ${{ matrix.runner }}-latest
+    timeout-minutes: 30
     strategy:
       matrix:
         go-version: [ 1.14, 1.15 ]
+        runner: [ ubuntu, macos, windows ]
       fail-fast: true
     steps:
       - name: Set up Go ${{ matrix.go-version }}
@@ -85,22 +41,27 @@ jobs:
         with:
           submodules: true
       - name: Check License
-        run: make license
+        if: matrix.runner == 'ubuntu'
+        uses: apache/skywalking-eyes@9bd5feb86b5817aa6072b008f9866a2c3bbc8587
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
       - name: Get dependencies
         run: make deps
       - name: Check generate
         run: make gen && make build
       - name: Check CI Consistency
-        if: matrix.go-version == '1.15'
+        if: matrix.go-version == '1.15' && matrix.runner == 'ubuntu'
         run: make check
       - name: Lint
         run: make lint
       - name: Test
         run: make test
+      - name: Build
+        run: make build
 
   result:
     runs-on: ubuntu-latest
-    timeout-minutes: 90
+    timeout-minutes: 30
     needs: [ CI ]
     steps:
       - name: Build Result
diff --git a/.licenserc.yaml b/.licenserc.yaml
new file mode 100644
index 0000000..d9d8771
--- /dev/null
+++ b/.licenserc.yaml
@@ -0,0 +1,37 @@
+#
+# 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.
+#
+
+header:
+  license:
+    spdx-id: Apache-2.0
+    copyright-owner: Apache Software Foundation
+
+  paths-ignore:
+    - '**/gen-codes/**'
+    - '**/*.md'
+    - .gitignore
+    - .gitmodules
+    - .gitattributes
+    - LICENSE
+    - NOTICE
+    - go.mod
+    - go.sum
+    - plugins/queue/mmap/queue_operation.go
+
+  comment: on-failure
diff --git a/Makefile b/Makefile
index a1251cd..0230b7a 100644
--- a/Makefile
+++ b/Makefile
@@ -33,7 +33,6 @@ GO_BUILD = $(GO) build
 GO_GET = $(GO) get
 GO_TEST = $(GO) test
 GO_LINT = $(GO_PATH)/bin/golangci-lint
-GO_LICENSER = $(GO_PATH)/bin/go-licenser
 GO_BUILD_FLAGS = -v
 GO_BUILD_LDFLAGS = -X main.version=$(VERSION)
 GQL_GEN = $(GO_PATH)/bin/gqlgen
@@ -49,7 +48,6 @@ all: deps verify build check
 .PHONY: tools
 tools:
 	$(GO_LINT) version || curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GO_PATH)/bin v1.33.0
-	$(GO_LICENSER) -version || GO111MODULE=off $(GO_GET) -u github.com/elastic/go-licenser
 
 deps: tools
 	$(GO_GET) -v -t -d ./...
@@ -67,12 +65,8 @@ lint: tools
 test: clean
 	$(GO_TEST) ./... -coverprofile=coverage.txt -covermode=atomic
 
-.PHONY: license
-license: clean tools
-	$(GO_LICENSER) -d -exclude=plugins/queue/mmap/queue_opreation.go -exclude=protocol/gen-codes -licensor='Apache Software Foundation (ASF)' ./
-
 .PHONY: verify
-verify: clean license lint test
+verify: clean lint test
 
 .PHONY: clean
 clean: tools
diff --git a/README.md b/README.md
index 67d2417..f46a0d9 100644
--- a/README.md
+++ b/README.md
@@ -15,7 +15,7 @@ Apache SkyWalking Satellite
 NOTICE, SkyWalking Satellite uses [v3 protocols](https://github.com/apache/skywalking/blob/master/docs/en/protocols/README.md). They are incompatible with previous SkyWalking releases before SkyWalking 8.0.
 
 # Download
-Go to the [download page](https://skywalking.apache.org/downloads/) to download all available binaries, including MacOS, Linux and Windows. Due to system compatibility problems, some plugins of SkyWalking Satellite cannot be used in Windows system. Check [the corresponding documentation](./docs/en/guides/compile/compile.md) to see whether the plugin is available on Windows.
+Go to the [download page](https://skywalking.apache.org/downloads/) to download all available binaries, including MacOS, Linux and Windows. Due to system compatibility problems, some plugins of SkyWalking Satellite cannot be used in Windows system. Check [the corresponding documentation](./docs/en/setup/plugins) to see whether the plugin is available on Windows.
 
 # Compile
 As SkyWalking Satellite is using `Makefile`, compiling the project is as easy as executing a command in the root directory of the project.
diff --git a/docs/en/concepts-and-designs/project-goals.md b/docs/en/concepts-and-designs/project-goals.md
index c620f4c..c8795b2 100644
--- a/docs/en/concepts-and-designs/project-goals.md
+++ b/docs/en/concepts-and-designs/project-goals.md
@@ -3,13 +3,13 @@ The document outlines the core design goals for SkyWalking Satellite project.
 
 - **Light Weight**. SkyWalking Satellite has a limited cost for resources and high-performance because of the requirements of the sidecar deployment model.
 
-- **Pluggable**. SkyWalking Satellite core team provides many default implementations, but definitely it is not enough,
+- **Pluggability**. SkyWalking Satellite core team provides many default implementations, but definitely it is not enough,
 and also don't fit every scenario. So, we provide a lot of features for being pluggable. 
 
 - **Portability**. SkyWalking Satellite can run in multiple environments, including: 
-    - Use traditional deployment as a demon process to collect data.
-    - Use cloud services as a sidecar, such as in the kubernetes platform.
+    - Use traditional deployment as a daemon process to collect data.
+    - Use cloud services as a sidecar, such as in the Kubernetes platform.
 
-- **Interop**.  Observability is a big landscape, SkyWalking is impossible to support all, even by its community. So SkyWalking Satellite is compatible with many protocols, including: 
+- **Interoperability**. Observability is a big landscape, SkyWalking is impossible to support all, even by its community. So SkyWalking Satellite is compatible with many protocols, including: 
     - SkyWalking protocol
     - (WIP) Prometheus protocol.
diff --git a/docs/en/guides/contribuation/plugin.md b/docs/en/guides/contribuation/plugin.md
index ffbd624..b2f4a61 100644
--- a/docs/en/guides/contribuation/plugin.md
+++ b/docs/en/guides/contribuation/plugin.md
@@ -2,7 +2,7 @@
 If you want to add a custom plugin in SkyWalking Satellite, the following contents would guide you.
 Let's use memory-queue as an example of how to write a plugin.
 
-1. Choose the plugin category. According to the memory-queue is a queue, the plugin should be write in the **skywalking-satellite/plugins/queue** directory. So we create a new directory called memory as the plugin codes space.  
+1. Choose the plugin category. As the memory-queue is a queue, the plugin should be written in the **skywalking-satellite/plugins/queue** directory. So we create a new directory called memory as the plugin codes space.  
 
 2. Implement the interface in the **skywalking-satellite/plugins/queue/api**. Each plugin has 3 common methods, which are Name(), Description(), DefaultConfig().
     - Name() returns the unique name in the plugin category.
diff --git a/docs/en/setup/README.md b/docs/en/setup/README.md
index 77a2d2c..3c5ab09 100644
--- a/docs/en/setup/README.md
+++ b/docs/en/setup/README.md
@@ -1,5 +1,5 @@
 # Setup
-First and most important thing is, SkyWalking Satellite startup behaviours are driven by configs/satellite_config.yaml. Understood the setting file will help you to read this document.
+First and most important thing is, SkyWalking Satellite startup behaviours are driven by configs/satellite_config.yaml. Understanding the setting file will help you to read this document.
 
 ## Startup script
 The startup script is /bin/skywalking-satellite-{version}-{plateform}-amd64. 
@@ -16,4 +16,4 @@ So, in satellite_config.yaml, there are three parts.
 3. [The pipe plugin configurations](./configuration/pipe-plugins.md).
 
 ## Advanced feature document link list
-1. [Overriding settings](./configuration/override-settings.md) in satellite_config.yaml is supported
\ No newline at end of file
+1. [Overriding settings](./configuration/override-settings.md) in satellite_config.yaml is supported
diff --git a/docs/en/setup/configuration/common.md b/docs/en/setup/configuration/common.md
index e4581e2..4990d01 100644
--- a/docs/en/setup/configuration/common.md
+++ b/docs/en/setup/configuration/common.md
@@ -12,7 +12,7 @@ configuration and the telemetry configuration.
 ## Self Telemetry
 |  Config   |Default| Description  |
 |  ----  | ----  | ----  |
-| cluster  | default-cluster | The space concept for the deployment, such as the namespace concept in the kubernetes.|
-| service  | default-service | The group concept for the deployment, such as the service resource concept in the kubernetes.|
-| instance  | default-instance |The minimum running unit, such as the pod concept in the kubernetes.|
+| cluster  | default-cluster | The space concept for the deployment, such as the namespace concept in the Kubernetes.|
+| service  | default-service | The group concept for the deployment, such as the service resource concept in the Kubernetes.|
+| instance  | default-instance |The minimum running unit, such as the pod concept in the Kubernetes.|
 
diff --git a/docs/en/setup/plugins/fallbacker_none-fallbacker.md b/docs/en/setup/plugins/fallbacker_none-fallbacker.md
index 4b8fa4d..b425422 100755
--- a/docs/en/setup/plugins/fallbacker_none-fallbacker.md
+++ b/docs/en/setup/plugins/fallbacker_none-fallbacker.md
@@ -1,5 +1,5 @@
 # Fallbacker/none-fallbacker
 ## Description
-The fallbacker would nothing to do when facing failure data.
+The fallbacker would do nothing when facing failure data.
 ## DefaultConfig
 ```yaml```
diff --git a/plugins/fallbacker/none/none_fallbacker.go b/plugins/fallbacker/none/none_fallbacker.go
index ffb4822..f61cff1 100644
--- a/plugins/fallbacker/none/none_fallbacker.go
+++ b/plugins/fallbacker/none/none_fallbacker.go
@@ -34,7 +34,7 @@ func (f *Fallbacker) Name() string {
 }
 
 func (f *Fallbacker) Description() string {
-	return "The fallbacker would nothing to do when facing failure data."
+	return "The fallbacker would do nothing when facing failure data."
 }
 
 func (f *Fallbacker) DefaultConfig() string {
diff --git a/plugins/queue/mmap/queue_opreation.go b/plugins/queue/mmap/queue_operation.go
similarity index 100%
rename from plugins/queue/mmap/queue_opreation.go
rename to plugins/queue/mmap/queue_operation.go
diff --git a/tools/install_protoc.sh b/tools/install_protoc.sh
index 5cecfda..3c7069b 100755
--- a/tools/install_protoc.sh
+++ b/tools/install_protoc.sh
@@ -16,17 +16,28 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
+set -ex
 
+PROTOC_VERSION=3.14.0
 
-if [[ "$(uname)"=="Darwin" || "$(expr substr $(uname -s) 1 10)"=="MINGW32_NT" ]];then
-  echo "sorry, please install protoc by yourself."
-  exit 1
+if uname -s | grep MINGW64_NT || uname -s | grep CYGWIN_NT-6.1; then
+  PROTOC_ZIP=protoc-"$PROTOC_VERSION"-win64.zip
+elif uname -s | grep Darwin; then
+  PROTOC_ZIP=protoc-"$PROTOC_VERSION"-osx-x86_64.zip
+elif uname -s | grep Linux; then
+  PROTOC_ZIP=protoc-"$PROTOC_VERSION"-linux-x86_64.zip
+else
+  echo "Sorry, we cannot install protoc for you, please visit https://github.com/protocolbuffers/protobuf and install protoc by yourself."
 fi
 
-PROTOC_ZIP=protoc-3.14.0-linux-x86_64.zip
-curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.14.0/$PROTOC_ZIP
-sudo unzip -o $PROTOC_ZIP -d /usr/local bin/protoc
-sudo chmod 755  /usr/local/bin/protoc
+curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v"$PROTOC_VERSION"/$PROTOC_ZIP
+mkdir -p $HOME/usr/local
+unzip -o $PROTOC_ZIP -d $HOME/usr/local bin/protoc > /dev/null 2>&1 || true
+unzip -o $PROTOC_ZIP -d $HOME/usr/local bin/protoc.exe > /dev/null 2>&1 || true
+mv $HOME/usr/local/bin/protoc.exe $HOME/usr/local/bin/protoc > /dev/null 2>&1 || true
+chmod 755  $HOME/usr/local/bin/protoc
 rm -f $PROTOC_ZIP
 
-echo `protoc --version`
+export PATH=$PATH:$HOME/usr/local/bin
+
+protoc --version
diff --git a/tools/protocol_gen.sh b/tools/protocol_gen.sh
index b2bb131..367a8ad 100755
--- a/tools/protocol_gen.sh
+++ b/tools/protocol_gen.sh
@@ -20,7 +20,7 @@
 # ----------------------------------------------------------------------------
 
 
-
+export PATH=$PATH:$HOME/usr/local/bin
 export PROTO_HOME=protocol/all_protocol
 export COLLECT_PROTOCOL_HOME=protocol/skywalking-data-collect-protocol
 export SATELLITE_PROTOCOL_HOME=protocol/satellite-protocol