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
Melodic
morphemic-preprocessor
Commits
b7cf0122
Commit
b7cf0122
authored
Jul 26, 2021
by
Ali Fahs
Browse files
create a token for BYON nodes when NS is defined
parent
cea2c203
Pipeline
#15050
passed with stage
in 2 minutes and 7 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
scheduling-abstraction-layer/src/main/java/org/activeeon/morphemic/PAGateway.java
View file @
b7cf0122
...
...
@@ -488,7 +488,7 @@ public class PAGateway {
filename
=
File
.
separator
+
"Define_NS_BYON.xml"
;
variables
.
put
(
"NS_name"
,
nodeSourceName
);
variables
.
put
(
"pa_protocol"
,
"http"
);
variables
.
put
(
"tokens"
,
"
ALL"
);
variables
.
put
(
"tokens"
,
"
BYON_"
+
byonNode
.
getJob
().
getJobId
()
);
variables
.
put
(
"ssh_username"
,
byonNode
.
getLoginCredential
().
getUsername
());
variables
.
put
(
"ssh_password"
,
byonNode
.
getLoginCredential
().
getPassword
());
/* IMPORTANT: Later we should relay only on the ssh_key. For now all the nodes must have the same login
...
...
@@ -648,7 +648,6 @@ public class PAGateway {
return
newByonNode
;
/* TODO:
* Avoid duplicate nodes in the database
* Create the NC here
*/
}
...
...
@@ -687,7 +686,6 @@ public class PAGateway {
Validate
.
notNull
(
byonIdPerComponent
,
"The received byonIdPerComponent structure is empty. Nothing to be added."
);
EntityManagerHelper
.
begin
();
byonIdPerComponent
.
forEach
((
byonNodeId
,
componentId
)
->
{
ByonNode
byonNode
=
EntityManagerHelper
.
find
(
ByonNode
.
class
,
byonNodeId
);
Task
task
=
EntityManagerHelper
.
find
(
Task
.
class
,
componentId
);
...
...
@@ -699,7 +697,7 @@ public class PAGateway {
List
<
ByonNode
>
byonNodeList
=
new
LinkedList
<>();
byonNodeList
.
add
(
byonNode
);
defineByonNodeSource
(
byonNodeList
,
byonNode
.
getName
()
);
defineByonNodeSource
(
byonNodeList
,
"BYON_NS_"
+
jobId
);
LOGGER
.
info
(
"BYON node source defined."
);
newDeployment
.
setTask
(
task
);
...
...
@@ -718,8 +716,6 @@ public class PAGateway {
return
0
;
/*TODO:
* Create node sources per JobID
* Set NodeSource name should be BYON_<JobID>
* Create mapping in the DB between the nodes and the components
* */
}
...
...
scheduling-abstraction-layer/src/main/resources/Define_NS_BYON.xml
View file @
b7cf0122
...
...
@@ -3,15 +3,15 @@
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns=
"urn:proactive:jobdescriptor:3.12"
xsi:schemaLocation=
"urn:proactive:jobdescriptor:3.12 http://www.activeeon.com/public_content/schemas/proactive/jobdescriptor/3.12/schedulerjob.xsd"
name=
"Define_NS_BYON.xml"
priority=
"normal"
onTaskError=
"continueJobExecution"
maxNumberOfExecution=
"2"
>
<variables>
<variable
name=
"pa_port"
value=
"8080"
/>
<variable
name=
"NS_name"
value=
"SSH_INFRA"
/>
<variable
name=
"pa_protocol"
value=
"http"
/>
<variable
name=
"rm_host_name"
value=
"
"
model=
"
"
/>
<variable
name=
"ssh_username"
value=
""
model=
""
/>
<variable
name=
"ssh_password"
value=
""
model=
""
/>
<variable
name=
"ssh_key"
value=
""
/>
<variable
name=
"ssh_port"
value=
"22"
model=
""
/>
<variable
name=
"list_of_ips"
value=
"
"
model=
"
"
/>
<variable
name=
"pa_port"
value=
"8080"
model=
"PA:Integer"
/>
<variable
name=
"NS_name"
value=
"SSH_INFRA"
model=
"PA:NOT_EMPTY_STRING"
/>
<variable
name=
"pa_protocol"
value=
"http"
model=
"PA:NOT_EMPTY_STRING"
/>
<variable
name=
"rm_host_name"
value=
"
example.com"
model=
"PA:NOT_EMPTY_STRING
"
/>
<variable
name=
"ssh_username"
value=
"
node
"
model=
"
PA:NOT_EMPTY_STRING
"
/>
<variable
name=
"ssh_password"
value=
""
model=
"
PA:HIDDEN
"
/>
<variable
name=
"ssh_key"
value=
""
model=
"PA:HIDDEN"
/>
<variable
name=
"ssh_port"
value=
"22"
model=
"
PA:Integer
"
/>
<variable
name=
"list_of_ips"
value=
"
127.0.0.1"
model=
"PA:NOT_EMPTY_STRING
"
/>
<variable
name=
"tokens"
value=
""
model=
""
/>
</variables>
<description>
...
...
@@ -51,9 +51,13 @@ def hosts = ""
for (ip in ips) {
hosts = hosts + ip + " 1\n"
}
if (tokens=="") {
tokens="ALL"
}
else {
tokens="tokens="+tokens
}
println "[+] Preparation of NodeSoure " + nodeSourceName
print "(1/4) Connecting to the RM at "+protocol+"://"+host+":"+port+"/ ..."
...
...
@@ -97,10 +101,10 @@ return retCode;
</scriptExecutable>
<metadata>
<positionTop>
5
08
5
11
</positionTop>
<positionLeft>
51
0
.5
51
4
.5
</positionLeft>
</metadata>
</task>
...
...
@@ -115,12 +119,12 @@ return retCode;
left:0 !important;
top:0 !important;
width:2726px;
height:3
116
px;
height:3
360
px;
}
</style>
</head>
<body>
<div
id=
"workflow-visualization-view"
><div
id=
"workflow-visualization"
style=
"position:relative;top:-50
3
px;left:-50
5
.5px"
><div
class=
"task _jsPlumb_endpoint_anchor_ ui-draggable"
id=
"jsPlumb_1_1
3
"
style=
"top: 5
08
px; left: 51
0
.5px; z-index: 24;"
><a
class=
"task-name"
data-toggle=
"tooltip"
data-placement=
"right"
title=
"The simplest task, ran by a Groovy engine."
><img
src=
"images/Groovy.png"
width=
"20px"
>
<span
class=
"name"
>
Create_NodeSource
</span></a></div><div
class=
"_jsPlumb_endpoint source-endpoint dependency-source-endpoint connected _jsPlumb_endpoint_anchor_ ui-draggable ui-droppable"
style=
"position: absolute; height: 20px; width: 20px; left: 56
3
px; top: 5
38
px;"
><svg
style=
"position:absolute;left:0px;top:0px"
width=
"20"
height=
"20"
pointer-events=
"all"
position=
"absolute"
version=
"1.1"
xmlns=
"http://www.w3.org/1999/xhtml"
><circle
cx=
"10"
cy=
"10"
r=
"10"
version=
"1.1"
xmlns=
"http://www.w3.org/1999/xhtml"
fill=
"#666"
stroke=
"none"
style=
""
></circle></svg></div></div></div>
<div
id=
"workflow-visualization-view"
><div
id=
"workflow-visualization"
style=
"position:relative;top:-50
6
px;left:-50
9
.5px"
><div
class=
"task _jsPlumb_endpoint_anchor_ ui-draggable"
id=
"jsPlumb_1_1
9
"
style=
"top: 5
11
px; left: 51
4
.5px; z-index: 24;"
><a
class=
"task-name"
data-toggle=
"tooltip"
data-placement=
"right"
title=
"The simplest task, ran by a Groovy engine."
><img
src=
"
/studio/
images/Groovy.png"
width=
"20px"
>
<span
class=
"name"
>
Create_NodeSource
</span></a></div><div
class=
"_jsPlumb_endpoint source-endpoint dependency-source-endpoint connected _jsPlumb_endpoint_anchor_ ui-draggable ui-droppable"
style=
"position: absolute; height: 20px; width: 20px; left: 56
7
px; top: 5
41
px;"
><svg
style=
"position:absolute;left:0px;top:0px"
width=
"20"
height=
"20"
pointer-events=
"all"
position=
"absolute"
version=
"1.1"
xmlns=
"http://www.w3.org/1999/xhtml"
><circle
cx=
"10"
cy=
"10"
r=
"10"
version=
"1.1"
xmlns=
"http://www.w3.org/1999/xhtml"
fill=
"#666"
stroke=
"none"
style=
""
></circle></svg></div></div></div>
</body>
</html>
]]>
...
...
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