Skip to content
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

upgrade nacos client from 1.4.2 to 2.3.2 #12362

Merged
merged 11 commits into from
Jun 26, 2024

Conversation

shalk
Copy link
Contributor

@shalk shalk commented Jun 21, 2024

short story: Nacos 2 is Better than Nacos 1.x. So update to Nacos 2.x is good choice.

long story:
Nacos have released 2.x for long times, the most important feature is support gRPC for "Long-Live" Connection.
https://www.alibabacloud.com/blog/an-in-depth-insight-into-nacos-2-0-architecture-and-new-model-with-a-supported-grpc-persistent-connection_597804

skywalking on nacos:

Skywalking have some extension abilities with Nacos Implemention. So Skywalking can use Nacos for Cluster Management and Dynamic Configuration

After skywalking upgrade Nacos client , the performance will be better when skywalking setup with nacos 2.x server

  • If this pull request closes/resolves/fixes an existing issue, replace the issue number. Closes #.
  • Update the CHANGES log.

@shalk shalk force-pushed the update-nacos-to-2.3.2 branch from 8c18d85 to 9a91c1d Compare June 21, 2024 11:55
@shalk shalk changed the title upgrade nacos client from 1.4.1 to 2.3.2 upgrade nacos client from 1.4.2 to 2.3.2 Jun 21, 2024
Comment on lines -38 to -63
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
</exclusion>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</exclusion>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
</exclusion>
<exclusion>
<groupId>net.jcip</groupId>
<artifactId>jcip-annotations</artifactId>
</exclusion>
</exclusions>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you exclude this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nacos-client 2.3.2 have make these package optional, not transitivity

@wu-sheng
Copy link
Member

SkyWalking eyes will check the dependencies check. I believe you didn't do this.

license-header:
if: (github.event_name == 'schedule' && github.repository == 'apache/skywalking') || (github.event_name != 'schedule')
name: License header
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Check license header
uses: apache/skywalking-eyes@5b7ee1731d036b5aac68f8bd3fc9e6f98ada082e

@wu-sheng
Copy link
Member

Meanwhile, I don't see your explanation of this version upgrade. What is the impact of this upgrade?

@wu-sheng wu-sheng added dependencies Pull requests that update a dependency file backend OAP backend related. labels Jun 21, 2024
@wu-sheng
Copy link
Member

Also, docs should be updated, https://skywalking.apache.org/docs/main/next/en/setup/backend/backend-cluster/#nacos

Changes.md linked in the pull request has not been updated too.

Comment on lines +84 to +85
Integer nacosPortOffset = container.getMappedPort(9848) - container.getMappedPort(8848);
System.setProperty("nacos.server.grpc.port.offset", nacosPortOffset.toString());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this about?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nacos 2.x server have two port, 8848(http) and 9948(gRPC) by default. Nacos Client 's implement use 8848(http.port) + 1000(nacos.server.grpc.port.offset) as gRPC port. It works on virtual machine.
But the testContainer will not Mapport the port One-By-One. so i need to configure nacos.server.grpc.port.offset

Doc ref :https://nacos.io/docs/next/manual/user/java-sdk/properties/#24-%E8%BF%9E%E6%8E%A5%E7%9B%B8%E5%85%B3

@shalk
Copy link
Contributor Author

shalk commented Jun 24, 2024

Thank you for so quickly response, i will read these review and give some update later

@wu-sheng
Copy link
Member

Note skywalking eyes tool is going to check the dependencies change, and License file needs to be updated.

@shalk
Copy link
Contributor Author

shalk commented Jun 24, 2024

The check result of skywalking eyes is as follow , it looks no license changes

➜  skywalking git:(update-nacos-to-2.3.2) docker run -it --rm -v $(pwd):/github/workspace ghcr.io/apache/skywalking-eyes/license-eye header check
INFO Loading configuration from file: .licenserc.yaml 
INFO Totally checked 3735 files, valid: 3223, invalid: 0, ignored: 512, fixed: 0 
➜  skywalking git:(update-nacos-to-2.3.2) docker run -it --rm -v $(pwd):/github/workspace ghcr.io/apache/skywalking-eyes/license-eye header fix  
INFO Loading configuration from file: .licenserc.yaml 
INFO Totally checked 3735 files, valid: 3223, invalid: 0, ignored: 512, fixed: 0 

