airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hes...@apache.org
Subject svn commit: r1463343 - in /airavata/trunk/modules/gfac-core: pom.xml src/main/java/org/apache/airavata/gfac/provider/impl/EC2Provider.java
Date Tue, 02 Apr 2013 00:58:16 GMT
Author: heshan
Date: Tue Apr  2 00:58:01 2013
New Revision: 1463343

URL: http://svn.apache.org/r1463343
Log:
AIRAVATA-803 Adding missing dependencies. 

Modified:
    airavata/trunk/modules/gfac-core/pom.xml
    airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/provider/impl/EC2Provider.java

Modified: airavata/trunk/modules/gfac-core/pom.xml
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/gfac-core/pom.xml?rev=1463343&r1=1463342&r2=1463343&view=diff
==============================================================================
--- airavata/trunk/modules/gfac-core/pom.xml (original)
+++ airavata/trunk/modules/gfac-core/pom.xml Tue Apr  2 00:58:01 2013
@@ -88,12 +88,36 @@
 			<version>0.8.0</version>
 		</dependency>
 
-		<!-- Amazon -->
+		<!-- Amazon EC2 Provider  -->
 		<dependency>
 			<groupId>com.amazonaws</groupId>
 			<artifactId>aws-java-sdk</artifactId>
 			<version>1.3.20</version>
 		</dependency>
+        <dependency>
+            <groupId>j2ssh</groupId>
+            <artifactId>j2ssh-core</artifactId>
+            <version>0.2.9</version>
+            <type>jar</type>
+        </dependency>
+        <dependency>
+            <groupId>j2ssh</groupId>
+            <artifactId>j2ssh-common</artifactId>
+            <version>0.2.9</version>
+            <type>jar</type>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpclient</artifactId>
+            <version>4.1</version>
+            <type>jar</type>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpcore</artifactId>
+            <version>4.1</version>
+            <type>jar</type>
+        </dependency>
 
 		<!-- Test -->
 		<dependency>
@@ -111,18 +135,6 @@
 			<artifactId>slf4j-log4j12</artifactId>
 			<scope>test</scope>
 		</dependency>
-		<dependency>
-			<groupId>j2ssh</groupId>
-			<artifactId>j2ssh-core</artifactId>
-			<version>0.2.9</version>
-			<type>jar</type>
-		</dependency>
-		<dependency>
-			<groupId>j2ssh</groupId>
-			<artifactId>j2ssh-common</artifactId>
-			<version>0.2.9</version>
-			<type>jar</type>
-		</dependency>
 
 		<!-- Unicore dependencies -->
 		<dependency>

