airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lah...@apache.org
Subject svn commit: r1444274 - in /airavata/trunk/modules/gfac-core/src: main/java/org/apache/airavata/gfac/ main/java/org/apache/airavata/gfac/handler/ main/java/org/apache/airavata/gfac/provider/ main/java/org/apache/airavata/gfac/provider/impl/ test/resources/
Date Fri, 08 Feb 2013 23:05:26 GMT
Author: lahiru
Date: Fri Feb  8 23:05:26 2013
New Revision: 1444274

URL: http://svn.apache.org/r1444274
Log:
fixing integration test.

Added:
    airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/handler/LocalDirectorySetupHandler.java
    airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/provider/impl/GramProvider.java
      - copied, changed from r1443650, airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/provider/GramProvider.java
Removed:
    airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/provider/GramProvider.java
Modified:
    airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/Scheduler.java
    airavata/trunk/modules/gfac-core/src/test/resources/gfac-config.xml

Modified: airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/Scheduler.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/Scheduler.java?rev=1444274&r1=1444273&r2=1444274&view=diff
==============================================================================
--- airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/Scheduler.java
(original)
+++ airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/Scheduler.java
Fri Feb  8 23:05:26 2013
@@ -24,7 +24,7 @@ package org.apache.airavata.gfac;
 import org.apache.airavata.commons.gfac.type.HostDescription;
 import org.apache.airavata.gfac.context.JobExecutionContext;
 import org.apache.airavata.gfac.provider.GFacProvider;
-import org.apache.airavata.gfac.provider.GramProvider;
+import org.apache.airavata.gfac.provider.impl.GramProvider;
 import org.apache.airavata.gfac.provider.impl.LocalProvider;
 import org.apache.airavata.schemas.gfac.GlobusHostType;
 import org.slf4j.Logger;

Added: airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/handler/LocalDirectorySetupHandler.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/handler/LocalDirectorySetupHandler.java?rev=1444274&view=auto
==============================================================================
--- airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/handler/LocalDirectorySetupHandler.java
(added)
+++ airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/handler/LocalDirectorySetupHandler.java
Fri Feb  8 23:05:26 2013
@@ -0,0 +1,57 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.gfac.handler;
+
+import org.apache.airavata.commons.gfac.type.ApplicationDescription;
+import org.apache.airavata.gfac.context.JobExecutionContext;
+import org.apache.airavata.schemas.gfac.ApplicationDeploymentDescriptionType;
+import org.apache.airavata.schemas.gfac.HostDescriptionType;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+
+public class LocalDirectorySetupHandler implements GFacHandler{
+    private static final Logger log = LoggerFactory.getLogger(LocalDirectorySetupHandler.class);
+
+    public void invoke(JobExecutionContext jobExecutionContext) throws GFacHandlerException
{
+        log.info("Invoking GramDirectorySetupHandler ...");
+        HostDescriptionType type = jobExecutionContext.getApplicationContext().getHostDescription().getType();
+        ApplicationDescription applicationDeploymentDescription = jobExecutionContext.getApplicationContext().getApplicationDeploymentDescription();
+        ApplicationDeploymentDescriptionType app = applicationDeploymentDescription.getType();
+        log.debug("working diectroy = " + app.getStaticWorkingDirectory());
+        log.debug("temp directory = " + app.getScratchWorkingDirectory());
+
+        makeFileSystemDir(app.getStaticWorkingDirectory(),jobExecutionContext);
+        makeFileSystemDir(app.getScratchWorkingDirectory(),jobExecutionContext);
+        makeFileSystemDir(app.getInputDataDirectory(),jobExecutionContext);
+        makeFileSystemDir(app.getOutputDataDirectory(),jobExecutionContext);
+    }
+    private void makeFileSystemDir(String dir, JobExecutionContext jobExecutionContext) throws
GFacHandlerException {
+           File f = new File(dir);
+           if (f.isDirectory() && f.exists()) {
+               return;
+           } else if (!new File(dir).mkdir()) {
+               throw new GFacHandlerException("Cannot make directory "+dir, jobExecutionContext);
+           }
+       }
+
+}

Copied: airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/provider/impl/GramProvider.java
(from r1443650, airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/provider/GramProvider.java)
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/provider/impl/GramProvider.java?p2=airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/provider/impl/GramProvider.java&p1=airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/provider/GramProvider.java&r1=1443650&r2=1444274&rev=1444274&view=diff
==============================================================================
--- airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/provider/GramProvider.java
(original)
+++ airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/provider/impl/GramProvider.java
Fri Feb  8 23:05:26 2013
@@ -18,12 +18,14 @@
  * under the License.
  *
 */
-package org.apache.airavata.gfac.provider;
+package org.apache.airavata.gfac.provider.impl;
 
 import org.apache.airavata.gfac.JobSubmissionFault;
 import org.apache.airavata.gfac.context.GSISecurityContext;
 import org.apache.airavata.gfac.context.JobExecutionContext;
 import org.apache.airavata.gfac.notification.events.StartExecutionEvent;
+import org.apache.airavata.gfac.provider.GFacProvider;
+import org.apache.airavata.gfac.provider.GFacProviderException;
 import org.apache.airavata.gfac.utils.GramJobSubmissionListener;
 import org.apache.airavata.gfac.utils.GramProviderUtils;
 import org.apache.airavata.schemas.gfac.ApplicationDeploymentDescriptionType;

Modified: airavata/trunk/modules/gfac-core/src/test/resources/gfac-config.xml
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/gfac-core/src/test/resources/gfac-config.xml?rev=1444274&r1=1444273&r2=1444274&view=diff
==============================================================================
--- airavata/trunk/modules/gfac-core/src/test/resources/gfac-config.xml (original)
+++ airavata/trunk/modules/gfac-core/src/test/resources/gfac-config.xml Fri Feb  8 23:05:26
2013
@@ -5,7 +5,12 @@
         </InHandlers>
         <OutHandlers></OutHandlers>
     </GlobalHandlers>
-    <Provider class="org.apache.airavata.gfac.provider.GramProvider">
+    <Provider class="org.apache.airavata.gfac.provider.impl.LocalProvider">
+        <InHandlers>
+            <Handler class="org.apache.airavata.gfac.handler.LocalDirectorySetupHandler"/>
+        </InHandlers>
+    </Provider>
+    <Provider class="org.apache.airavata.gfac.provider.impl.GramProvider">
         <InHandlers>
             <Handler class="org.apache.airavata.gfac.handler.GramDirectorySetupHandler"/>
             <Handler class="org.apache.airavata.gfac.handler.GridFTPInputHandler"/>



Mime
View raw message