Unverified Commit 9bbf96e7 authored by Mohamed Khalil LABIDI's avatar Mohamed Khalil LABIDI Committed by GitHub
Browse files

Fix t4g hardware type handling and command tasks creation (#16)

* Fix t4g hardware type handling and command tasks creation

* Fix start creation
parent 3459771e
...@@ -279,9 +279,10 @@ public class PAGateway { ...@@ -279,9 +279,10 @@ public class PAGateway {
List<NodeCandidate> allNodeCandidates = EntityManagerHelper.createQuery("SELECT nc FROM NodeCandidate nc", List<NodeCandidate> allNodeCandidates = EntityManagerHelper.createQuery("SELECT nc FROM NodeCandidate nc",
NodeCandidate.class).getResultList(); NodeCandidate.class).getResultList();
allNodeCandidates.forEach(nodeCandidate -> { allNodeCandidates.forEach(nodeCandidate -> {
// Hardware types t3a are not YET, handled by jclouds. // Hardware types t3a and t4g are not YET, handled by jclouds.
if (NodeCandidateUtils.verifyAllFilters(requirements, nodeCandidate) && if (NodeCandidateUtils.verifyAllFilters(requirements, nodeCandidate) &&
!nodeCandidate.getHardware().getName().startsWith("t3a")) { !nodeCandidate.getHardware().getName().startsWith("t3a") &&
!nodeCandidate.getHardware().getName().startsWith("t4g")) {
filteredNodeCandidates.add(nodeCandidate); filteredNodeCandidates.add(nodeCandidate);
} }
}); });
...@@ -579,7 +580,9 @@ public class PAGateway { ...@@ -579,7 +580,9 @@ public class PAGateway {
ScriptTask scriptTaskStart = null; ScriptTask scriptTaskStart = null;
ScriptTask scriptTaskInstall = null; ScriptTask scriptTaskInstall = null;
if (!task.getInstallation().getInstall().isEmpty()) { if (!(task.getInstallation().getInstall().isEmpty() &&
task.getInstallation().getPreInstall().isEmpty() &&
task.getInstallation().getPostInstall().isEmpty())) {
scriptTaskInstall = PAFactory.createBashScriptTask(task.getName() + "_install" + taskNameSuffix, task.getInstallation().getInstall()); scriptTaskInstall = PAFactory.createBashScriptTask(task.getName() + "_install" + taskNameSuffix, task.getInstallation().getInstall());
if (!task.getInstallation().getPreInstall().isEmpty()) { if (!task.getInstallation().getPreInstall().isEmpty()) {
scriptTaskInstall.setPreScript(PAFactory.createSimpleScript(task.getInstallation().getPreInstall(), "bash")); scriptTaskInstall.setPreScript(PAFactory.createSimpleScript(task.getInstallation().getPreInstall(), "bash"));
...@@ -591,7 +594,9 @@ public class PAGateway { ...@@ -591,7 +594,9 @@ public class PAGateway {
scriptTasks.add(scriptTaskInstall); scriptTasks.add(scriptTaskInstall);
} }
if (!task.getInstallation().getStart().isEmpty()) { if (!(task.getInstallation().getStart().isEmpty() &&
task.getInstallation().getPreStart().isEmpty() &&
task.getInstallation().getPostStart().isEmpty())) {
scriptTaskStart = PAFactory.createBashScriptTask(task.getName() + "_start" + taskNameSuffix, task.getInstallation().getStart()); scriptTaskStart = PAFactory.createBashScriptTask(task.getName() + "_start" + taskNameSuffix, task.getInstallation().getStart());
if (!task.getInstallation().getPreStart().isEmpty()) { if (!task.getInstallation().getPreStart().isEmpty()) {
scriptTaskStart.setPreScript(PAFactory.createSimpleScript(task.getInstallation().getPreStart(), "bash")); scriptTaskStart.setPreScript(PAFactory.createSimpleScript(task.getInstallation().getPreStart(), "bash"));
...@@ -839,6 +844,8 @@ public class PAGateway { ...@@ -839,6 +844,8 @@ public class PAGateway {
setAllMandatoryDependencies(paJob, jobToSubmit); setAllMandatoryDependencies(paJob, jobToSubmit);
paJob.setProjectName("Morphemic");
long submittedJobId = schedulerGateway.submit(paJob).longValue(); long submittedJobId = schedulerGateway.submit(paJob).longValue();
jobToSubmit.setSubmittedJobId(submittedJobId); jobToSubmit.setSubmittedJobId(submittedJobId);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment