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-submit aborts if ADAM_HOME is set #1882

Closed
pbashyal-nmdp opened this issue Jan 22, 2018 · 5 comments
Closed

adam-submit aborts if ADAM_HOME is set #1882

pbashyal-nmdp opened this issue Jan 22, 2018 · 5 comments
Milestone

Comments

@pbashyal-nmdp
Copy link
Contributor

@pbashyal-nmdp pbashyal-nmdp commented Jan 22, 2018

If ADAM_HOME is set, adam-submit aborts with the message:

java.lang.ClassNotFoundException: org.bdgenomics.adam.cli.ADAMMain
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:348)

The bin/find-adam-assembly.sh used by adam-submit sourcesbin/find-adam-home. find-adam-home script exits when ADAM_HOME is found. Since it is sourced, the adam-submit also exits.

To reproduce this, set ADAM_HOME and try running adam-submit .

Here's my patch to get it working:

diff --git a/bin/find-adam-home b/bin/find-adam-home
index 10269078..967f62a1 100755
--- a/bin/find-adam-home
+++ b/bin/find-adam-home
@@ -25,7 +25,7 @@ FIND_ADAM_HOME_PYTHON_SCRIPT="$(cd "$(dirname "$0")"; pwd)/find_adam_home.py"

 # Short cirtuit if the user already has this set.
 if [ ! -z "${ADAM_HOME}" ]; then
-   exit 0
+   true
 elif [ ! -f "$FIND_ADAM_HOME_PYTHON_SCRIPT" ]; then
   # If we are not in the same directory as find_adam_home.py we are not pip installed so we don't
   # need to search the different Python directories for a ADAM installation.
@heuermh
Copy link
Member

@heuermh heuermh commented Jan 22, 2018

Thanks @pbashyal-nmdp! What is the use case for setting ADAM-HOME?

@pbashyal-nmdp
Copy link
Contributor Author

@pbashyal-nmdp pbashyal-nmdp commented Jan 22, 2018

Setting ADAM_HOME lets you decouple the installation location of adam from the scripts that call adam-submit. The same script can be run locally for testing and on the cluster.

Having export PATH=$ADAM_HOME/bin:$PATH also lets you run adam-submit from anywhere on the system.

@heuermh
Copy link
Member

@heuermh heuermh commented Jan 25, 2018

@fnothaft I'm still a bit shaky on changes to the bin scripts to support Python, is there a reason why find-adam-home short circuits out if ADAM_HOME is set?

@heuermh heuermh added this to the 0.24.0 milestone Jan 25, 2018
@fnothaft
Copy link
Member

@fnothaft fnothaft commented Feb 4, 2018

@fnothaft I'm still a bit shaky on changes to the bin scripts to support Python, is there a reason why find-adam-home short circuits out if ADAM_HOME is set?

It shouldn't. I'd tested the exact use case that @pbashyal-nmdp is running locally (before we merged the PR) and it had worked for me; I'm guessing that I then made a change after testing that locally and broke things. @pbashyal-nmdp do you mind if I commit the patch you provided (after testing it on my end)?

@pbashyal-nmdp
Copy link
Contributor Author

@pbashyal-nmdp pbashyal-nmdp commented Feb 5, 2018

Yes, please use the patch. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants