-
Notifications
You must be signed in to change notification settings - Fork 201
Provide gpdemo.sh deployment script #291
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| USAGE() { | ||
| echo "" | ||
| echo " `basename $0` {-c | -d | -h} <-K>" | ||
| echo " -c : Check if demo is possible." | ||
| echo " -d : Delete the demo." | ||
| echo " -K : Create cluster without data checksums." | ||
| echo " -h : Usage, prints this message." | ||
| echo "" | ||
| } | ||
|
|
||
| PORT_BASE=${PORT_BASE:=7000} | ||
| NUM_PRIMARY_MIRROR_PAIRS=${NUM_PRIMARY_MIRROR_PAIRS:=3} | ||
| if [ "${NUM_PRIMARY_MIRROR_PAIRS}" -eq "0" ]; then | ||
| BLDWRAP_POSTGRES_CONF_ADDONS="fsync=on ${BLDWRAP_POSTGRES_CONF_ADDONS}" # always enable fsync if singlenode | ||
| fi | ||
| if [[ ! ${BLDWRAP_POSTGRES_CONF_ADDONS} == *"fsync=on"* ]]; then | ||
| BLDWRAP_POSTGRES_CONF_ADDONS="fsync=off ${BLDWRAP_POSTGRES_CONF_ADDONS}" # only append fsync=off if it doesn't contains fsync=on | ||
| else | ||
| BLDWRAP_POSTGRES_CONF_ADDONS="${BLDWRAP_POSTGRES_CONF_ADDONS}" | ||
| fi | ||
| WITH_MIRRORS=${WITH_MIRRORS:="true"} | ||
| if [[ "${WITH_MIRRORS}" == "true" ]]; then | ||
| WITH_STANDBY="true" | ||
| fi | ||
|
|
||
| export -f USAGE | ||
|
|
||
| export enable_gpfdist | ||
| export with_openssl | ||
|
|
||
| export DEMO_PORT_BASE="$PORT_BASE" | ||
| export NUM_PRIMARY_MIRROR_PAIRS | ||
| export WITH_MIRRORS | ||
| export WITH_STANDBY | ||
| export BLDWRAP_POSTGRES_CONF_ADDONS | ||
| export DEFAULT_QD_MAX_CONNECT=150 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| WORKDIR=$(dirname "$0") | ||
| GPDEMO_LIB=$WORKDIR/lib/gpdemo | ||
|
|
||
| README() { | ||
| cat "$GPDEMO_LIB"/README | ||
| } | ||
|
|
||
| PROBE_CONFIG() { | ||
| source_gpdemo_defaults | ||
| "$GPDEMO_LIB"/probe_config.sh | ||
| } | ||
|
|
||
| DEMO_CLUSTER() { | ||
| source_gpdemo_defaults | ||
| "$GPDEMO_LIB"/demo_cluster.sh "$@" | ||
| } | ||
|
|
||
| source_gpdemo_defaults() { | ||
| . "$GPDEMO_LIB"/gpdemo-defaults.sh | ||
|
|
||
| # overwrite the shorter usage defined in gpdemo-defaults.sh | ||
| USAGE() { | ||
| echo "" | ||
| echo " gpdemo {-c | -d | -p | -h | -H | -v} <-K>" | ||
| echo " : Default behaviour (no argument) is to create demo cluster." | ||
| echo " -c : Check if demo is possible." | ||
| echo " -d : Delete the demo." | ||
| echo " -K : Create cluster without data checksums." | ||
| echo " -p : Probe configuration of an alive cluster." | ||
| echo " -h : Usage, prints this message." | ||
| echo " -H : Detailed usage." | ||
| echo " -v : Show version." | ||
| echo "" | ||
| echo " There are few environment variables (e.g., PORT_BASE, DATADIRS) to" | ||
| echo " further config the demo cluster. See \"gpdemo -H\" for more info." | ||
| echo "" | ||
| } | ||
| } | ||
|
|
||
| CHECK_FILENAME=("demo_cluster.sh" "probe_config.sh" "gpdemo-defaults.sh" "lalshell" "README" "../gp_bash_version.sh") | ||
| for filename in "${CHECK_FILENAME[@]}"; do | ||
| checking="$GPDEMO_LIB"/"$filename" | ||
| if [[ ! -f "$checking" ]]; then | ||
| echo "Missing $checking" | ||
| echo "" | ||
| echo "This may be caused by incomplete installation or packaging error." | ||
| echo "Try to re-install CloudBerryDB. If it doesn't help, contact support." | ||
| exit 1 | ||
| fi | ||
| done | ||
|
|
||
| . "$WORKDIR"/lib/gp_bash_version.sh | ||
|
|
||
| while getopts ":pHv" opt | ||
| do | ||
| case $opt in | ||
| p) PROBE_CONFIG; exit 0;; | ||
| H) README; exit 0;; | ||
| v) print_version; exit 0;; | ||
| *) DEMO_CLUSTER "$@"; exit $?;; # fallback to demo_cluster.sh | ||
| esac | ||
| done | ||
|
|
||
| # default behaviour is fallback to "demo_cluster.sh" (no argument) | ||
| DEMO_CLUSTER |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.