-
Notifications
You must be signed in to change notification settings - Fork 107
feat(add data collect proto in go agent) #231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| pkgUpdates[newKey] = newVal | ||
| } | ||
|
|
||
| // 添加protocols导入路径的处理 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please delete the Chinese comment.
| val := strings.ReplaceAll(filepath.Join(agentcore.EnhanceBasePackage, p), `\`, `/`) | ||
| pkgUpdates[key] = val | ||
| } | ||
| // 添加protocols导入路径的处理 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please delete Chinese comment.
tools/protocols/pull-proto.sh
Outdated
| #!/bin/bash | ||
|
|
||
| # Configuration parameters | ||
| REPO_URL="https://github.com/apache/skywalking-data-collect-protocol.git" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why you don't use the submodule to import the data collect protocol dependency repo? It easy to control the version, rather than using git command.
Makefile
Outdated
| ##@ General | ||
|
|
||
| .PHONY: generate-proto | ||
| generate-proto: ##generate data collect proto |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This command should be invoke before the plugin or E2E test? Please make sure the all the test can be executed successfully
tools/protocols/pull-proto.sh
Outdated
| # ----------------------------- | ||
| if [ ! -d "$SUBMODULE_PATH" ]; then | ||
| echo "Initializing submodule..." | ||
| git submodule update --init --recursive "$SUBMODULE_PATH" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this update, the git submodule already lock the version.
tools/protocols/pull-proto.sh
Outdated
| cd "$SUBMODULE_PATH" | ||
| git fetch --all | ||
| git checkout "$SUBMODULE_COMMIT" | ||
| cd - > /dev/null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to checkout, just generate the gRPC code is enough.
…x in windows-plugin-test)
|
I think you could slightly change the CI control file to run this in your fork repo. It will cost time for you to do this through a PR. |
mrproliu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also update the CHANGES.md to declare that the agent has replaced the goapi and generates it by itself.
.github/workflows/e2e.yaml
Outdated
| submodules: true | ||
| - name: Install unzip | ||
| run: sudo apt-get update && sudo apt-get install -y unzip | ||
| - name: Check Go version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The setup Go already define the go version, why there still needs to check again?
.github/workflows/e2e.yaml
Outdated
| with: | ||
| submodules: true | ||
| - name: Install unzip | ||
| run: sudo apt-get update && sudo apt-get install -y unzip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the unzip not define in the original runner? If exist, please remove this install step.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unzip is not install before
.github/workflows/e2e.yaml
Outdated
| path: test/e2e/case/kafka/e2e.yaml | ||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - name: Set up Go |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the Job, the agent have already built, so don't needs to generate the protocol again.
.github/workflows/plugin-tests.yaml
Outdated
| - uses: actions/checkout@v2 | ||
| with: | ||
| submodules: true | ||
| - name: Set up Go 1.19 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The agent binary is already built. Please remove unnecessary generated code.
.github/workflows/plugin-tests.yaml
Outdated
| uses: actions/setup-go@v2 | ||
| with: | ||
| go-version: 1.19 | ||
| - name: Install unzip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, the agent already built.
tools/protocols/pull-proto.sh
Outdated
| export GOPROXY=https://goproxy.cn,direct | ||
| PROTOC_VERSION=3.14.0 | ||
| export PATH="/home/runner/go/bin:$PATH" | ||
| export GOPATH="${GOPATH:-$HOME/go}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need to declare GOPROXY, PATH, and GOPATH? It should use the user system configuration.
User system doesn't have /home/runner, it should only work for the GitHub Runner.
tools/protocols/pull-proto.sh
Outdated
| INCLUDE_DIR="$TEMPDIR"/include | ||
|
|
||
| SUBMODULE_PATH="skywalking-data-collect-protocol" | ||
| OUTPUT_BASE_DIR="../../protocols" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should use the absolute directory. If the user executes this command in another directory, the output directory is not expected.
tools/protocols/pull-proto.sh
Outdated
| go version | ||
| if ! command -v protoc-gen-go &>/dev/null; then | ||
| echo "Installing protoc-gen-go v1.26..." | ||
| GO111MODULE=on GOPROXY=https://goproxy.cn,direct GOSUMDB=sum.golang.google.cn go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.26.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove these env, just do go install.
tools/protocols/pull-proto.sh
Outdated
|
|
||
| if ! command -v protoc-gen-go-grpc &>/dev/null; then | ||
| echo "Installing protoc-gen-go-grpc v1.1..." | ||
| GO111MODULE=on GOPROXY=https://goproxy.cn,direct GOSUMDB=sum.golang.google.cn go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.1.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove these env, just do go install.
tools/protocols/generate.sh
Outdated
| # ----------------------------- | ||
| # Configuration | ||
| # ----------------------------- | ||
| #export GOPROXY=https://goproxy.cn,direct |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please delete it rather than comment it.
CHANGES.md
Outdated
|
|
||
| #### Documentation | ||
|
|
||
| * Replace external `goapi` dependency with in-repo generated protocols. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be declared in the feature selection.
No description provided.