Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Andreas Tsagkaropoulos
morphemic-preprocessor
Commits
e887fed9
Unverified
Commit
e887fed9
authored
Mar 04, 2021
by
Mohamed Khalil LABIDI
Committed by
GitHub
Mar 04, 2021
Browse files
Merge pull request #18 from mklkun/nodes-acq
Improve acquiring nodes in deployment phase
parents
17d49403
b3e0a610
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/activeeon/morphemic/PAGateway.java
View file @
e887fed9
...
...
@@ -624,6 +624,8 @@ public class PAGateway {
ScriptTask
deployNodeTask
=
PAFactory
.
createGroovyScriptTaskFromFile
(
"acquireAWSNode_"
+
task
.
getName
()
+
taskNameSuffix
,
"acquire_node_aws_script.groovy"
);
deployNodeTask
.
setPreScript
(
PAFactory
.
createSimpleScriptFromFIle
(
"pre_acquire_node_script.groovy"
,
"groovy"
));
Map
<
String
,
TaskVariable
>
variablesMap
=
new
HashMap
<>();
variablesMap
.
put
(
"NS_name"
,
new
TaskVariable
(
"NS_name"
,
deployment
.
getPaCloud
().
getNodeSourceNamePrefix
()
+
deployment
.
getLocationName
()));
...
...
src/main/resources/pre_acquire_node_script.groovy
0 → 100644
View file @
e887fed9
// 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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment