Skip to content

Commit

Permalink
Merge pull request apache#12 from ringtail/bugfix/spark-history-serve…
Browse files Browse the repository at this point in the history
…r-permission

remove script vars in entrypoint
  • Loading branch information
ringtail authored May 9, 2020
2 parents 9d21b91 + ba75c42 commit d98787d
Showing 1 changed file with 0 additions and 76 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,82 +3,6 @@
# echo commands to the terminal output
set -ex

enablePVC=

enableOSS=
alibabaCloudOSSEndpoint=
alibabaCloudAccessKeyId=
alibabaCloudAccessKeySecret=

eventsDir=

function usage {
cat<< EOF
Usage: entrypoint.sh [OPTIONS]
Options:
--pvc Enable PVC
--oss accessKeyId accessKeySecret ossEndpoint Enable Alibaba Cloud OSS
--events-dir events-dir Set events dir
-h | --help Prints this message.
EOF
}

function parse_args {
while [[ $# -gt 0 ]]
do
case "$1" in
--pvc)
enablePVC=true
shift
continue
;;
--oss)
if [[ -n "$4" ]]; then
enableOSS=true
alibabaCloudAccessKeyId=$2
alibabaCloudAccessKeySecret=$3
alibabaCloudOSSEndpoint=$4
shift 4
continue
else
printf '"--alibaba" require four non-empty option arguments.\n'
usage
exit 1
fi
;;
--events-dir)
if [[ -n "$2" ]]; then
eventsDir=$2
shift 2
continue
else
printf '"--events-dir" requires a non-empty option argument.\n'
usage
exit 1
fi
;;
-h|--help)
usage
exit 0
;;
--)
shift
break
;;
'')
break
;;
*)
printf "Unrecognized option: $1\n"
exit 1
;;
esac
shift
done
}

parse_args "$@"

if [[ "$enablePVC" == "true" ]]; then
export SPARK_HISTORY_OPTS="$SPARK_HISTORY_OPTS -Dspark.history.fs.logDirectory=file:/mnt/$eventsDir";
elif [[ "$enableOSS" == "true" ]];then
Expand Down

0 comments on commit d98787d

Please sign in to comment.