Skip to content

Commit

Permalink
Compute jars does not remote cli jar from classpath.
Browse files Browse the repository at this point in the history
  • Loading branch information
fnothaft committed Aug 7, 2015
1 parent ad277c3 commit 6a45b6b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 29 deletions.
28 changes: 2 additions & 26 deletions bin/adam-submit
Original file line number Diff line number Diff line change
Expand Up @@ -48,36 +48,12 @@ SCRIPT_DIR="$(cd `dirname $0`/..; pwd)"

# Get list of required jars for ADAM
ADAM_JARS=$("$SCRIPT_DIR"/bin/compute-adam-jars.sh)
ADAM_CLI_JAR=${ADAM_JARS##*,}
ADAM_JARS=$(echo "$ADAM_JARS" | rev | cut -d',' -f2- | rev)

# append ADAM_JARS to the --jars option, if any
SPARK_ARGS=$("$SCRIPT_DIR"/bin/append_to_option.py , --jars $ADAM_JARS $SPARK_ARGS)

# Assume we're in a binary distribution
REPO_DIR="$SCRIPT_DIR/repo"
if [ ! -d "$REPO_DIR" ]; then
# Fallback to source directory
REPO_DIR="$SCRIPT_DIR/adam-cli/target/appassembler/repo"
fi

# Find the ADAM CLI jar
ADAM_DIR="$REPO_DIR/org/bdgenomics/adam"
num_versions=$(ls ${ADAM_DIR} | grep cli | wc -l)
if [ "$num_versions" -eq "0" ]; then
echo "Failed to find adam-cli jar in $ADAM_DIR"
echo "You need to build ADAM before running this program."
exit 1
fi
if [ "$num_versions" -gt "1" ]; then
versions_list=$(ls "$ADAM_DIR" | grep cli)
echo "Found multiple ADAM CLI versions in $ADAM_DIR:"
echo "$versions_list"
echo "Please remove all but one."
exit 1
fi
CLI=$(ls "$ADAM_DIR" | grep cli)
CLI_DIR="${ADAM_DIR}/${CLI}"
ADAM_CLI_JAR=$(ls $CLI_DIR/*/adam-cli_2.1[01]-*.jar)

# Find spark-submit script
if [ -z "$SPARK_HOME" ]; then
SPARK_SUBMIT=$(which spark-submit)
Expand Down
6 changes: 3 additions & 3 deletions bin/compute-adam-jars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ ADAM_REPO="$(cd `dirname $0`/..; pwd)"

CLASSPATH=$("$ADAM_REPO"/bin/compute-adam-classpath.sh)

# list of jars to ship with spark; trim off the first from the CLASSPATH
# TODO: brittle? assumes appassembler always puts the $BASE/etc first
ADAM_JARS=$(echo "$CLASSPATH" | tr ":" "," | cut -d "," -f 2-)
# list of jars to ship with spark; trim off the first from the CLASSPATH --> this is /etc
# TODO: brittle? assumes appassembler always puts the $BASE/etc first and the CLI jar last
ADAM_JARS=$(echo "$CLASSPATH" | tr ":" "\n" | tail -n +2 | perl -pe 's/\n/,/ unless eof' )

echo "$ADAM_JARS"

0 comments on commit 6a45b6b

Please sign in to comment.