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

[ADAM-429] adam-submit now handles args correctly. #430

Merged
merged 1 commit into from
Oct 23, 2014
Merged
Changes from all 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
16 changes: 14 additions & 2 deletions bin/adam-submit
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# Figure out where ADAM is installed
ADAM_REPO="$(cd `dirname $0`/..; pwd)"

CLASSPATH=$("$ADAM_REPO"/bin/compute-adam-classpath.sh)
# Get list of required jars for ADAM
ADAM_JARS=$("$ADAM_REPO"/bin/compute-adam-jars.sh)

# Find the ADAM CLI jar
Expand All @@ -39,13 +39,24 @@ if [ "$num_versions" -gt "1" ]; then
fi
ADAM_CLI_JAR=$(ls "$ADAM_REPO"/adam-cli/target/appassembler/repo/org/bdgenomics/adam/adam-cli/*/adam-cli-*.jar)

# Find spark-submit script
if [ -z "$SPARK_HOME" ]; then
echo "Attempting to use 'spark-submit' on default path; you might need to set SPARK_HOME"
SPARK_SUBMIT=spark-submit
else
SPARK_SUBMIT="$SPARK_HOME"/bin/spark-submit
fi

# Split args into Spark args and ADAM args
# NOTE: if Spark uses gatherSparkSubmitOpts in spark-submit, this is unnecessary
function usage() {
echo "adam-submit <spark-args> <adam-args>"
exit 0
}
source "$SPARK_HOME"/bin/utils.sh
SUBMIT_USAGE_FUNCTION=usage
gatherSparkSubmitOpts "$@"

# submit the job to Spark
"$SPARK_SUBMIT" \
--class org.bdgenomics.adam.cli.ADAMMain \
Expand All @@ -54,5 +65,6 @@ fi
--conf spark.kryoserializer.buffer.mb=4 \
--conf spark.kryo.referenceTracking=true \
--jars "$ADAM_JARS" \
"${SUBMISSION_OPTS[@]}" \
"$ADAM_CLI_JAR" \
"$@"
"${APPLICATION_OPTS[@]}"