airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lah...@apache.org
Subject airavata git commit: removing legacy zk code
Date Thu, 23 Apr 2015 15:54:17 GMT
Repository: airavata
Updated Branches:
  refs/heads/master 5b192c906 -> d89f3f6bd


removing legacy zk code


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/d89f3f6b
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/d89f3f6b
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/d89f3f6b

Branch: refs/heads/master
Commit: d89f3f6bd0fb9ce6c34f574a6c42c2d07dfff3c0
Parents: 5b192c9
Author: Lahiru Gunathilake <glahiru@gmail.com>
Authored: Thu Apr 23 11:54:14 2015 -0400
Committer: Lahiru Gunathilake <glahiru@gmail.com>
Committed: Thu Apr 23 11:54:14 2015 -0400

----------------------------------------------------------------------
 airavata-api/airavata-api-server/pom.xml        |  17 +--
 .../airavata/api/server/AiravataAPIServer.java  | 142 +------------------
 .../client/samples/CreateLaunchExperiment.java  |   8 +-
 .../tools/RegisterSampleApplications.java       |  10 +-
 4 files changed, 17 insertions(+), 160 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/d89f3f6b/airavata-api/airavata-api-server/pom.xml
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/pom.xml b/airavata-api/airavata-api-server/pom.xml
index bf6c555..56e8361 100644
--- a/airavata-api/airavata-api-server/pom.xml
+++ b/airavata-api/airavata-api-server/pom.xml
@@ -66,11 +66,6 @@
             <artifactId>airavata-orchestrator-stubs</artifactId>
             <version>${project.version}</version>
         </dependency>
-        <!--<dependency>-->
-            <!--<groupId>org.apache.airavata</groupId>-->
-            <!--<artifactId>airavata-workflow-engine</artifactId>-->
-            <!--<version>${project.version}</version>-->
-        <!--</dependency>-->
         <dependency>
             <groupId>org.apache.airavata</groupId>
             <artifactId>airavata-messaging-core</artifactId>
@@ -86,12 +81,12 @@
             <artifactId>slf4j-log4j12</artifactId>
             <version>${org.slf4j.version}</version>
         </dependency>
-        <!-- zookeeper dependencies -->
-        <dependency>
-        	<groupId>org.apache.zookeeper</groupId>
-        	<artifactId>zookeeper</artifactId>
-        	<version>3.4.0</version>
-        </dependency>
+        <!--&lt;!&ndash; zookeeper dependencies &ndash;&gt;-->
+        <!--<dependency>-->
+        	<!--<groupId>org.apache.zookeeper</groupId>-->
+        	<!--<artifactId>zookeeper</artifactId>-->
+        	<!--<version>3.4.0</version>-->
+        <!--</dependency>-->
         
     </dependencies>
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/d89f3f6b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/AiravataAPIServer.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/AiravataAPIServer.java
b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/AiravataAPIServer.java
index afb3d7f..6da9ac9 100644
--- a/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/AiravataAPIServer.java
+++ b/airavata-api/airavata-api-server/src/main/java/org/apache/airavata/api/server/AiravataAPIServer.java
@@ -48,13 +48,11 @@ import org.apache.zookeeper.data.Stat;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class AiravataAPIServer implements IServer, Watcher{
+public class AiravataAPIServer implements IServer{
 
     private final static Logger logger = LoggerFactory.getLogger(AiravataAPIServer.class);
 	private static final String SERVER_NAME = "Airavata API Server";
 	private static final String SERVER_VERSION = "1.0";
-    private ZooKeeper zk;
-    private static Integer mutex = -1;
 
     private ServerStatus status;
 
@@ -108,7 +106,7 @@ public class AiravataAPIServer implements IServer, Watcher{
 					}
 				}
 			}.start();
-            storeServerConfig();
+//            storeServerConfig();
         } catch (TTransportException e) {
             logger.error(e.getMessage());
             setStatus(ServerStatus.FAILED);
@@ -116,127 +114,6 @@ public class AiravataAPIServer implements IServer, Watcher{
             throw new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
         }
     }