@wu-sheng
Copy link
Member

This is header fix.(Source files have proper headers), But I mean this

dependency-license:
if: |
( always() && ! cancelled() ) &&
((github.event_name == 'schedule' && github.repository == 'apache/skywalking') || needs.changes.outputs.pom == 'true' || needs.changes.outputs.ui == 'true')
name: Dependency licenses
needs: [changes]
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: "11"
cache: "maven"
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: "1.17"
- name: Check Dependencies Licenses
run: |
go install github.com/apache/skywalking-eyes/cmd/license-eye@5b7ee1731d036b5aac68f8bd3fc9e6f98ada082e
license-eye dependency resolve --summary ./dist-material/release-docs/LICENSE.tpl || exit 1
if [ ! -z "$(git diff -U0 ./dist-material/release-docs/LICENSE)" ]; then
echo "LICENSE file is not updated correctly"
git diff -U0 ./dist-material/release-docs/LICENSE
exit 1
fi

@shalk
Copy link
Contributor Author

shalk commented Jun 24, 2024

This is header fix.(Source files have proper headers), But I mean this

dependency-license:
if: |
( always() && ! cancelled() ) &&
((github.event_name == 'schedule' && github.repository == 'apache/skywalking') || needs.changes.outputs.pom == 'true' || needs.changes.outputs.ui == 'true')
name: Dependency licenses
needs: [changes]
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: "11"
cache: "maven"
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: "1.17"
- name: Check Dependencies Licenses
run: |
go install github.com/apache/skywalking-eyes/cmd/license-eye@5b7ee1731d036b5aac68f8bd3fc9e6f98ada082e
license-eye dependency resolve --summary ./dist-material/release-docs/LICENSE.tpl || exit 1
if [ ! -z "$(git diff -U0 ./dist-material/release-docs/LICENSE)" ]; then
echo "LICENSE file is not updated correctly"
git diff -U0 ./dist-material/release-docs/LICENSE
exit 1
fi

Please check the license change.

I am not sure what happend , so many nodejs related is deleted.

@wu-sheng
Copy link
Member

Have you ever build the project and run that? I doubt that.

Nodejs part is introduced from UI, which is a part of this project.

@shalk shalk force-pushed the update-nacos-to-2.3.2 branch from 838bc65 to c6f6705 Compare June 25, 2024 04:05
@wu-sheng
Copy link
Member

Could you explain why other libs out of nacos have been changed?

@shalk
Copy link
Contributor Author

shalk commented Jun 25, 2024

These change may effect by nacos , I dig in deep.

  1. commons-codec is chagned to 1.15 . This is because nacos dep on commons-codes 1.5, But module apache-skywalking-apm do not have the depedencyManagement. So the version in oap-server-bom do not take effect.
INFO] ------------< org.apache.skywalking:apache-skywalking-apm >-------------
[INFO] Building apache-skywalking-apm 10.1.0-SNAPSHOT                   [89/89]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO] 
[INFO] --- maven-dependency-plugin:3.6.0:resolve (default-cli) @ apache-skywalking-apm ---
[INFO] 
[INFO] The following files have been resolved:
[INFO]    org.apache.skywalking:server-starter:jar:10.1.0-SNAPSHOT:compile
...
[INFO]    com.alibaba.nacos:nacos-client:jar:2.3.2:compile
[INFO]    com.alibaba.nacos:nacos-auth-plugin:jar:2.3.2:compile
[INFO]    com.alibaba.nacos:nacos-encryption-plugin:jar:2.3.2:compile
[INFO]    commons-codec:commons-codec:jar:1.15:compile
  1. commons-logging is deleted, because nacos-client do not dep on commons-logging any more.

  2. org.apache.httpcomponents/httpasyncclient is not management in any depedencyManagement, which is depedency by nacos-clien

  3. org.apache.httpcomponents/httpclient 4.5.13 , i think this is right version, because <httpclient.version>4.5.13</httpclient.version>

  4. org.apache.httpcomponents/httpcore/4.4.16 , the problem is the same with commons-codec.

  5. com.aayushatharva.brotli4j/native-osx-aarch64/1.15.0 because my local machine is macos, this is not releated to nacos.

