Based on the source code for TwillLauncher, I tried to launch this on a Hadoop 
cluster like so:

$ java -cp 
guava-16.0.1.jar:twill-discovery-core-0.4.0-incubating-SNAPSHOT.jar:original-twill-examples-yarn-0.4.0-incubating-SNAPSHOT.jar:twill-examples-echo-0.4.0-incubating-SNAPSHOT.jar:slf4j-api-1.7.5.jar:twill-examples-yarn-0.4.0-incubating-SNAPSHOT.jar:twill-api-0.4.0-incubating-SNAPSHOT.jar:twill-examples-yarn-0.4.0-incubating-SNAPSHOT-shaded.jar:twill-common-0.4.0-incubating-SNAPSHOT.jar:twill-ext-0.4.0-incubating-SNAPSHOT.jar:twill-core-0.4.0-incubating-SNAPSHOT.jar:twill-yarn-0.4.0-incubating-SNAPSHOT.jar:twill-discovery-api-0.4.0-incubating-SNAPSHOT.jar:twill-zookeeper-0.4.0-incubating-SNAPSHOT.jar
 org.apache.twill.launcher.TwillLauncher 
./twill-examples-yarn-0.4.0-incubating-SNAPSHOT-shaded.jar 
org.apache.twill.example.yarn.HelloWorld localhost:2181 localhost:2181


Or with the BundledJar:
$ java -cp 
guava-16.0.1.jar:twill-discovery-core-0.4.0-incubating-SNAPSHOT.jar:original-twill-examples-yarn-0.4.0-incubating-SNAPSHOT.jar:twill-examples-echo-0.4.0-incubating-SNAPSHOT.jar:slf4j-api-1.7.5.jar:twill-examples-yarn-0.4.0-incubating-SNAPSHOT.jar:twill-api-0.4.0-incubating-SNAPSHOT.jar:twill-examples-yarn-0.4.0-incubating-SNAPSHOT-shaded.jar:twill-common-0.4.0-incubating-SNAPSHOT.jar:twill-ext-0.4.0-incubating-SNAPSHOT.jar:twill-core-0.4.0-incubating-SNAPSHOT.jar:twill-yarn-0.4.0-incubating-SNAPSHOT.jar:twill-discovery-api-0.4.0-incubating-SNAPSHOT.jar:twill-zookeeper-0.4.0-incubating-SNAPSHOT.jar
 org.apache.twill.launcher.TwillLauncher 
./twill-examples-yarn-0.4.0-incubating-SNAPSHOT-shaded.jar 
org.apache.twill.example.yarn.BundledJarExample localhost:2181 
./twill-examples-yarn-0.4.0-incubating-SNAPSHOT-shaded.jar . 
org.apache.twill.example.yarn.HelloWorld localhost:2181

But both fail as not being able to find the hadoop jars.  I imagine you have an 
easier way to launch this.  Can we launch it via "hadoop jar" or "yarn jar" 
instead?   

Which leads back to my questions about how to set up the classpath - a fat 
(shaded) jar or some OSGi mechanism?

-Michael

-----Original Message-----
From: Peterson, Michael [mailto:[email protected]] 
Sent: Friday, August 08, 2014 9:59 AM
To: [email protected]
Subject: Newbie: how to deploy/launch

Hello,

Just joined the list yesterday.  I have read over the documentation I could 
find and downloaded and built the code.  I have a few questions:

1.      How does one deploy and launch a Twill-based app?  I am familiar with 
Slider, so is it something like that, where you have to put your jars into HDFS 
launch the jar with the YarnClient and point it to the jar you put in HDFS?  
Any config or properties files required?

2.      I see that the EchoMain example you provide uses OSGi, but it looks 
like the other example "yarn" does not and uses a shaded jar instead.  Does 
that mean that running Twill with OSGi is optional or does it require OSGi?


BTW - the code builds on Window but at least one of the tests fails.

Thank you,
-Michael

Reply via email to