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 {
List<NodeCandidate> allNodeCandidates = EntityManagerHelper.createQuery("SELECT nc FROM NodeCandidate nc",
NodeCandidate.class).getResultList();
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) &&
!nodeCandidate.getHardware().getName().startsWith("t3a")) {
!nodeCandidate.getHardware().getName().startsWith("t3a") &&
!nodeCandidate.getHardware().getName().startsWith("t4g")) {
filteredNodeCandidates.add(nodeCandidate);
}
});
......@@ -579,7 +580,9 @@ public class PAGateway {
ScriptTask scriptTaskStart = 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());
if (!task.getInstallation().getPreInstall().isEmpty()) {
scriptTaskInstall.setPreScript(PAFactory.createSimpleScript(task.getInstallation().getPreInstall(), "bash"));
......@@ -591,7 +594,9 @@ public class PAGateway {
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());
if (!task.getInstallation().getPreStart().isEmpty()) {
scriptTaskStart.setPreScript(PAFactory.createSimpleScript(task.getInstallation().getPreStart(), "bash"));
......@@ -839,6 +844,8 @@ public class PAGateway {
setAllMandatoryDependencies(paJob, jobToSubmit);
paJob.setProjectName("Morphemic");
long submittedJobId = schedulerGateway.submit(paJob).longValue();
jobToSubmit.setSubmittedJobId(submittedJobId);
......
Markdown is supported
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