so for problem

  • 1,5 i will add depedencyManagement in module apache-skywalking-apm ,
  • 3, i will add depency in bom,
  • 2,4 is not problem
  • 6 i will keep it . it look like a optional dep. we should include the dep in license file ?

@shalk
Copy link
Contributor Author

shalk commented Jun 25, 2024

I look like add depedencyManagement fix some other dependency check

for example, jackson version should be 2.16.0, this is consystent with jackson.version in oap-server-bom

Comment on lines +37 to +47
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.skywalking</groupId>
<artifactId>oap-server-bom</artifactId>
<version>${project.version}</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to add this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

module apache-skywalking-apm without dependencyManagement can not handle dependency conflict and version management

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oap-server has that, and dist itself is just packaging, it should not include any new dependency AFAIK.

@wu-sheng
Copy link
Member

com.aayushatharva.brotli4j/native-osx-aarch64/1.15.0 because my local machine is macos, this is not releated to nacos.

This should be removed. The CI check is running on Linux only. This dependency will trigger an error.

@wu-sheng
Copy link
Member

As expected, CI fails

diff --git a/dist-material/release-docs/LICENSE b/dist-material/release-docs/LICENSE
index 2e3a577..efce54e 100644
--- a/dist-material/release-docs/LICENSE
+++ b/dist-material/release-docs/LICENSE
@@ -214 +213,0 @@ The text of each license is the standard Apache 2.0 license.
-    https://mvnrepository.com/artifact/com.aayushatharva.brotli4j/native-osx-aarch64/1.15.0 Apache-2.0

@wu-sheng
Copy link
Member

About this PR still, you don't have

  1. Config and cluster management docs update about Nacos version requirements.
  2. Change logs are not updated.
  3. Please share your local relative tests about how this works on new Nacos server.

@wu-sheng
Copy link
Member

This is still missing.

image

@wu-sheng
Copy link
Member

  1. Please share your local relative tests about how this works on new Nacos server.

Please share screenshots from Nacos UIs about how the cluster registration and configurations look like on there.

@shalk
Copy link
Contributor Author

shalk commented Jun 25, 2024

1
2


skywalking-nacos-dynamic-config-1
skywalking-nacos-dynamic-config-2

@wu-sheng
Copy link
Member

The screenshots are good. Please fix other parts.

shalk and others added 3 commits June 26, 2024 10:04
Co-authored-by: 吴晟 Wu Sheng <wu.sheng@foxmail.com>
Co-authored-by: 吴晟 Wu Sheng <wu.sheng@foxmail.com>
Copy link
Member

@kezhenxu94 kezhenxu94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also mention this is a breaking change in the CHANGES.md, users who are using Nacos now will be broken after upgrade

@@ -29,5 +30,6 @@
* Move the Official Dashboard docs to marketplace docs.
* Add marketplace introduction docs under `quick start` menu to reduce the confusion of finding feature docs.
* Update Windows Metrics(Swap -> Virtual Memory)
* [Break Change] Update Nacos version to 2.3.2.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why UI matters about this?

@@ -19,6 +19,7 @@
* Add Python as a supported language for Pulsar.
* Make more proper histogram buckets for the `persistence_timer_bulk_prepare_latency`,
`persistence_timer_bulk_execute_latency` and `persistence_timer_bulk_all_latency` metrics in PersistenceTimer.
* [Break Change] Update Nacos version to 2.3.2.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* [Break Change] Update Nacos version to 2.3.2.
* [Break Change] Update Nacos version to 2.3.2. Nacod 1.x server can't serve as cluster coordinator and configuration server.

Copy link
Member

@kezhenxu94 kezhenxu94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@wu-sheng wu-sheng merged commit b04fd3c into apache:master Jun 26, 2024
155 of 156 checks passed
@wu-sheng wu-sheng added this to the 10.1.0 milestone Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend OAP backend related. dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants