Skip to content

World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.

[#4404] improvement: Add startup ASCII logo (#4405)

Ziva Li578b60e4b1e7
diff --git a/bin/common.sh b/bin/common.sh
index f067750800..a6f002ad91 100644
--- a/bin/common.sh
+++ b/bin/common.sh
@@ -105,3 +105,20 @@ if [[ -n "${JAVA_HOME}" ]]; then
else
export JAVA_RUNNER=java
fi
+
+function printArt() {
+ local lineLength=70
+ local versionText="Version: ${GRAVITINO_VERSION} "
+ local versionTextLength=${#versionText}
+ local paddingLength=$((lineLength - versionTextLength - 3))
+ local versionLine=$(printf "#%${paddingLength}s%s#" "" "$versionText")
+
+ echo "#####################################################################"
+ echo "# ____ ____ _ ___ ___ ___ _____ ___ _ _ ___ #"
+ echo "# / ___| | _ \ / \ \ \ / / |_ _||_ _||_ _|| \ | | / _ \ #"
+ echo "# | | __ | |_) | / _ \ \ \ / / | | | | | | | \| || | | | #"
+ echo "# | |_| | | _ < / ___ \ \ V / | | | | | | | |\ || |_| | #"
+ echo "# \____| |_| \_\/_/ \_\ \_/ |___| |_| |___||_| \_| \___/ #"
+ echo "$versionLine"
+ echo "#####################################################################"
+}
diff --git a/bin/gravitino-iceberg-rest-server.sh b/bin/gravitino-iceberg-rest-server.sh
index 9a6195c603..61f0080123 100755
--- a/bin/gravitino-iceberg-rest-server.sh
+++ b/bin/gravitino-iceberg-rest-server.sh
@@ -47,6 +47,7 @@ function check_process_status() {
if [[ -z "${pid}" ]]; then
echo "GravitinoIcebergRESTServer is not running"
else
+ printArt
echo "GravitinoIcebergRESTServer is running[PID:$pid]"
fi
}
diff --git a/bin/gravitino.sh b/bin/gravitino.sh
index 51cda00417..a19d73d873 100755
--- a/bin/gravitino.sh
+++ b/bin/gravitino.sh
@@ -47,6 +47,7 @@ function check_process_status() {
if [[ -z "${pid}" ]]; then
echo "Gravitino Server is not running"
else
+ printArt
echo "Gravitino Server is running[PID:$pid]"
fi
}
diff --git a/build.gradle.kts b/build.gradle.kts
index dbfd8099cd..6943c5f96e 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -545,6 +545,13 @@ tasks {
rename { fileName ->
fileName.replace(".template", "")
}
+ eachFile {
+ if (name == "gravitino-env.sh") {
+ filter { line ->
+ line.replace("GRAVITINO_VERSION_PLACEHOLDER", "$version")
+ }
+ }
+ }
fileMode = 0b111101101
}
copy {
@@ -571,7 +578,7 @@ tasks {
doLast {
copy {
from(projectDir.dir("conf")) {
- include("${rootProject.name}-iceberg-rest-server.conf.template", "log4j2.properties.template")
+ include("${rootProject.name}-iceberg-rest-server.conf.template", "${rootProject.name}-env.sh.template", "log4j2.properties.template")
into("${rootProject.name}-iceberg-rest-server/conf")
}
from(projectDir.dir("bin")) {
@@ -582,6 +589,13 @@ tasks {
rename { fileName ->
fileName.replace(".template", "")
}
+ eachFile {
+ if (name == "gravitino-env.sh") {
+ filter { line ->
+ line.replace("GRAVITINO_VERSION_PLACEHOLDER", "$version")
+ }
+ }
+ }
fileMode = 0b111101101
}
diff --git a/conf/gravitino-env.sh.template b/conf/gravitino-env.sh.template
index 656ca176b2..1d39e2e8ff 100644
--- a/conf/gravitino-env.sh.template
+++ b/conf/gravitino-env.sh.template
@@ -17,6 +17,10 @@
# under the License.
#
+# In build.gradle.kts, we would automatic replace GRAVITINO_VERSION to the current version of Gravitino
+# when running `./gradlew compileDistribution` or `./gradlew compileIcebergRESTServer` command.
+GRAVITINO_VERSION=GRAVITINO_VERSION_PLACEHOLDER
+
# Debug Gravitino server
# export GRAVITINO_DEBUG_OPTS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8000 -Dlog4j2.debug=true"