This is an automated email from the ASF dual-hosted git repository.

dimuthuupe pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/airavata.git


The following commit(s) were added to refs/heads/develop by this push:
     new 918bcef  Using orchestrator level host schedulers
918bcef is described below

commit 918bcef876debd6aaeed44867fc29ac0e7246dcf
Author: Dimuthu Wannipurage <[email protected]>
AuthorDate: Mon Mar 11 12:58:14 2019 -0400

    Using orchestrator level host schedulers
---
 .../airavata/ide/integration/JobEngineStarter.java |  9 +++++-
 .../core/schedule/DefaultHostScheduler.java        | 36 ++++++++++++++++++++++
 .../orchestrator/core/schedule/HostScheduler.java  | 34 ++++++++++++++++++++
 .../server/OrchestratorServerHandler.java          |  4 +--
 4 files changed, 79 insertions(+), 4 deletions(-)

diff --git 
a/modules/ide-integration/src/main/java/org/apache/airavata/ide/integration/JobEngineStarter.java
 
b/modules/ide-integration/src/main/java/org/apache/airavata/ide/integration/JobEngineStarter.java
index 61e43fe..267ff67 100644
--- 
a/modules/ide-integration/src/main/java/org/apache/airavata/ide/integration/JobEngineStarter.java
+++ 
b/modules/ide-integration/src/main/java/org/apache/airavata/ide/integration/JobEngineStarter.java
@@ -24,6 +24,7 @@ public class JobEngineStarter {
 
         
zkHelixAdmin.addCluster(ServerSettings.getSetting("helix.cluster.name"), true);
 
+        System.out.println("Starting Helix Controller .......");
         // Starting helix controller
         HelixController controller = new HelixController();
         controller.startServer();
@@ -34,14 +35,20 @@ public class JobEngineStarter {
             
taskClasses.add(Class.forName(taskClassName).asSubclass(AbstractTask.class));
         }
 
+        System.out.println("Starting Helix Participant .......");
+
         // Starting helix participant
         GlobalParticipant participant = new GlobalParticipant(taskClasses, 
null);
         participant.startServer();
 
+        System.out.println("Starting Pre Workflow Manager .......");
+
         PreWorkflowManager preWorkflowManager = new PreWorkflowManager();
         preWorkflowManager.startServer();
 
+        System.out.println("Starting Post Workflow Manager .......");
+
         PostWorkflowManager postWorkflowManager = new PostWorkflowManager();
-        postWorkflowManager.startServer();
+        //postWorkflowManager.startServer();
     }
 }
diff --git 
a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/schedule/DefaultHostScheduler.java
 
b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/schedule/DefaultHostScheduler.java
new file mode 100644
index 0000000..ff4e840
--- /dev/null
+++ 
b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/schedule/DefaultHostScheduler.java
@@ -0,0 +1,36 @@
+/**
+ *
+ * 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.orchestrator.core.schedule;
+
+import 
org.apache.airavata.model.appcatalog.computeresource.ComputeResourceDescription;
+
+import java.util.List;
+
+public class DefaultHostScheduler implements HostScheduler {
+    @Override
+    public ComputeResourceDescription 
schedule(List<ComputeResourceDescription> registeredHosts) {
+        if (registeredHosts == null || registeredHosts.isEmpty()) {
+            return null;
+        } else {
+            return registeredHosts.get(0); // return first schedulear in the 
list.
+        }
+    }
+}
diff --git 
a/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/schedule/HostScheduler.java
 
b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/schedule/HostScheduler.java
new file mode 100644
index 0000000..30c7965
--- /dev/null
+++ 
b/modules/orchestrator/orchestrator-core/src/main/java/org/apache/airavata/orchestrator/core/schedule/HostScheduler.java
@@ -0,0 +1,34 @@
+/**
+ *
+ * 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.orchestrator.core.schedule;
+
+import java.util.List;
+
+import 
org.apache.airavata.model.appcatalog.computeresource.ComputeResourceDescription;
+
+public  interface HostScheduler {
+    /**
+     * This method will pick a host among set of hosts based on the algorithm 
users wants to implement, For a single instance
+     * of Airavata users can pick one Scheduler.
+     * @param registeredHosts
+     * @return
+     */
+    public ComputeResourceDescription 
schedule(List<ComputeResourceDescription> registeredHosts);
+}
diff --git 
a/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java
 
b/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java
index fed4bcc..f57fe07 100644
--- 
a/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java
+++ 
b/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java
@@ -26,10 +26,7 @@ import org.apache.airavata.common.logging.MDCUtil;
 import org.apache.airavata.common.utils.AiravataUtils;
 import org.apache.airavata.common.utils.ServerSettings;
 import org.apache.airavata.common.utils.ThriftUtils;
-import org.apache.airavata.common.utils.ZkConstants;
 import org.apache.airavata.gfac.core.GFacConstants;
-import org.apache.airavata.gfac.core.GFacUtils;
-import org.apache.airavata.gfac.core.scheduler.HostScheduler;
 import org.apache.airavata.messaging.core.*;
 import 
org.apache.airavata.model.appcatalog.appdeployment.ApplicationDeploymentDescription;
 import 
org.apache.airavata.model.appcatalog.appinterface.ApplicationInterfaceDescription;
@@ -50,6 +47,7 @@ import org.apache.airavata.model.process.ProcessModel;
 import org.apache.airavata.model.status.ExperimentState;
 import org.apache.airavata.model.status.ExperimentStatus;
 import org.apache.airavata.orchestrator.core.exception.OrchestratorException;
+import org.apache.airavata.orchestrator.core.schedule.HostScheduler;
 import org.apache.airavata.orchestrator.cpi.OrchestratorService;
 import org.apache.airavata.orchestrator.cpi.impl.SimpleOrchestratorImpl;
 import org.apache.airavata.orchestrator.cpi.orchestrator_cpiConstants;

Reply via email to