Skip to content

Commit

Permalink
[apache#4404] improvement: Add startup ASCII logo (apache#4405)
Browse files Browse the repository at this point in the history
### What changes were proposed in this pull request?
Add startup ASCII logo to start the service script.
<img width="1240" alt="Screenshot 2024-08-08 at 11 26 45 PM"
src="https://github.com/user-attachments/assets/d3c90127-16d6-4a43-9a91-0d2b84a6cfe6">

### Why are the changes needed?
Fix: apache#4404

### Does this PR introduce _any_ user-facing change?
Users will see the logo when `./bin/gravitino.sh start`.

### How was this patch tested?
N/A
  • Loading branch information
zivali authored Aug 12, 2024
1 parent 14df45f commit 578b60e
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 1 deletion.
17 changes: 17 additions & 0 deletions bin/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 "#####################################################################"
}
1 change: 1 addition & 0 deletions bin/gravitino-iceberg-rest-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
1 change: 1 addition & 0 deletions bin/gravitino.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
16 changes: 15 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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")) {
Expand All @@ -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
}

Expand Down
4 changes: 4 additions & 0 deletions conf/gravitino-env.sh.template
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit 578b60e

Please sign in to comment.