Skip to content

Commit

Permalink
docs: update contribution docs (#380)
Browse files Browse the repository at this point in the history
* docs: update contribution docs

Add the Chinese version of the contribution document.

---------

Signed-off-by: YuLuo <yuluo08290126@gmail.com>
  • Loading branch information
yuluo-yx authored Apr 20, 2024
1 parent 2bd1433 commit 5ce297d
Show file tree
Hide file tree
Showing 2 changed files with 104 additions and 2 deletions.
89 changes: 89 additions & 0 deletions CONTRIBUTION-ZH.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
请加入我们,共同完善这个项目。

后端由 [Golang](https://go.dev/) 编写,前端由 [Vue](https://vuejs.org/) 编写。

### 对于初学者

在开始之前,您可能需要了解以下技术:

| Name | Domain |
|-----------------------------------------------------------------------------|------------------------------------------------------------------------|
| [HTTP](https://developer.mozilla.org/en-US/docs/Web/HTTP/Overview) Protocol | Core |
| [RESTful](https://en.wikipedia.org/wiki/REST) | Core |
| [gRPC](https://grpc.io/) | `gRPC` runner extension |
| [Prometheus](https://prometheus.io/) | Application monitor |
| [Cobra](https://github.com/spf13/cobra) | The Go CLI framework |
| [Element Plus](https://element-plus.org/) | The front-end framework |
| [Docker](https://www.docker.com/get-started/) | The container image build |
| [Helm chart](https://helm.sh/) | The [Kubernetes](https://kubernetes.io/docs/home/) application package |
| [GitHub Actions](https://docs.github.com/en/actions) | The continuous integration |

## 设置开发环境

强烈建议您配置 `git pre-commit` 钩子。它会强制在提交前运行单元测试。
运行以下命令

```shell
make install-precheck
```

## 打印各行代码:

```shell
git ls-files | xargs cloc
```

## pprof

```shell
go tool pprof -http=:9999 http://localhost:8080/debug/pprof/heap
```

其他用法:

* `/debug/pprof/heap?gc=1`
* `/debug/pprof/heap?seconds=10`
* `/debug/pprof/goroutine/?debug=0`

## SkyWalking

```shell
docker run -p 12800:12800 -p 9412:9412 docker.io/apache/skywalking-oap-server:9.0.0
docker run -p 8080:8080 -e SW_OAP_ADDRESS=http://172.11.0.6:12800 -e SW_ZIPKIN_ADDRESS=http://172.11.0.6:9412 docker.io/apache/skywalking-ui:9.0.0

make build

export SW_AGENT_NAME=atest
export SW_AGENT_REPORTER_GRPC_BACKEND_SERVICE=172.11.0.6:30689
export SW_AGENT_PLUGIN_CONFIG_HTTP_SERVER_COLLECT_PARAMETERS=true
export SW_AGENT_METER_COLLECT_INTERVAL=3
export SW_AGENT_LOG_TYPE=std
export SW_AGENT_REPORTER_DISCARD=true
./bin/atest server --local-storage 'bin/*.yaml' --http-port 8082 --port 7072 --console-path console/atest-ui/dist/
```

通过 BanYanDB 运行 SkyWalking:

```shell
docker run -p 17912:17912 -p 17913:17913 apache/skywalking-banyandb:latest standalone

docker run -p 12800:12800 -p 9412:9412 \
-e SW_STORAGE=banyandb \
-e SW_STORAGE_BANYANDB_HOST=192.168.1.98 \
docker.io/apache/skywalking-oap-server
```

## 第一次贡献

对于第一次对此项目贡献代码的开发者,您应该在本地开发环境运行如下命令:

```shell
make test
```

以确保通过项目测试,这会有助于您检查并解决在提交时遇到的错误,同时减少 review 的复杂度。

## FAQ

* Got sum missing match error of go.
* 运行命令: `go clean -modcache && go mod tidy`.
17 changes: 15 additions & 2 deletions CONTRIBUTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Please join us to improve this project.
The backend is written by [Golang](https://go.dev/), and the front-end is written by [Vue](https://vuejs.org/).

## For beginner

You might need to know the following tech before get started.

| Name | Domain |
Expand All @@ -18,6 +19,7 @@ You might need to know the following tech before get started.
| [GitHub Actions](https://docs.github.com/en/actions) | The continuous integration |

## Setup development environment

It's highly recommended you to configure the git pre-commit hook. It will force to run unit tests before commit.
Run the following command:

Expand All @@ -42,7 +44,7 @@ Other usage of this:
* `/debug/pprof/heap?seconds=10`
* `/debug/pprof/goroutine/?debug=0`

## Skywalking
## SkyWalking

```shell
docker run -p 12800:12800 -p 9412:9412 docker.io/apache/skywalking-oap-server:9.0.0
Expand All @@ -59,7 +61,8 @@ export SW_AGENT_REPORTER_DISCARD=true
./bin/atest server --local-storage 'bin/*.yaml' --http-port 8082 --port 7072 --console-path console/atest-ui/dist/
```

Run SkyWalking with BanYanDB
Run SkyWalking with BanYanDB:

```shell
docker run -p 17912:17912 -p 17913:17913 apache/skywalking-banyandb:latest standalone

Expand All @@ -69,6 +72,16 @@ docker run -p 12800:12800 -p 9412:9412 \
docker.io/apache/skywalking-oap-server
```

## First contribution

For developers contributing code to this project for the first time, you should run the following command in your local development environment:

```shell
make test
```

This will help you to check for and fix any bugs that you encounter at commit time, as well as reduce the complexity of the review.

## FAQ

* Got sum missing match error of go.
Expand Down

0 comments on commit 5ce297d

Please sign in to comment.