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

[#5976] Improvement(bin):Add validation checks to the startup scripts to prevent incorrect usage #5977

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions bin/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@
# Referred from Apache Submarine's common.sh implementation
# bin/common.sh

GRAVITINO_VERSION=GRAVITINO_VERSION_PLACEHOLDER
if [[ "$GRAVITINO_VERSION" == *_VERSION_PLACEHOLDER ]]; then
echo "GRAVITINO_VERSION is not set. Please make sure you are running the script from the distribution/package/bin and before running the script, run './gradle clean build -x test compileDistribution'"
exit 1
Copy link
Member

Choose a reason for hiding this comment

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

Please update the prompt message:

No GRAVITINO_VERSION was found, you may need to:
1. Run the gravitino.sh script on the compiled Gravitino.
2. Run the gravitino.sh script in the release package.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for the feedback. I will make the updates as required:

  • Update the error message for startup failures
  • Adjust the version check
  • Revert the root build.gradle.kts files

Copy link
Member

Choose a reason for hiding this comment

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

"Run the gravitino.sh script in the release package." this may not be the best instructions, as an ASF release package is source, not binary.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What does 'release package' mean? Should it instead be referred to as a 'distribution package'?

Copy link
Member

Choose a reason for hiding this comment

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

@justinmclean The problem is that there are some users who run gravitino.sh scripts without compiling, causing them to fail. We want to give them some tips. Do you have any better suggestions?

Copy link
Member

Choose a reason for hiding this comment

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

Ask them to use a binary distribution or compile it first? i.e:

  1. Run the gravitino.sh script in a compiled version of Gravitino.
  2. Run the gravitino.sh script from a binary release package.

fi


if [ -L "${BASH_SOURCE-$0}" ]; then
FWDIR=$(dirname "$(readlink "${BASH_SOURCE-$0}")")
else
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ tasks {
fileName.replace(".template", "")
}
eachFile {
if (name == "gravitino-env.sh") {
if (name == "gravitino-env.sh" || name == "common.sh") {
filter { line ->
line.replace("GRAVITINO_VERSION_PLACEHOLDER", "$version")
}
Expand Down Expand Up @@ -643,7 +643,7 @@ tasks {
fileName.replace(".template", "")
}
eachFile {
if (name == "gravitino-env.sh") {
if (name == "gravitino-env.sh" || name == "common.sh") {
filter { line ->
line.replace("GRAVITINO_VERSION_PLACEHOLDER", "$version")
}
Expand Down
Loading