-
Notifications
You must be signed in to change notification settings - Fork 28.6k
[SPARK-4990][Deploy]to find default properties file, search SPARK_CONF_DIR first #3823
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
Conversation
Test build #24857 has started for PR 3823 at commit
|
@@ -42,7 +42,10 @@ while (($#)); do | |||
shift | |||
done | |||
|
|||
DEFAULT_PROPERTIES_FILE="$SPARK_HOME/conf/spark-defaults.conf" | |||
DEFAULT_PROPERTIES_FILE="$SPARK_CONF_DIR/spark-defaults.conf" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SparkSubmitArguments
already ultimately handles this case, right? What does this fix?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Used for
if [[ "$SPARK_SUBMIT_DEPLOY_MODE" == "client" && -f "$SPARK_SUBMIT_PROPERTIES_FILE" ]]; then
Parse the properties file only if the special configs exist
contains_special_configs=$(
grep -e "spark.driver.extra_|spark.driver.memory" "$SPARK_SUBMIT_PROPERTIES_FILE" |
grep -v "^[[:space:]]_#"
)
if [ -n "$contains_special_configs" ]; then
export SPARK_SUBMIT_BOOTSTRAP_DRIVER=1
fi
fi
Test build #24857 has finished for PR 3823 at commit
|
Test PASSed. |
Hi, @WangTaoTheTonic : ) But I prefer to you can do it like : if [ ! -d "$SPARK_CONF_DIR" ]; then |
@OopsOutOfMemory Thanks for your comment and I understand your concern. |
Sorry, maybe here is a misunderstanding.
To check conf directory is more reasonable, because the key point is the
We may add an extra warning for the Currently, I think both of the two solutions is ok! : ) |
@OopsOutOfMemory Ok I got what you mean. After checking the logic in
|
Test build #24875 has started for PR 3823 at commit
|
Test build #24877 has started for PR 3823 at commit
|
@@ -42,7 +42,10 @@ while (($#)); do | |||
shift | |||
done | |||
|
|||
DEFAULT_PROPERTIES_FILE="$SPARK_HOME/conf/spark-defaults.conf" | |||
if [ ! -d "$SPARK_CONF_DIR" ]; then | |||
SPARK_CONF_DIR="$SPARK_HOME/conf" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recommend to add export
keyword to make the SPARK_CONF_DIR global :)
export SPARK_CONF_DIR="$SPARK_HOME/conf"
Just like SPARK_HOME, it's a global variable.
Test build #24875 has finished for PR 3823 at commit
|
Test FAILed. |
Test build #24877 has finished for PR 3823 at commit
|
Test PASSed. |
Test build #24883 has started for PR 3823 at commit
|
Test build #24883 has finished for PR 3823 at commit
|
Test PASSed. |
LGTM, but this seems to have a conflict from your other patch now. Could you rebase to master? |
@andrewor14 Ok, rebase done. |
Test build #25286 has started for PR 3823 at commit
|
Test build #25286 has finished for PR 3823 at commit
|
Test PASSed. |
@@ -44,7 +44,10 @@ while (($#)); do | |||
shift | |||
done | |||
|
|||
DEFAULT_PROPERTIES_FILE="$SPARK_HOME/conf/spark-defaults.conf" | |||
if [ ! -d "$SPARK_CONF_DIR" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually, maybe this should be "if not defined" instead of "if not exists". Otherwise if the user sets SPARK_CONF_DIR
to a directory that doesn't exist then this will silently use a different config.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i.e.
if [ -z "$SPARK_CONF_DIR" ]; then
export SPARK_CONF_DIR="$SPARK_HOME/conf"
fi
Test build #25347 has started for PR 3823 at commit
|
@andrewor14 Ok, that makes sense. I changed |
Test build #25348 has started for PR 3823 at commit
|
Ok I'm merging this into master since tests are irrelevant here thanks. |
Test build #25347 has finished for PR 3823 at commit
|
Test PASSed. |
Test build #25348 has finished for PR 3823 at commit
|
Test PASSed. |
https://issues.apache.org/jira/browse/SPARK-4990