-
-    public void storeServerConfig() throws AiravataSystemException{
-        try {
-            String zkhostPort = AiravataZKUtils.getZKhostPort();
-            String airavataServerHostPort = ServerSettings.getSetting(org.apache.airavata.common.utils.Constants.API_SERVER_HOST)
-                    + ":" + ServerSettings.getSetting(org.apache.airavata.common.utils.Constants.API_SERVER_PORT);
-            String experimentCatalogJDBCURL = ServerSettings.getSetting(org.apache.airavata.common.utils.Constants.REGISTRY_JDBC_URL);
-            String appCatalogJDBCURL = ServerSettings.getSetting(org.apache.airavata.common.utils.Constants.APPCATALOG_JDBC_URL);
-            String rabbitMqBrokerURL = ServerSettings.getSetting(org.apache.airavata.common.utils.Constants.RABBITMQ_BROKER_URL);
-            String rabbitMqExchange = ServerSettings.getSetting(org.apache.airavata.common.utils.Constants.RABBITMQ_EXCHANGE);
-            String rabbitMq = rabbitMqBrokerURL + File.separator + rabbitMqExchange;
-            zk = new ZooKeeper(zkhostPort, AiravataZKUtils.getZKTimeout(), this);   // no
watcher is required, this will only use to store some data
-            String apiServer = ServerSettings.getSetting(org.apache.airavata.common.utils.Constants.ZOOKEEPER_API_SERVER_NODE,
"/airavata-server");
-            String OrchServer = ServerSettings.getSetting(org.apache.airavata.common.utils.Constants.ZOOKEEPER_ORCHESTRATOR_SERVER_NODE,
"/orchestrator-server");
-            String gfacServer = ServerSettings.getSetting(org.apache.airavata.common.utils.Constants.ZOOKEEPER_GFAC_SERVER_NODE,
"/gfac-server");
-            String gfacExperiments = ServerSettings.getSetting(org.apache.airavata.common.utils.Constants.ZOOKEEPER_GFAC_EXPERIMENT_NODE,
"/gfac-experiments");
-            String experimentCatalog = ServerSettings.getSetting(org.apache.airavata.common.utils.Constants.ZOOKEEPER_EXPERIMENT_CATALOG,
"/experiment-catalog");
-            String appCatalog = ServerSettings.getSetting(org.apache.airavata.common.utils.Constants.ZOOKEEPER_APPCATALOG,
"/app-catalog");
-            String rabbitMQ = ServerSettings.getSetting(org.apache.airavata.common.utils.Constants.ZOOKEEPER_RABBITMQ,
"/rabbitMq");
-            Stat zkStat = zk.exists(experimentCatalog, false);
-            if (zkStat == null) {
-                zk.create(experimentCatalog, new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE,
-                        CreateMode.PERSISTENT);
-            }
-            String exCatalogInstantNode = experimentCatalog + File.separator + String.valueOf(new
Random().nextInt(Integer.MAX_VALUE));
-            zkStat = zk.exists(exCatalogInstantNode, false);
-            if (zkStat == null) {
-                zk.create(exCatalogInstantNode,
-                        experimentCatalogJDBCURL.getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE,
-                        CreateMode.EPHEMERAL);      // other component will watch these childeren
creation deletion to monitor the status of the node
-                logger.info("Successfully created experiment-catalog node");
-            }
-            zkStat = zk.exists(appCatalog, false);
-            if (zkStat == null) {
-                zk.create(appCatalog, new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE,
-                        CreateMode.PERSISTENT);
-            }
-            String appCatalogInstantNode = appCatalog + File.separator + String.valueOf(new
Random().nextInt(Integer.MAX_VALUE));
-            zkStat = zk.exists(appCatalogInstantNode, false);
-            if (zkStat == null) {
-                zk.create(appCatalogInstantNode,
-                        appCatalogJDBCURL.getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE,
-                        CreateMode.EPHEMERAL);      // other component will watch these childeren
creation deletion to monitor the status of the node
-                logger.info("Successfully created app-catalog node");
-            }
-            if (getStatus().equals(ServerStatus.STARTED)) {
-                zkStat = zk.exists(apiServer, false);
-                if (zkStat == null) {
-                    zk.create(apiServer, new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE,
-                            CreateMode.PERSISTENT);
-                }
-                String instantNode = apiServer + File.separator + String.valueOf(new Random().nextInt(Integer.MAX_VALUE));
-                zkStat = zk.exists(instantNode, false);
-                if (zkStat == null) {
-                    zk.create(instantNode,
-                            airavataServerHostPort.getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE,
-                            CreateMode.EPHEMERAL);      // other component will watch these
childeren creation deletion to monitor the status of the node
-                    logger.info("Successfully created airavata-server node");
-                }
-
-                zkStat = zk.exists(OrchServer, false);
-                if (zkStat == null) {
-                    zk.create(OrchServer, new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE,
-                            CreateMode.PERSISTENT);
-                    logger.info("Successfully created orchestrator-server node");
-                }
-                zkStat = zk.exists(gfacServer, false);
-                if (zkStat == null) {
-                    zk.create(gfacServer, new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE,
-                            CreateMode.PERSISTENT);
-                    logger.info("Successfully created gfac-server node");
-                }
-                zkStat = zk.exists(gfacServer, false);
-                if (zkStat == null) {
-                    zk.create(gfacExperiments, new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE,
-                            CreateMode.PERSISTENT);
-                    logger.info("Successfully created gfac-server node");
-                }
-                zkStat = zk.exists(rabbitMQ, false);
-                if (zkStat == null) {
-                    zk.create(rabbitMQ, new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE,
-                            CreateMode.PERSISTENT);
-                }
-                String rabbitMqInstantNode = rabbitMQ + File.separator + String.valueOf(new
Random().nextInt(Integer.MAX_VALUE));
-                zkStat = zk.exists(rabbitMqInstantNode, false);
-                if (zkStat == null) {
-                    zk.create(rabbitMqInstantNode,
-                            rabbitMq.getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE,
-                            CreateMode.EPHEMERAL);      // other component will watch these
childeren creation deletion to monitor the status of the node
-                    logger.info("Successfully created rabbitMQ node");
-                }
-                logger.info("Finished starting ZK: " + zk);
-            }
-        } catch (ApplicationSettingsException e) {
-            logger.error(e.getMessage());
-            setStatus(ServerStatus.FAILED);
-            RegistryInitUtil.stopDerbyInServerMode();
-            throw new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
-        } catch (IOException e) {
-            logger.error(e.getMessage());
-            setStatus(ServerStatus.FAILED);
-            RegistryInitUtil.stopDerbyInServerMode();
-            throw new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
-        } catch (InterruptedException e) {
-            logger.debug(e.getMessage());
-            setStatus(ServerStatus.FAILED);
-            RegistryInitUtil.stopDerbyInServerMode();
-            throw new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
-        } catch (KeeperException e) {
-            logger.debug(e.getMessage());
-            setStatus(ServerStatus.FAILED);
-            RegistryInitUtil.stopDerbyInServerMode();
-            throw new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
-        } catch (Exception e) {
-            logger.error(e.getMessage());
-            setStatus(ServerStatus.FAILED);
-            RegistryInitUtil.stopDerbyInServerMode();
-            throw new AiravataSystemException(AiravataErrorType.INTERNAL_ERROR);
-        }
-    }
-
     public static void main(String[] args) {
     	try {
 			AiravataAPIServer server = new AiravataAPIServer();
@@ -294,19 +171,4 @@ public class AiravataAPIServer implements IServer, Watcher{
 	public String getVersion() {
 		return SERVER_VERSION;
 	}
-
-    @Override
-    synchronized public void process(WatchedEvent watchedEvent) {
-        logger.info(watchedEvent.getPath());
-        synchronized (mutex) {
-            Event.KeeperState state = watchedEvent.getState();
-            logger.info(state.name());
-            switch(state){
-                case SyncConnected:
-                    mutex.notify();
-                case Expired:case Disconnected:
-                    logger.info("ZK Connection is "+ state.toString());
-            }
-        }
-    }
 }

http://git-wip-us.apache.org/repos/asf/airavata/blob/d89f3f6b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
index 08a725e..6ea537e 100644
--- a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
+++ b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
@@ -61,7 +61,7 @@ public class CreateLaunchExperiment {
     private static String echoAppId = "Echo_9cbcfae4-616b-4bef-aa41-d3cd2bec6002";
     private static String mpiAppId = "HelloMPI_bfd56d58-6085-4b7f-89fc-646576830518";
     private static String wrfAppId = "WRF_7ad5da38-c08b-417c-a9ea-da9298839762";
-    private static String amberAppId = "Amber_2f6e66cd-5e27-433b-a0b1-1fbfe67b73f8";
+    private static String amberAppId = "Amber_ee7e3e85-9dfd-459c-9f45-aca223192f5f";
     private static String gromacsAppId = "GROMACS_05622038-9edd-4cb1-824e-0b7cb993364b";
     private static String espressoAppId = "ESPRESSO_10cc2820-5d0b-4c63-9546-8a8b595593c1";
     private static String lammpsAppId = "LAMMPS_2472685b-8acf-497e-aafe-cc66fe5f4cb6";
@@ -162,11 +162,11 @@ public class CreateLaunchExperiment {
     public static void createAndLaunchExp() throws TException {
         List<String> experimentIds = new ArrayList<String>();
         try {
-            for (int i = 0; i < 1; i++) {
+            for (int i = 0; i < 10; i++) {
 //                final String expId = createExperimentForSSHHost(airavata);
 //                final String expId = createEchoExperimentForFSD(airavataClient);
 //                final String expId = createMPIExperimentForFSD(airavataClient);
-               final String expId = createEchoExperimentForStampede(airavataClient);
+//               final String expId = createEchoExperimentForStampede(airavataClient);
 //                final String expId = createEchoExperimentForTrestles(airavataClient);
 //                final String expId = createExperimentEchoForLocalHost(airavataClient);
 //                final String expId = createExperimentWRFTrestles(airavataClient);
@@ -174,7 +174,7 @@ public class CreateLaunchExperiment {
 //                final String expId = createExperimentForBR2Amber(airavataClient);
 //                final String expId = createExperimentWRFStampede(airavataClient);
 //                final String expId = createExperimentForStampedeAmber(airavataClient);
-//                String expId = createExperimentForTrestlesAmber(airavataClient);
+                String expId = createExperimentForTrestlesAmber(airavataClient);
 //                final String expId = createExperimentGROMACSStampede(airavataClient);
 //                final String expId = createExperimentESPRESSOStampede(airavataClient);
 //                final String expId = createExperimentLAMMPSStampede(airavataClient);

http://git-wip-us.apache.org/repos/asf/airavata/blob/d89f3f6b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
index ffdc584..b3efbef 100644
--- a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
+++ b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/tools/RegisterSampleApplications.java
@@ -200,7 +200,7 @@ public class RegisterSampleApplications {
             System.out.println("\n #### Registering XSEDE Computational Resources #### \n");
 
             //Register Stampede
-            List<BatchQueue> stampedeQueues = new ArrayList<>();
+            List<BatchQueue> stampedeQueues = new ArrayList<BatchQueue>();
             BatchQueue normalQueue = createBatchQueue("normal", "Normal Queue", 2880, 256,
4000, 50, 0);
             BatchQueue developmentQueue = createBatchQueue("development", "Development Queue",
120, 16, 4000, 1, 0);
             stampedeQueues.add(normalQueue);
@@ -211,7 +211,7 @@ public class RegisterSampleApplications {
             System.out.println("Stampede Resource Id is " + stampedeResourceId);
 
             //Register Trestles
-            List<BatchQueue> trestlesQueues = new ArrayList<>();
+            List<BatchQueue> trestlesQueues = new ArrayList<BatchQueue>();
             BatchQueue normalQueue_tr = createBatchQueue("normal", "Normal Queue", 2880,
32, 32, 50, 0);
             BatchQueue sharedQueue_tr = createBatchQueue("shared", "Shared Queue", 2880,
4, 32, 50, 0);
             trestlesQueues.add(normalQueue_tr);
@@ -221,7 +221,7 @@ public class RegisterSampleApplications {
             System.out.println("Trestles Resource Id is " + trestlesResourceId);
 
             //Register BigRedII
-            List<BatchQueue> br2Queues = new ArrayList<>();
+            List<BatchQueue> br2Queues = new ArrayList<BatchQueue>();
             BatchQueue normalQueue_br2 = createBatchQueue("normal", "Normal Queue", 2880,
340, 2048, 50, 0);
             BatchQueue serial_br2 = createBatchQueue("serial", "Normal Queue", 10080, 340,
2048, 50, 0);
             br2Queues.add(normalQueue_br2);
@@ -234,7 +234,7 @@ public class RegisterSampleApplications {
             System.out.println("FSd Resource Id: "+fsdResourceId);
 
             //Register Alamo
-            List<BatchQueue> alamoQueues = new ArrayList<>();
+            List<BatchQueue> alamoQueues = new ArrayList<BatchQueue>();
             alamoResourceId = registerComputeHost("alamo.uthscsa.edu", "Alamo Cluster",
                     ResourceJobManagerType.PBS, "push", "/usr/bin/", SecurityProtocol.SSH_KEYS,
22, "/usr/bin/mpiexec -np", alamoQueues);
             System.out.println("Alamo Cluster " + alamoResourceId);
@@ -251,7 +251,7 @@ public class RegisterSampleApplications {
             System.out.println("\n #### Registering Non-XSEDE Computational Resources ####
\n");
 
             //Register LSF resource
-            List<BatchQueue> lsfQueues = new ArrayList<>();
+            List<BatchQueue> lsfQueues = new ArrayList<BatchQueue>();
             lsfResourceId = registerComputeHost("ghpcc06.umassrc.org", "LSF Cluster",
                     ResourceJobManagerType.LSF, "push", "source /etc/bashrc;/lsf/9.1/linux2.6-glibc2.3-x86_64/bin",
SecurityProtocol.SSH_KEYS, 22, "mpiexec", lsfQueues);
             System.out.println("LSF Resource Id is " + lsfResourceId);


Mime
View raw message