From e6873b47c29e84173028cafe1c58efc7044508d8 Mon Sep 17 00:00:00 2001 From: jianbin Date: Thu, 5 Sep 2024 11:31:10 +0800 Subject: [PATCH 01/21] Merge the packaging processes of Naming Server and Seata Server --- distribution/Dockerfile | 3 +- distribution/pom.xml | 40 +--------- distribution/release-seata-namingserver.xml | 86 --------------------- distribution/release-seata.xml | 66 +++++++++++----- namingserver/pom.xml | 2 +- 5 files changed, 52 insertions(+), 145 deletions(-) delete mode 100644 distribution/release-seata-namingserver.xml diff --git a/distribution/Dockerfile b/distribution/Dockerfile index 6c6bf88d745..f3e8162f15d 100644 --- a/distribution/Dockerfile +++ b/distribution/Dockerfile @@ -38,7 +38,8 @@ ADD ext/ /seata-server/ext ADD target/ /seata-server/target ADD lib/ /seata-server/lib ADD conf/ /seata-server/conf -ADD LICENSE /seata-server/LICENSE +ADD LICENSE ./LICENSE +ADD NOTICE ./LICENSE # set extra environment ENV LOADER_PATH="/seata-server/lib" diff --git a/distribution/pom.xml b/distribution/pom.xml index 8c3f30e4216..5520c8ce09c 100644 --- a/distribution/pom.xml +++ b/distribution/pom.xml @@ -45,49 +45,17 @@ org.apache.seata - apm-seata-skywalking-plugin + seata-namingserver ${project.version} - - - apache-seata - - - org.apache.maven.plugins - maven-assembly-plugin - ${maven-assembly-plugin.version} - - - release-seata.xml - - - - - make-assembly - install - - single - - - - - - - - - release-seata-namingserver - - false - - org.apache.seata - seata-namingserver + apm-seata-skywalking-plugin ${project.version} - apache-seata-namingserver + apache-seata org.apache.maven.plugins @@ -95,7 +63,7 @@ ${maven-assembly-plugin.version} - release-seata-namingserver.xml + release-seata.xml diff --git a/distribution/release-seata-namingserver.xml b/distribution/release-seata-namingserver.xml deleted file mode 100644 index b5f85bb32bd..00000000000 --- a/distribution/release-seata-namingserver.xml +++ /dev/null @@ -1,86 +0,0 @@ - - - - ${project.version}-incubating-bin - true - - dir - tar.gz - zip - - - - - - - bin/seata-namingserver.bat - bin/seata-namingserver.sh - bin/seata-namingserver-setup.sh - - 0755 - - - - ../namingserver/target/lib/ - lib - - - ../namingserver/src/main/resources/logback/ - conf/logback/ - - **/*.xml - - - - - - logs/** - - - - - - - - - - ../namingserver/target/seata-namingserver-exec.jar - target/ - seata-namingserver.jar - - - ../namingserver/src/main/resources/logback-spring.xml - conf/ - - - ../namingserver/src/main/resources/application.yml - conf/ - - - - - - true - - org.apache.seata:namingserver - - - - \ No newline at end of file diff --git a/distribution/release-seata.xml b/distribution/release-seata.xml index d8232894841..7ef307f8e6a 100644 --- a/distribution/release-seata.xml +++ b/distribution/release-seata.xml @@ -39,18 +39,13 @@ bin/seata-server.sh bin/seata-setup.sh + seata-server/bin/ 0755 - - - logs/** - - - ../server/src/main/resources/logback/ - conf/logback/ + seata-server/conf/logback/ **/*.xml @@ -58,23 +53,35 @@ ../ext/apm-seata-skywalking-plugin/target/ext/skywalking-agent/ - ext/apm-skywalking + seata-server/ext/apm-skywalking ../server/target/lib/ - lib + seata-server/lib - + - ../script/ - script - **/server/ - **/logstash/ - **/config-center/ + bin/seata-namingserver.bat + bin/seata-namingserver.sh + bin/seata-namingserver-setup.sh + seata-namingserver/bin/ + 0755 + + + ../namingserver/target/lib/ + seata-namingserver/lib + + ../namingserver/src/main/resources/logback/ + seata-namingserver/conf/logback/ + + **/*.xml + + + @@ -100,32 +107,48 @@ ../server/target/seata-server-exec.jar - target/ + seata-server/target/ seata-server.jar ../server/src/main/resources/application.yml - conf/ + seata-server/conf/ ../server/src/main/resources/application.example.yml - conf/ + seata-server/conf/ ../server/src/main/resources/application.raft.example.yml - conf/ + seata-server/conf/ ../server/src/main/resources/logback-spring.xml - conf/ + seata-server/conf/ NOTICE.md - lib/jdbc/ + seata-server/lib/jdbc/ + + + + + ../namingserver/target/seata-namingserver-exec.jar + seata-namingserver/target/ + seata-namingserver.jar + + ../namingserver/src/main/resources/logback-spring.xml + seata-namingserver/conf/ + + + ../namingserver/src/main/resources/application.yml + seata-namingserver/conf/ + + @@ -133,6 +156,7 @@ true org.apache.seata:seata-server + org.apache.seata:seata-namingserver diff --git a/namingserver/pom.xml b/namingserver/pom.xml index 4ed5764fa82..d424f3eb720 100644 --- a/namingserver/pom.xml +++ b/namingserver/pom.xml @@ -162,7 +162,7 @@ - release-seata-namingserver + release-seata false From e97be2f6293a2f491b4fa840f90450226e4c070e Mon Sep 17 00:00:00 2001 From: jianbin Date: Thu, 5 Sep 2024 15:05:37 +0800 Subject: [PATCH 02/21] Merge the packaging processes of Naming Server and Seata Server --- distribution/release-seata.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/distribution/release-seata.xml b/distribution/release-seata.xml index 7ef307f8e6a..3970fcc6c8a 100644 --- a/distribution/release-seata.xml +++ b/distribution/release-seata.xml @@ -39,7 +39,7 @@ bin/seata-server.sh bin/seata-setup.sh - seata-server/bin/ + seata-server/ 0755 @@ -67,7 +67,7 @@ bin/seata-namingserver.sh bin/seata-namingserver-setup.sh - seata-namingserver/bin/ + seata-namingserver/ 0755 From 79314f7e08c472cd3f53e8e6406024127534174a Mon Sep 17 00:00:00 2001 From: jianbin Date: Thu, 5 Sep 2024 15:09:36 +0800 Subject: [PATCH 03/21] Merge the packaging processes of Naming Server and Seata Server --- changes/en-us/2.x.md | 1 + changes/zh-cn/2.x.md | 2 ++ 2 files changed, 3 insertions(+) diff --git a/changes/en-us/2.x.md b/changes/en-us/2.x.md index e679f0e9971..d0fa76ad34c 100644 --- a/changes/en-us/2.x.md +++ b/changes/en-us/2.x.md @@ -81,6 +81,7 @@ Add changes here for all PR submitted to the 2.x branch. - [[#6794](https://github.com/apache/incubator-seata/pull/6794)] optimize NacosMockTest UT case - [[#6806](https://github.com/apache/incubator-seata/pull/6806)] optimize `tableMeta` cache scheduled refresh issue - [[#6808](https://github.com/apache/incubator-seata/pull/6808)] change version to 2.2.0-SNAPSHOT +- [[#6819](https://github.com/apache/incubator-seata/pull/6819)] merge the packaging processes of namingserver and seata-server ### refactor: diff --git a/changes/zh-cn/2.x.md b/changes/zh-cn/2.x.md index 522197f7b34..4e2980ab5dc 100644 --- a/changes/zh-cn/2.x.md +++ b/changes/zh-cn/2.x.md @@ -81,6 +81,8 @@ - [[#6793](https://github.com/apache/incubator-seata/pull/6795)] 独立server的meta信息初始化逻辑 - [[#6806](https://github.com/apache/incubator-seata/pull/6806)] 优化`tableMeta`缓存定时刷新问题 - [[#6808](https://github.com/apache/incubator-seata/pull/6808)] 修改版本号为2.2.0-SNAPSHOT +- [[#6819](https://github.com/apache/incubator-seata/pull/6819)] namingserver与server的合并打包 + ### refactor: From 5555ee6496b95022c40dd6157cc1ff17970928de Mon Sep 17 00:00:00 2001 From: jianbin Date: Thu, 5 Sep 2024 16:31:08 +0800 Subject: [PATCH 04/21] Merge the packaging processes of Naming Server and Seata Server --- .asf.yaml | 1 + codecov.yml | 1 + common/src/test/resources/io/TestFile.txt | 17 +++++++++++++++++ .../exporter/prometheus/CompactSummaryTest.java | 6 +++--- script/config-center/config.txt | 17 +++++++++++++++++ .../helm/seata-server/templates/NOTES.txt | 17 +++++++++++++++++ 6 files changed, 56 insertions(+), 3 deletions(-) diff --git a/.asf.yaml b/.asf.yaml index 9e55b09591e..c7c9f88d0e6 100644 --- a/.asf.yaml +++ b/.asf.yaml @@ -14,6 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # + github: description: ":fire: Seata is an easy-to-use, high-performance, open source distributed transaction solution." homepage: https://seata.apache.org/ diff --git a/codecov.yml b/codecov.yml index 90f598c7a7c..7700d060120 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,3 +1,4 @@ +# # 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. diff --git a/common/src/test/resources/io/TestFile.txt b/common/src/test/resources/io/TestFile.txt index 2944f981947..6b3c4db9b5c 100644 --- a/common/src/test/resources/io/TestFile.txt +++ b/common/src/test/resources/io/TestFile.txt @@ -1,3 +1,20 @@ +==== + 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. +==== + /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with diff --git a/metrics/seata-metrics-registry-compact/src/test/java/org/apache/seata/metrics/exporter/prometheus/CompactSummaryTest.java b/metrics/seata-metrics-registry-compact/src/test/java/org/apache/seata/metrics/exporter/prometheus/CompactSummaryTest.java index c93c99e6003..d8c9569e685 100644 --- a/metrics/seata-metrics-registry-compact/src/test/java/org/apache/seata/metrics/exporter/prometheus/CompactSummaryTest.java +++ b/metrics/seata-metrics-registry-compact/src/test/java/org/apache/seata/metrics/exporter/prometheus/CompactSummaryTest.java @@ -66,9 +66,9 @@ public void testCount() { @Test public void testTps() { - compactSummary.increase(5); - compactSummary.increase(10); - compactSummary.increase(15); + compactSummary.increase(51111); + compactSummary.increase(1111110); + compactSummary.increase(111115); // Assuming that the time taken is 1 second assertTrue(compactSummary.tps() >0); } diff --git a/script/config-center/config.txt b/script/config-center/config.txt index 82b39c83173..0693dc6228f 100644 --- a/script/config-center/config.txt +++ b/script/config-center/config.txt @@ -1,3 +1,20 @@ +==== + 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. +==== + # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with diff --git a/script/server/helm/seata-server/templates/NOTES.txt b/script/server/helm/seata-server/templates/NOTES.txt index 96d7cf6504a..707d55e07f3 100644 --- a/script/server/helm/seata-server/templates/NOTES.txt +++ b/script/server/helm/seata-server/templates/NOTES.txt @@ -1,3 +1,20 @@ +==== + 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. +==== + # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with From 75c737c915391d3c5dffb65e9d743b6cfb4e1888 Mon Sep 17 00:00:00 2001 From: funkye Date: Thu, 5 Sep 2024 16:39:45 +0800 Subject: [PATCH 05/21] Update common/src/test/resources/io/TestFile.txt --- common/src/test/resources/io/TestFile.txt | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/common/src/test/resources/io/TestFile.txt b/common/src/test/resources/io/TestFile.txt index 6b3c4db9b5c..2944f981947 100644 --- a/common/src/test/resources/io/TestFile.txt +++ b/common/src/test/resources/io/TestFile.txt @@ -1,20 +1,3 @@ -==== - 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. -==== - /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with From f4896a484690e7a6f8ccec21c5b468ea4197a9fb Mon Sep 17 00:00:00 2001 From: jianbin Date: Thu, 5 Sep 2024 16:42:48 +0800 Subject: [PATCH 06/21] Merge the packaging processes of Naming Server and Seata Server --- distribution/release-seata.xml | 11 +++++++++++ .../exporter/prometheus/CompactSummaryTest.java | 1 + 2 files changed, 12 insertions(+) diff --git a/distribution/release-seata.xml b/distribution/release-seata.xml index 3970fcc6c8a..a2751b3b407 100644 --- a/distribution/release-seata.xml +++ b/distribution/release-seata.xml @@ -60,6 +60,17 @@ ../server/target/lib/ seata-server/lib + + + ../script/ + seata-server/script + + **/server/ + **/logstash/ + **/config-center/ + + + diff --git a/metrics/seata-metrics-registry-compact/src/test/java/org/apache/seata/metrics/exporter/prometheus/CompactSummaryTest.java b/metrics/seata-metrics-registry-compact/src/test/java/org/apache/seata/metrics/exporter/prometheus/CompactSummaryTest.java index d8c9569e685..794b3903361 100644 --- a/metrics/seata-metrics-registry-compact/src/test/java/org/apache/seata/metrics/exporter/prometheus/CompactSummaryTest.java +++ b/metrics/seata-metrics-registry-compact/src/test/java/org/apache/seata/metrics/exporter/prometheus/CompactSummaryTest.java @@ -66,6 +66,7 @@ public void testCount() { @Test public void testTps() { + CompactSummary compactSummary = new CompactSummary(id); compactSummary.increase(51111); compactSummary.increase(1111110); compactSummary.increase(111115); From 12567d0a53d91fc474944bc2a37d72db7887705a Mon Sep 17 00:00:00 2001 From: jianbin Date: Thu, 5 Sep 2024 16:47:41 +0800 Subject: [PATCH 07/21] test --- .../seata/metrics/exporter/prometheus/CompactSummaryTest.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/metrics/seata-metrics-registry-compact/src/test/java/org/apache/seata/metrics/exporter/prometheus/CompactSummaryTest.java b/metrics/seata-metrics-registry-compact/src/test/java/org/apache/seata/metrics/exporter/prometheus/CompactSummaryTest.java index 794b3903361..1d8fc2e5159 100644 --- a/metrics/seata-metrics-registry-compact/src/test/java/org/apache/seata/metrics/exporter/prometheus/CompactSummaryTest.java +++ b/metrics/seata-metrics-registry-compact/src/test/java/org/apache/seata/metrics/exporter/prometheus/CompactSummaryTest.java @@ -66,12 +66,15 @@ public void testCount() { @Test public void testTps() { + System.out.println("current: "+ System.currentTimeMillis()); CompactSummary compactSummary = new CompactSummary(id); compactSummary.increase(51111); compactSummary.increase(1111110); compactSummary.increase(111115); // Assuming that the time taken is 1 second + System.out.println("tps time: "+ System.currentTimeMillis()); assertTrue(compactSummary.tps() >0); + System.out.println("tps endtime: "+ System.currentTimeMillis()); } @Test From bd245fe8c3a2327958c8d99ab30017c6cb333169 Mon Sep 17 00:00:00 2001 From: funkye Date: Thu, 5 Sep 2024 16:56:21 +0800 Subject: [PATCH 08/21] Update script/server/helm/seata-server/templates/NOTES.txt --- .../helm/seata-server/templates/NOTES.txt | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/script/server/helm/seata-server/templates/NOTES.txt b/script/server/helm/seata-server/templates/NOTES.txt index 707d55e07f3..96d7cf6504a 100644 --- a/script/server/helm/seata-server/templates/NOTES.txt +++ b/script/server/helm/seata-server/templates/NOTES.txt @@ -1,20 +1,3 @@ -==== - 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. -==== - # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with From f9cf6b763daab19bbf4a4eb3ae640c4e022647f8 Mon Sep 17 00:00:00 2001 From: funkye Date: Thu, 5 Sep 2024 16:57:24 +0800 Subject: [PATCH 09/21] Update script/config-center/config.txt --- script/config-center/config.txt | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/script/config-center/config.txt b/script/config-center/config.txt index 0693dc6228f..82b39c83173 100644 --- a/script/config-center/config.txt +++ b/script/config-center/config.txt @@ -1,20 +1,3 @@ -==== - 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. -==== - # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with From 5cc675e18f8455ceded4e218bac0172e850bad77 Mon Sep 17 00:00:00 2001 From: jianbin Date: Thu, 5 Sep 2024 17:18:48 +0800 Subject: [PATCH 10/21] test --- .../seata/metrics/exporter/prometheus/CompactSummaryTest.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/metrics/seata-metrics-registry-compact/src/test/java/org/apache/seata/metrics/exporter/prometheus/CompactSummaryTest.java b/metrics/seata-metrics-registry-compact/src/test/java/org/apache/seata/metrics/exporter/prometheus/CompactSummaryTest.java index 1d8fc2e5159..fce7e35e183 100644 --- a/metrics/seata-metrics-registry-compact/src/test/java/org/apache/seata/metrics/exporter/prometheus/CompactSummaryTest.java +++ b/metrics/seata-metrics-registry-compact/src/test/java/org/apache/seata/metrics/exporter/prometheus/CompactSummaryTest.java @@ -69,8 +69,11 @@ public void testTps() { System.out.println("current: "+ System.currentTimeMillis()); CompactSummary compactSummary = new CompactSummary(id); compactSummary.increase(51111); + System.out.println("tps: "+ compactSummary.tps()+", count: "+compactSummary.count()+ " ,total:"+compactSummary.total()); compactSummary.increase(1111110); + System.out.println("tps: "+ compactSummary.tps()+", count: "+compactSummary.count()+ " ,total:"+compactSummary.total()); compactSummary.increase(111115); + System.out.println("tps: "+ compactSummary.tps()+", count: "+compactSummary.count()+ " ,total:"+compactSummary.total()); // Assuming that the time taken is 1 second System.out.println("tps time: "+ System.currentTimeMillis()); assertTrue(compactSummary.tps() >0); From f2ee0cce9725a70046494e7560d8e18aae87490c Mon Sep 17 00:00:00 2001 From: jianbin Date: Thu, 5 Sep 2024 17:46:45 +0800 Subject: [PATCH 11/21] test --- .../apache/seata/metrics/registry/compact/CompactSummary.java | 1 + .../org/apache/seata/metrics/registry/compact/SummaryValue.java | 1 + 2 files changed, 2 insertions(+) diff --git a/metrics/seata-metrics-registry-compact/src/main/java/org/apache/seata/metrics/registry/compact/CompactSummary.java b/metrics/seata-metrics-registry-compact/src/main/java/org/apache/seata/metrics/registry/compact/CompactSummary.java index acdf6fa244c..aa908107ac4 100644 --- a/metrics/seata-metrics-registry-compact/src/main/java/org/apache/seata/metrics/registry/compact/CompactSummary.java +++ b/metrics/seata-metrics-registry-compact/src/main/java/org/apache/seata/metrics/registry/compact/CompactSummary.java @@ -80,6 +80,7 @@ public long count() { @Override public double tps() { + System.out.println("clock.getCurrentMilliseconds(): "+clock.getCurrentMilliseconds()); return this.value.getTps(clock.getCurrentMilliseconds()); } diff --git a/metrics/seata-metrics-registry-compact/src/main/java/org/apache/seata/metrics/registry/compact/SummaryValue.java b/metrics/seata-metrics-registry-compact/src/main/java/org/apache/seata/metrics/registry/compact/SummaryValue.java index 5cd13fe8a9b..c4ea2eecd1a 100644 --- a/metrics/seata-metrics-registry-compact/src/main/java/org/apache/seata/metrics/registry/compact/SummaryValue.java +++ b/metrics/seata-metrics-registry-compact/src/main/java/org/apache/seata/metrics/registry/compact/SummaryValue.java @@ -38,6 +38,7 @@ public long getTotal() { } public double getTps(double currentMilliseconds) { + System.out.println("currentMilliseconds: "+currentMilliseconds+" , startMilliseconds: "+startMilliseconds); if (currentMilliseconds <= startMilliseconds) { return 0; } From dad53daf2744a69e4eb9d73f20884cd53d6674c8 Mon Sep 17 00:00:00 2001 From: jianbin Date: Thu, 5 Sep 2024 17:51:32 +0800 Subject: [PATCH 12/21] test --- .../apache/seata/metrics/registry/compact/CompactSummary.java | 2 +- .../apache/seata/metrics/registry/compact/SummaryValue.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/metrics/seata-metrics-registry-compact/src/main/java/org/apache/seata/metrics/registry/compact/CompactSummary.java b/metrics/seata-metrics-registry-compact/src/main/java/org/apache/seata/metrics/registry/compact/CompactSummary.java index aa908107ac4..9863918f775 100644 --- a/metrics/seata-metrics-registry-compact/src/main/java/org/apache/seata/metrics/registry/compact/CompactSummary.java +++ b/metrics/seata-metrics-registry-compact/src/main/java/org/apache/seata/metrics/registry/compact/CompactSummary.java @@ -80,7 +80,7 @@ public long count() { @Override public double tps() { - System.out.println("clock.getCurrentMilliseconds(): "+clock.getCurrentMilliseconds()); + System.out.println("clock.getCurrentMilliseconds(): " + clock.getCurrentMilliseconds()); return this.value.getTps(clock.getCurrentMilliseconds()); } diff --git a/metrics/seata-metrics-registry-compact/src/main/java/org/apache/seata/metrics/registry/compact/SummaryValue.java b/metrics/seata-metrics-registry-compact/src/main/java/org/apache/seata/metrics/registry/compact/SummaryValue.java index c4ea2eecd1a..7c46bfb4d09 100644 --- a/metrics/seata-metrics-registry-compact/src/main/java/org/apache/seata/metrics/registry/compact/SummaryValue.java +++ b/metrics/seata-metrics-registry-compact/src/main/java/org/apache/seata/metrics/registry/compact/SummaryValue.java @@ -38,7 +38,8 @@ public long getTotal() { } public double getTps(double currentMilliseconds) { - System.out.println("currentMilliseconds: "+currentMilliseconds+" , startMilliseconds: "+startMilliseconds); + System.out + .println("currentMilliseconds: " + currentMilliseconds + " , startMilliseconds: " + startMilliseconds); if (currentMilliseconds <= startMilliseconds) { return 0; } From e027a0deebf202264ca025309e9fcc740c00b6f0 Mon Sep 17 00:00:00 2001 From: jianbin Date: Thu, 5 Sep 2024 17:53:48 +0800 Subject: [PATCH 13/21] test --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 19ae2838681..e8df86b2ff0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -44,7 +44,7 @@ jobs: if: matrix.java == '8' run: | ./mvnw -T 4C clean test \ - -Dcheckstyle.skip=false -Dpmd.skip=false -Dlicense.skip=false -DredisCaseEnabled=true \ + -Dpmd.skip=false -Dlicense.skip=false -DredisCaseEnabled=true \ -e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn; # step 5.2 - name: "Test with Maven and Java${{ matrix.java }}" From 14da294d633f4f65236b493c210a95959efbc443 Mon Sep 17 00:00:00 2001 From: jianbin Date: Thu, 5 Sep 2024 17:59:43 +0800 Subject: [PATCH 14/21] test --- .../org/apache/seata/metrics/registry/compact/SummaryValue.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/metrics/seata-metrics-registry-compact/src/main/java/org/apache/seata/metrics/registry/compact/SummaryValue.java b/metrics/seata-metrics-registry-compact/src/main/java/org/apache/seata/metrics/registry/compact/SummaryValue.java index 7c46bfb4d09..e09085edf94 100644 --- a/metrics/seata-metrics-registry-compact/src/main/java/org/apache/seata/metrics/registry/compact/SummaryValue.java +++ b/metrics/seata-metrics-registry-compact/src/main/java/org/apache/seata/metrics/registry/compact/SummaryValue.java @@ -43,6 +43,8 @@ public double getTps(double currentMilliseconds) { if (currentMilliseconds <= startMilliseconds) { return 0; } + System.out + .println("total.doubleValue(): " + total.doubleValue() + " (currentMilliseconds - startMilliseconds) * 1000.0 " + (currentMilliseconds - startMilliseconds) * 1000.0); return total.doubleValue() / (currentMilliseconds - startMilliseconds) * 1000.0; } From 703d206229ad246a29b3432754791be9d49fe126 Mon Sep 17 00:00:00 2001 From: jianbin Date: Thu, 5 Sep 2024 18:08:55 +0800 Subject: [PATCH 15/21] test --- .../org/apache/seata/metrics/registry/compact/SummaryValue.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/metrics/seata-metrics-registry-compact/src/main/java/org/apache/seata/metrics/registry/compact/SummaryValue.java b/metrics/seata-metrics-registry-compact/src/main/java/org/apache/seata/metrics/registry/compact/SummaryValue.java index e09085edf94..5af273e3ce6 100644 --- a/metrics/seata-metrics-registry-compact/src/main/java/org/apache/seata/metrics/registry/compact/SummaryValue.java +++ b/metrics/seata-metrics-registry-compact/src/main/java/org/apache/seata/metrics/registry/compact/SummaryValue.java @@ -41,6 +41,8 @@ public double getTps(double currentMilliseconds) { System.out .println("currentMilliseconds: " + currentMilliseconds + " , startMilliseconds: " + startMilliseconds); if (currentMilliseconds <= startMilliseconds) { + System.out + .println("getTps: 0"); return 0; } System.out From 08240e2fe6f82bb08216e4b20baabdfd207775f0 Mon Sep 17 00:00:00 2001 From: jianbin Date: Thu, 5 Sep 2024 18:14:17 +0800 Subject: [PATCH 16/21] test --- .../seata/metrics/exporter/prometheus/CompactSummaryTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metrics/seata-metrics-registry-compact/src/test/java/org/apache/seata/metrics/exporter/prometheus/CompactSummaryTest.java b/metrics/seata-metrics-registry-compact/src/test/java/org/apache/seata/metrics/exporter/prometheus/CompactSummaryTest.java index fce7e35e183..0f53f2c745e 100644 --- a/metrics/seata-metrics-registry-compact/src/test/java/org/apache/seata/metrics/exporter/prometheus/CompactSummaryTest.java +++ b/metrics/seata-metrics-registry-compact/src/test/java/org/apache/seata/metrics/exporter/prometheus/CompactSummaryTest.java @@ -66,8 +66,8 @@ public void testCount() { @Test public void testTps() { + CompactSummary compactSummary = new CompactSummary(new Id("test")); System.out.println("current: "+ System.currentTimeMillis()); - CompactSummary compactSummary = new CompactSummary(id); compactSummary.increase(51111); System.out.println("tps: "+ compactSummary.tps()+", count: "+compactSummary.count()+ " ,total:"+compactSummary.total()); compactSummary.increase(1111110); From 38ae9346ac047188d6c0014f9ae5e83f82821dd7 Mon Sep 17 00:00:00 2001 From: funky-eyes Date: Thu, 5 Sep 2024 23:00:06 +0800 Subject: [PATCH 17/21] fix ci --- .github/workflows/build.yml | 2 +- .../metrics/registry/compact/CompactSummary.java | 1 - .../metrics/registry/compact/SummaryValue.java | 6 ------ .../exporter/prometheus/CompactSummaryTest.java | 13 +++---------- 4 files changed, 4 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e8df86b2ff0..19ae2838681 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -44,7 +44,7 @@ jobs: if: matrix.java == '8' run: | ./mvnw -T 4C clean test \ - -Dpmd.skip=false -Dlicense.skip=false -DredisCaseEnabled=true \ + -Dcheckstyle.skip=false -Dpmd.skip=false -Dlicense.skip=false -DredisCaseEnabled=true \ -e -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn; # step 5.2 - name: "Test with Maven and Java${{ matrix.java }}" diff --git a/metrics/seata-metrics-registry-compact/src/main/java/org/apache/seata/metrics/registry/compact/CompactSummary.java b/metrics/seata-metrics-registry-compact/src/main/java/org/apache/seata/metrics/registry/compact/CompactSummary.java index 9863918f775..acdf6fa244c 100644 --- a/metrics/seata-metrics-registry-compact/src/main/java/org/apache/seata/metrics/registry/compact/CompactSummary.java +++ b/metrics/seata-metrics-registry-compact/src/main/java/org/apache/seata/metrics/registry/compact/CompactSummary.java @@ -80,7 +80,6 @@ public long count() { @Override public double tps() { - System.out.println("clock.getCurrentMilliseconds(): " + clock.getCurrentMilliseconds()); return this.value.getTps(clock.getCurrentMilliseconds()); } diff --git a/metrics/seata-metrics-registry-compact/src/main/java/org/apache/seata/metrics/registry/compact/SummaryValue.java b/metrics/seata-metrics-registry-compact/src/main/java/org/apache/seata/metrics/registry/compact/SummaryValue.java index 5af273e3ce6..5cd13fe8a9b 100644 --- a/metrics/seata-metrics-registry-compact/src/main/java/org/apache/seata/metrics/registry/compact/SummaryValue.java +++ b/metrics/seata-metrics-registry-compact/src/main/java/org/apache/seata/metrics/registry/compact/SummaryValue.java @@ -38,15 +38,9 @@ public long getTotal() { } public double getTps(double currentMilliseconds) { - System.out - .println("currentMilliseconds: " + currentMilliseconds + " , startMilliseconds: " + startMilliseconds); if (currentMilliseconds <= startMilliseconds) { - System.out - .println("getTps: 0"); return 0; } - System.out - .println("total.doubleValue(): " + total.doubleValue() + " (currentMilliseconds - startMilliseconds) * 1000.0 " + (currentMilliseconds - startMilliseconds) * 1000.0); return total.doubleValue() / (currentMilliseconds - startMilliseconds) * 1000.0; } diff --git a/metrics/seata-metrics-registry-compact/src/test/java/org/apache/seata/metrics/exporter/prometheus/CompactSummaryTest.java b/metrics/seata-metrics-registry-compact/src/test/java/org/apache/seata/metrics/exporter/prometheus/CompactSummaryTest.java index 0f53f2c745e..c93c99e6003 100644 --- a/metrics/seata-metrics-registry-compact/src/test/java/org/apache/seata/metrics/exporter/prometheus/CompactSummaryTest.java +++ b/metrics/seata-metrics-registry-compact/src/test/java/org/apache/seata/metrics/exporter/prometheus/CompactSummaryTest.java @@ -66,18 +66,11 @@ public void testCount() { @Test public void testTps() { - CompactSummary compactSummary = new CompactSummary(new Id("test")); - System.out.println("current: "+ System.currentTimeMillis()); - compactSummary.increase(51111); - System.out.println("tps: "+ compactSummary.tps()+", count: "+compactSummary.count()+ " ,total:"+compactSummary.total()); - compactSummary.increase(1111110); - System.out.println("tps: "+ compactSummary.tps()+", count: "+compactSummary.count()+ " ,total:"+compactSummary.total()); - compactSummary.increase(111115); - System.out.println("tps: "+ compactSummary.tps()+", count: "+compactSummary.count()+ " ,total:"+compactSummary.total()); + compactSummary.increase(5); + compactSummary.increase(10); + compactSummary.increase(15); // Assuming that the time taken is 1 second - System.out.println("tps time: "+ System.currentTimeMillis()); assertTrue(compactSummary.tps() >0); - System.out.println("tps endtime: "+ System.currentTimeMillis()); } @Test From 0895c25c152cc2ea3675a57b7e792fbeaa4f5cea Mon Sep 17 00:00:00 2001 From: funky-eyes Date: Sun, 8 Sep 2024 15:22:46 +0800 Subject: [PATCH 18/21] support namingserver dockerfile --- distribution/docker/namingserver/Dockerfile | 46 +++++++++++++++++++++ distribution/{ => docker/server}/Dockerfile | 14 +++---- distribution/release-seata.xml | 8 +++- pom.xml | 2 + 4 files changed, 62 insertions(+), 8 deletions(-) create mode 100644 distribution/docker/namingserver/Dockerfile rename distribution/{ => docker/server}/Dockerfile (77%) diff --git a/distribution/docker/namingserver/Dockerfile b/distribution/docker/namingserver/Dockerfile new file mode 100644 index 00000000000..154ec5dd538 --- /dev/null +++ b/distribution/docker/namingserver/Dockerfile @@ -0,0 +1,46 @@ +# +# 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. +# + +# the Dockerfile support x86 & arrch64 +# build: +# 1. mvn -Prelease-seata -Dmaven.test.skip=true clean install -U +# 2. cd distribution/target/apache-seata-x.x.x-SNAPSHOT-incubating-bin/apache-seata/seata-namingserver/ +# 3. docker build --no-cache --build-arg SEATA_VERSION=2.2.0-SNAPSHOT -t seata-namingserver:2.2.0-dev . +# +# run: +# 1. docker run --name=seata-namingserver -d seata-namingserver:2.2.0-dev +# +# https://hub.docker.com/r/apache/seata-namingserver +FROM openjdk:8u342 + +# set label +LABEL maintainer="Seata " + +WORKDIR /$BASE_DIR + +# ADD FORM distribution +ADD bin/ /seata-namingserver/bin +ADD lib/ /seata-namingserver/lib +ADD conf/ /seata-namingserver/conf +ADD target /seata-namingserver/target +ADD ../LICENSE ./LICENSE +ADD ../NOTICE ./LICENSE + +# set extra environment +ENV LOADER_PATH="/seata-namingserver/lib" +ENV TZ="Asia/Shanghai" +CMD ["bash","-c","/seata-namingserver/bin/seata-namingserver.sh && tail -f /dev/null"] diff --git a/distribution/Dockerfile b/distribution/docker/server/Dockerfile similarity index 77% rename from distribution/Dockerfile rename to distribution/docker/server/Dockerfile index f3e8162f15d..07038a341ce 100644 --- a/distribution/Dockerfile +++ b/distribution/docker/server/Dockerfile @@ -18,13 +18,13 @@ # the Dockerfile support x86 & arrch64 # build: # 1. mvn -Prelease-seata -Dmaven.test.skip=true clean install -U -# 2. cd distribution/target/seata-server-xxx/seata/ -# 3. docker build --no-cache --build-arg SEATA_VERSION=1.6.0-SNAPSHOT -t seata-server:1.6.0-dev . +# 2. cd distribution/target/apache-seata-x.x.x-SNAPSHOT-incubating-bin/apache-seata/seata-server/ +# 3. docker build --no-cache --build-arg SEATA_VERSION=2.2.0-SNAPSHOT -t seata-server:2.2.0-dev . # # run: -# 1. docker run --name=seata-server -d seata-server:1.6.0-dev +# 1. docker run --name=seata-server -d seata-server:2.2.0-dev # -# https://hub.docker.com/orgs/seataio +# https://hub.docker.com/r/apache/seata-server FROM openjdk:8u342 # set label @@ -35,11 +35,11 @@ WORKDIR /$BASE_DIR # ADD FORM distribution ADD bin/ /seata-server/bin ADD ext/ /seata-server/ext -ADD target/ /seata-server/target ADD lib/ /seata-server/lib ADD conf/ /seata-server/conf -ADD LICENSE ./LICENSE -ADD NOTICE ./LICENSE +ADD target /seata-server/target +ADD ../LICENSE ./LICENSE +ADD ../NOTICE ./LICENSE # set extra environment ENV LOADER_PATH="/seata-server/lib" diff --git a/distribution/release-seata.xml b/distribution/release-seata.xml index a2751b3b407..b8d22b5e018 100644 --- a/distribution/release-seata.xml +++ b/distribution/release-seata.xml @@ -97,8 +97,9 @@ - Dockerfile + docker/server/Dockerfile Dockerfile + seata-server/ @@ -146,6 +147,11 @@ + + docker/namingserver/Dockerfile + Dockerfile + seata-namingserver/ + ../namingserver/target/seata-namingserver-exec.jar seata-namingserver/target/ diff --git a/pom.xml b/pom.xml index 0edf5b10600..72264d3ada9 100644 --- a/pom.xml +++ b/pom.xml @@ -264,6 +264,8 @@ **/*.def + **/script/** + **/generated/** **/generated/** **/antlr/mysql/parser/*.* **/antlr/mysql/antlr/*.* From 81c0c7a314ba89f38032d5aa94c191320c67f0d7 Mon Sep 17 00:00:00 2001 From: funkye Date: Mon, 9 Sep 2024 09:22:40 +0800 Subject: [PATCH 19/21] Update .asf.yaml --- .asf.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.asf.yaml b/.asf.yaml index c7c9f88d0e6..9e55b09591e 100644 --- a/.asf.yaml +++ b/.asf.yaml @@ -14,7 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # - github: description: ":fire: Seata is an easy-to-use, high-performance, open source distributed transaction solution." homepage: https://seata.apache.org/ From 3fb1be4de05f3b9674e9f5da0f0ea8294a2e39c2 Mon Sep 17 00:00:00 2001 From: funkye Date: Mon, 9 Sep 2024 09:22:47 +0800 Subject: [PATCH 20/21] Update pom.xml --- pom.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/pom.xml b/pom.xml index 72264d3ada9..919ebc962e5 100644 --- a/pom.xml +++ b/pom.xml @@ -266,7 +266,6 @@ **/script/** **/generated/** - **/generated/** **/antlr/mysql/parser/*.* **/antlr/mysql/antlr/*.* **/antlr/mysql/stream/ANTLRNoCaseStringStream.java From 0e7fe9ef8095b602a3e28c28c5f45c0a1c3ee348 Mon Sep 17 00:00:00 2001 From: jianbin Date: Mon, 9 Sep 2024 13:35:47 +0800 Subject: [PATCH 21/21] opt --- distribution/docker/namingserver/Dockerfile | 2 +- distribution/docker/server/Dockerfile | 2 +- distribution/release-seata.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/distribution/docker/namingserver/Dockerfile b/distribution/docker/namingserver/Dockerfile index 154ec5dd538..9fe827ae295 100644 --- a/distribution/docker/namingserver/Dockerfile +++ b/distribution/docker/namingserver/Dockerfile @@ -18,7 +18,7 @@ # the Dockerfile support x86 & arrch64 # build: # 1. mvn -Prelease-seata -Dmaven.test.skip=true clean install -U -# 2. cd distribution/target/apache-seata-x.x.x-SNAPSHOT-incubating-bin/apache-seata/seata-namingserver/ +# 2. cd distribution/target/apache-seata-x.x.x-SNAPSHOT-incubating-bin/seata-namingserver/ # 3. docker build --no-cache --build-arg SEATA_VERSION=2.2.0-SNAPSHOT -t seata-namingserver:2.2.0-dev . # # run: diff --git a/distribution/docker/server/Dockerfile b/distribution/docker/server/Dockerfile index 07038a341ce..5f2f281f33f 100644 --- a/distribution/docker/server/Dockerfile +++ b/distribution/docker/server/Dockerfile @@ -18,7 +18,7 @@ # the Dockerfile support x86 & arrch64 # build: # 1. mvn -Prelease-seata -Dmaven.test.skip=true clean install -U -# 2. cd distribution/target/apache-seata-x.x.x-SNAPSHOT-incubating-bin/apache-seata/seata-server/ +# 2. cd distribution/target/apache-seata-x.x.x-SNAPSHOT-incubating-bin/seata-server/ # 3. docker build --no-cache --build-arg SEATA_VERSION=2.2.0-SNAPSHOT -t seata-server:2.2.0-dev . # # run: diff --git a/distribution/release-seata.xml b/distribution/release-seata.xml index b8d22b5e018..04c8f88b608 100644 --- a/distribution/release-seata.xml +++ b/distribution/release-seata.xml @@ -19,7 +19,7 @@ --> ${project.version}-incubating-bin - true + false dir tar.gz