You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@seata.apache.org by ji...@apache.org on 2024/12/10 08:05:34 UTC
(incubator-seata) branch 2.x updated: optimize: add namingserver jib (#7051)
This is an automated email from the ASF dual-hosted git repository.
jimin pushed a commit to branch 2.x
in repository https://gitbox.apache.org/repos/asf/incubator-seata.git
The following commit(s) were added to refs/heads/2.x by this push:
new 029dc91313 optimize: add namingserver jib (#7051)
029dc91313 is described below
commit 029dc913138a6fdd000bab189d1b134b70ae7476
Author: ggbocoder <11...@users.noreply.github.com>
AuthorDate: Tue Dec 10 16:05:30 2024 +0800
optimize: add namingserver jib (#7051)
---
.licenserc.yaml | 1 +
changes/en-us/2.x.md | 1 +
changes/zh-cn/2.x.md | 1 +
namingserver/pom.xml | 79 ++++++++++++++++++++++
namingserver/src/main/resources/banner.txt | 8 +++
.../docker/seata-naming-server-entrypoint.sh | 26 +++++++
6 files changed, 116 insertions(+)
diff --git a/.licenserc.yaml b/.licenserc.yaml
index ab61073001..426dffad0a 100644
--- a/.licenserc.yaml
+++ b/.licenserc.yaml
@@ -61,6 +61,7 @@ header:
- 'ext/apm-seata-skywalking-plugin/config/agent.config'
- 'server/src/main/resources/lua/redislocker/redislock.lua'
- 'server/src/main/resources/banner.txt'
+ - 'namingserver/src/main/resources/banner.txt'
- '**/*.json'
comment: on-failure
dependency:
diff --git a/changes/en-us/2.x.md b/changes/en-us/2.x.md
index d77b49a2b2..1b7dd65812 100644
--- a/changes/en-us/2.x.md
+++ b/changes/en-us/2.x.md
@@ -60,6 +60,7 @@ Add changes here for all PR submitted to the 2.x branch.
- [[#7040](https://github.com/apache/incubator-seata/pull/7040)] optimize the print info in ConfigurationFactory
- [[#7046](https://github.com/apache/incubator-seata/pull/7046)] remove the dependency conflict for spring-webmvc
- [[#7043](https://github.com/apache/incubator-seata/pull/7043)] finish rollback if sendResult/msg not found
+- [[#7051](https://github.com/apache/incubator-seata/pull/7051)] add namingserver jib
- [[#7054](https://github.com/apache/incubator-seata/pull/7054)] In file mode when the lock cannot be acquired output the holder's xid
### refactor:
diff --git a/changes/zh-cn/2.x.md b/changes/zh-cn/2.x.md
index 9cad39228f..9d6ad0afab 100644
--- a/changes/zh-cn/2.x.md
+++ b/changes/zh-cn/2.x.md
@@ -63,6 +63,7 @@
- [[#7040](https://github.com/apache/incubator-seata/pull/7040)] 优化ConfigurationFactory加载的打印信息
- [[#7046](https://github.com/apache/incubator-seata/pull/7046)] 去除spring-webmvc的依赖冲突
- [[#7043](https://github.com/apache/incubator-seata/pull/7043)] 在获取不到mq的sendResult时,直接完成回滚
+- [[#7051](https://github.com/apache/incubator-seata/pull/7051)] 为namingserver模块添加Jib支持以构建Docker镜像
- [[#7054](https://github.com/apache/incubator-seata/pull/7054)] file模式中竞争不到锁时输出持有者的xid
### refactor:
diff --git a/namingserver/pom.xml b/namingserver/pom.xml
index fba22f8f9a..a34b0027b9 100644
--- a/namingserver/pom.xml
+++ b/namingserver/pom.xml
@@ -195,6 +195,85 @@
</execution>
</executions>
</plugin>
+
+ <plugin>
+ <groupId>com.google.cloud.tools</groupId>
+ <artifactId>jib-maven-plugin</artifactId>
+ <version>${jib-maven-plugin.version}</version>
+ <configuration>
+ <from>
+ <image>${image.name}</image>
+ <platforms>
+ <platform>
+ <os>linux</os>
+ <architecture>amd64</architecture>
+ </platform>
+ <platform>
+ <os>linux</os>
+ <architecture>arm64</architecture>
+ </platform>
+ </platforms>
+ </from>
+ <to>
+ <image>docker.io/apache/seata-naming-server</image>
+ <tags>${image.tags}</tags>
+ <auth>
+ <username>${REGISTRY_USERNAME}</username>
+ <password>${REGISTRY_PASSWORD}</password>
+ </auth>
+ </to>
+ <container>
+ <appRoot>/seata-naming-server</appRoot>
+ <workingDirectory>/seata-naming-server</workingDirectory>
+ <ports>
+ <port>8080</port>
+ </ports>
+ <labels>
+ <name>seata-naming-server</name>
+ <git.commit.message.full>${git.commit.message.full}</git.commit.message.full>
+ <git.remote.origin.url>${git.remote.origin.url}</git.remote.origin.url>
+ <git.commit.id>${git.commit.id}</git.commit.id>
+ <git.commit.time>${git.commit.time}</git.commit.time>
+ <git.branch>${git.branch}</git.branch>
+ <git.build.time>${git.build.time}</git.build.time>
+ <git.build.version>${git.build.version}</git.build.version>
+ <git.dirty>${git.dirty}</git.dirty>
+ <mvn.build.version>${project.version}</mvn.build.version>
+ </labels>
+ <creationTime>USE_CURRENT_TIMESTAMP</creationTime>
+ <entrypoint>
+ <arg>/bin/bash</arg>
+ <arg>/seata-naming-server-entrypoint.sh</arg>
+ </entrypoint>
+ <environment>
+ <TZ>Asia/Shanghai</TZ>
+ </environment>
+ </container>
+ <extraDirectories>
+ <paths>
+ <path>
+ <from>src/main/resources/docker</from>
+ <includes>seata-naming-server-entrypoint.sh</includes>
+ </path>
+ <path>
+ <from>../distribution/bin</from>
+ <includes>seata-namingserver-setup.sh</includes>
+ </path>
+ </paths>
+ </extraDirectories>
+ <skip>${image.publish.skip}</skip>
+ <allowInsecureRegistries>true</allowInsecureRegistries>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>build</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
</plugins>
</build>
diff --git a/namingserver/src/main/resources/banner.txt b/namingserver/src/main/resources/banner.txt
new file mode 100644
index 0000000000..2fe3d99326
--- /dev/null
+++ b/namingserver/src/main/resources/banner.txt
@@ -0,0 +1,8 @@
+ _
+ (_)
+ _ __ __ _ _ __ ___ _ _ __ __ _ ___ ___ _ ____ _____ _ __
+ | '_ \ / _` | '_ ` _ \| | '_ \ / _` / __|/ _ \ '__\ \ / / _ \ '__|
+ | | | | (_| | | | | | | | | | | (_| \__ \ __/ | \ V / __/ |
+ |_| |_|\__,_|_| |_| |_|_|_| |_|\__, |___/\___|_| \_/ \___|_|
+ __/ |
+ |___/
\ No newline at end of file
diff --git a/namingserver/src/main/resources/docker/seata-naming-server-entrypoint.sh b/namingserver/src/main/resources/docker/seata-naming-server-entrypoint.sh
new file mode 100644
index 0000000000..f32ae4c338
--- /dev/null
+++ b/namingserver/src/main/resources/docker/seata-naming-server-entrypoint.sh
@@ -0,0 +1,26 @@
+#!/bin/bash
+#
+# 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.
+#
+
+# entrypoint for namingserver
+
+. /seata-namingserver-setup.sh
+JAVA_OPT=${JAVA_OPT//"//"/"/"}
+echo "Affected JVM parameters:$JAVA_OPT"
+exec java $JAVA_OPT \
+ -cp $( cat /seata-naming-server/jib-classpath-file ) \
+ $( cat /seata-naming-server/jib-main-class-file )
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org