Commit b3e0a610 authored by Mohamed Khalil Labidi's avatar Mohamed Khalil Labidi
Browse files

Improve acquiring nodes in deployment phase

parent 17d49403
...@@ -624,6 +624,8 @@ public class PAGateway { ...@@ -624,6 +624,8 @@ public class PAGateway {
ScriptTask deployNodeTask = PAFactory.createGroovyScriptTaskFromFile("acquireAWSNode_" + task.getName() + taskNameSuffix, ScriptTask deployNodeTask = PAFactory.createGroovyScriptTaskFromFile("acquireAWSNode_" + task.getName() + taskNameSuffix,
"acquire_node_aws_script.groovy"); "acquire_node_aws_script.groovy");
deployNodeTask.setPreScript(PAFactory.createSimpleScriptFromFIle("pre_acquire_node_script.groovy", "groovy"));
Map<String, TaskVariable> variablesMap = new HashMap<>(); Map<String, TaskVariable> variablesMap = new HashMap<>();
variablesMap.put("NS_name", new TaskVariable("NS_name", variablesMap.put("NS_name", new TaskVariable("NS_name",
deployment.getPaCloud().getNodeSourceNamePrefix() + deployment.getLocationName())); deployment.getPaCloud().getNodeSourceNamePrefix() + deployment.getLocationName()));
......
// Connecting to the ResourceManager API
rmapi.connect()
// Getting NS configuration settings
def retCode = 0
def nodeSourceName = variables.get("NS_name")
def flag = false
def count = 0
while (!flag) {
try {
if (rmapi.getNodeSourcePingFrequency(nodeSourceName)) {
println " Node source ready !"
}
flag = true
} catch (Exception e) {
if (count > 25) {
println "NodeSource is still not reachable after " + count + " seconds. Aborting."
System.exit(1)
}
println "NodeSource is not yet reachable, time spent: " + count
sleep(5000)
count += 5
}
}
// Disconnecting from the ResourceManager API
rmapi.disconnect()
\ No newline at end of file
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