Modified: airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/provider/impl/EC2Provider.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/provider/impl/EC2Provider.java?rev=1463343&r1=1463342&r2=1463343&view=diff
==============================================================================
--- airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/provider/impl/EC2Provider.java
(original)
+++ airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/provider/impl/EC2Provider.java
Tue Apr  2 00:58:01 2013
@@ -83,8 +83,10 @@ public class EC2Provider implements GFac
 
     public void initialize(JobExecutionContext jobExecutionContext) throws GFacProviderException,GFacException{
         if (jobExecutionContext != null) {
-            if (jobExecutionContext.getSecurityContext(AmazonSecurityContext.AMAZON_SECURITY_CONTEXT)
instanceof AmazonSecurityContext) {
-                this.amazonSecurityContext = (AmazonSecurityContext) jobExecutionContext.getSecurityContext(AmazonSecurityContext.AMAZON_SECURITY_CONTEXT);
+            if (jobExecutionContext.getSecurityContext(AmazonSecurityContext.AMAZON_SECURITY_CONTEXT)
+                    instanceof AmazonSecurityContext) {
+                this.amazonSecurityContext = (AmazonSecurityContext) jobExecutionContext.
+                        getSecurityContext(AmazonSecurityContext.AMAZON_SECURITY_CONTEXT);
             } else {
                 throw new GFacProviderException("Amazon Security Context is not set" + jobExecutionContext);
             }
@@ -123,8 +125,6 @@ public class EC2Provider implements GFac
     }
 
     public void execute(JobExecutionContext jobExecutionContext) throws GFacProviderException
{
-//        final String command2 = "sh run.sh SRR042383.21414#CTGGCACGGAGTTAGCCGATCCTTATTCATAAAGTACATGCAAACGGGTATCCATACTCGACTTTATTCCTTTATAAAAGAAGTTTACAACCCATAGGGCAGTCATCCTTCACGCTACTTGGCTGGTTCAGGCCTGCGCCCATTGACCAATATTCCTCACTGCTGCCTCCCGTAGGAGTTTGGACCGTGTCTCAGTTCCAATGTGGGGGACCTTCCTCTCAGAACCCCTATCCATCGAAGACTAGGTGGGCCGTTACCCCGCCTACTATCTAATGGAACGCATCCCCATCGTCTACCGGAATACCTTTAATCATGTGAACATGCGGACTCATGATGCCATCTTGTATTAATCTTCCTTTCAGAAGGCTGTCCAAGAGTAGACGGCAGGTTGGATACGTGTTACTCACCGTGCCGCCGGTCGCCATCAGTCTTAGCAAGCTAAGACCATGCTGCCCCTGACTTGCATGTGTTAAGCCTGTAGCTTAGCGTTC
SRR042383.31933#CTGGCACGGAGTTAGCCGATCCTTATTCATAAAGTACATGCAAACGGGTATCCATACCCGACTTTATTCCTTTATAAAAGAAGTTTACAACCCATAGGGCAGTCATCCTTCACGCTACTTGGCTGGTTCAGGCTCTCGCCCATTGACCAATATTCCTCACTGCTGCCTCCCGTAGGAGTTTGGACCGTGTCTCAGTTCCAATGTGGGGGACCTTCCTCTCAGAACCCCTATCCATCGAAGACTAGGTGGGCCGTTACCCCGCCTACTATCTAATGGAACGCATCCCCATCGTCTACCGGAATACCTTTAATCATGTGAACATGCGGACTCATGATGCCATCTTGTATTAAATCTTCCTTTCAGAAGGCTATCCAAGAGTAGACGGCAGGTTGGATACGTGTTACTCACCGTGCG"
+ '\
 n';
-
         String shellCmd = createShellCmd(jobExecutionContext);
         SshClient sshClient = new SshClient();
         sshClient.setSocketTimeout(SOCKET_TIMEOUT);
@@ -171,7 +171,7 @@ public class EC2Provider implements GFac
             }
 
             SessionChannelClient session = sshClient.openSessionChannel();
-            log.info("ssh session is open successfully...");
+            log.info("ssh session successfully opened...");
             session.requestPseudoTerminal("vt100", 80, 25, 0, 0, "");
             session.startShell();
             session.getOutputStream().write(shellCmd.getBytes());
@@ -222,7 +222,8 @@ public class EC2Provider implements GFac
      */
     private String createShellCmd(JobExecutionContext jobExecutionContext) throws GFacProviderException
{
         String command = "";
-        ApplicationDescription appDesc = jobExecutionContext.getApplicationContext().getApplicationDeploymentDescription();
+        ApplicationDescription appDesc = jobExecutionContext.getApplicationContext().
+                getApplicationDeploymentDescription();
 
         if(appDesc.getType() instanceof Ec2ApplicationDeploymentType) {
             Ec2ApplicationDeploymentType type = (Ec2ApplicationDeploymentType) appDesc.getType();
@@ -313,7 +314,8 @@ public class EC2Provider implements GFac
                 // already running instance
                 DescribeInstancesRequest describeInstancesRequest = new DescribeInstancesRequest();
                 DescribeInstancesResult describeInstancesResult =
-                        ec2client.describeInstances(describeInstancesRequest.withInstanceIds(amazonSecurityContext.getInstanceId()));
+                        ec2client.describeInstances(describeInstancesRequest.
+                                withInstanceIds(amazonSecurityContext.getInstanceId()));
 
                 if (describeInstancesResult.getReservations().size() == 0 ||
                         describeInstancesResult.getReservations().get(0).getInstances().size()
== 0) {
@@ -329,7 +331,8 @@ public class EC2Provider implements GFac
                 }
             }
 
-            jobExecutionContext.getNotificationService().publish(new EC2ProviderEvent("EC2
Instance " + this.instance.getInstanceId() + " is running with public name " + this.instance.getPublicDnsName()));
+            jobExecutionContext.getNotificationService().publish(new EC2ProviderEvent("EC2
Instance " +
+                    this.instance.getInstanceId() + " is running with public name " + this.instance.getPublicDnsName()));
 
         } catch (Exception e) {
             throw new GFacProviderException("Invalid Request",e,jobExecutionContext);
@@ -337,7 +340,8 @@ public class EC2Provider implements GFac
 //        return instance;
     }
 
-    private List<Instance> startInstances(AmazonEC2Client ec2, String amiId, String
insType, JobExecutionContext jobExecutionContext)
+    private List<Instance> startInstances(AmazonEC2Client ec2, String amiId, String
insType,
+                                          JobExecutionContext jobExecutionContext)
             throws AmazonServiceException {
         // start only 1 instance
         RunInstancesRequest request = new RunInstancesRequest(amiId, 1, 1);



Mime
View raw message