Skip to content
GitLab
Menu
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
095497ce
Commit
095497ce
authored
Feb 26, 2021
by
Mohamed Khalil Labidi
Browse files
Improve workflow mandatory dependencies calculation
parent
45b079cb
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/activeeon/morphemic/PAGateway.java
View file @
095497ce
...
@@ -779,6 +779,8 @@ public class PAGateway {
...
@@ -779,6 +779,8 @@ public class PAGateway {
if
(
task
.
getDeployments
()
==
null
||
task
.
getDeployments
().
isEmpty
())
{
if
(
task
.
getDeployments
()
==
null
||
task
.
getDeployments
().
isEmpty
())
{
LOGGER
.
warn
(
"The task "
+
task
.
getName
()
+
" does not have a deployment. It will be scheduled on any free node."
);
LOGGER
.
warn
(
"The task "
+
task
.
getName
()
+
" does not have a deployment. It will be scheduled on any free node."
);
scriptTasks
.
addAll
(
createAppTasks
(
task
,
""
,
""
));
scriptTasks
.
addAll
(
createAppTasks
(
task
,
""
,
""
));
task
.
setDeploymentFirstSubmittedTaskName
(
scriptTasks
.
get
(
0
).
getName
());
task
.
setDeploymentLastSubmittedTaskName
(
scriptTasks
.
get
(
scriptTasks
.
size
()-
1
).
getName
());
}
}
else
{
else
{
task
.
getDeployments
().
forEach
(
deployment
->
{
task
.
getDeployments
().
forEach
(
deployment
->
{
...
@@ -792,9 +794,13 @@ public class PAGateway {
...
@@ -792,9 +794,13 @@ public class PAGateway {
deployment
.
setIsDeployed
(
true
);
deployment
.
setIsDeployed
(
true
);
});
});
task
.
setDeploymentFirstSubmittedTaskName
(
scriptTasks
.
get
(
0
).
getName
().
substring
(
0
,
scriptTasks
.
get
(
0
).
getName
().
lastIndexOf
(
"_0"
)));
tasksTokens
.
forEach
(
taskToken
->
{
tasksTokens
.
forEach
(
taskToken
->
{
String
suffix
=
"_"
+
tasksTokens
.
indexOf
(
taskToken
);
String
suffix
=
"_"
+
tasksTokens
.
indexOf
(
taskToken
);
scriptTasks
.
addAll
(
0
,
createAppTasks
(
task
,
suffix
,
taskToken
));
List
<
ScriptTask
>
appTasks
=
createAppTasks
(
task
,
suffix
,
taskToken
);
task
.
setDeploymentLastSubmittedTaskName
(
appTasks
.
get
(
appTasks
.
size
()-
1
).
getName
().
substring
(
0
,
appTasks
.
get
(
appTasks
.
size
()-
1
).
getName
().
lastIndexOf
(
suffix
)));
scriptTasks
.
addAll
(
0
,
appTasks
);
if
(
task
.
getInstallation
().
getOperatingSystemType
().
getOperatingSystemFamily
().
toLowerCase
(
Locale
.
ROOT
).
equals
(
"ubuntu"
)
&&
if
(
task
.
getInstallation
().
getOperatingSystemType
().
getOperatingSystemFamily
().
toLowerCase
(
Locale
.
ROOT
).
equals
(
"ubuntu"
)
&&
task
.
getInstallation
().
getOperatingSystemType
().
getOperatingSystemVersion
()
<
2000
)
{
task
.
getInstallation
().
getOperatingSystemType
().
getOperatingSystemVersion
()
<
2000
)
{
...
@@ -827,7 +833,10 @@ public class PAGateway {
...
@@ -827,7 +833,10 @@ public class PAGateway {
paJob
.
getTasks
().
forEach
(
paTask
->
{
paJob
.
getTasks
().
forEach
(
paTask
->
{
paJob
.
getTasks
().
forEach
(
paParentTask
->
{
paJob
.
getTasks
().
forEach
(
paParentTask
->
{
if
(
paTask
.
getName
().
contains
(
task
.
getName
())
&&
paParentTask
.
getName
().
contains
(
parentTaskName
))
{
if
(
paTask
.
getName
().
contains
(
task
.
getName
())
&&
paParentTask
.
getName
().
contains
(
parentTaskName
))
{
paTask
.
addDependence
(
paParentTask
);
if
(
paTask
.
getName
().
contains
(
task
.
getDeploymentFirstSubmittedTaskName
())
&&
paParentTask
.
getName
().
contains
(
jobToSubmit
.
findTask
(
parentTaskName
).
getDeploymentLastSubmittedTaskName
()))
{
paTask
.
addDependence
(
paParentTask
);
}
}
}
});
});
});
});
...
...
src/main/java/org/activeeon/morphemic/model/Task.java
View file @
095497ce
...
@@ -53,6 +53,12 @@ public class Task implements Serializable {
...
@@ -53,6 +53,12 @@ public class Task implements Serializable {
@ElementCollection
(
targetClass
=
String
.
class
)
@ElementCollection
(
targetClass
=
String
.
class
)
private
List
<
String
>
submittedTaskNames
;
private
List
<
String
>
submittedTaskNames
;
@Column
(
name
=
"DEPLOYMENT_FIRST_SUBMITTED_TASK_NAME"
)
private
String
deploymentFirstSubmittedTaskName
;
@Column
(
name
=
"DEPLOYMENT_LAST_SUBMITTED_TASK_NAME"
)
private
String
deploymentLastSubmittedTaskName
;
public
void
addDeployment
(
Deployment
deployment
)
{
public
void
addDeployment
(
Deployment
deployment
)
{
if
(
deployments
==
null
){
if
(
deployments
==
null
){
deployments
=
new
LinkedList
<>();
deployments
=
new
LinkedList
<>();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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