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
45b079cb
Commit
45b079cb
authored
Feb 25, 2021
by
Mohamed Khalil Labidi
Browse files
Restrict waiting task process to ubuntu < 20.00 versions
parent
86e23465
Changes
5
Show whitespace changes
Inline
Side-by-side
build.gradle
View file @
45b079cb
...
...
@@ -45,6 +45,7 @@ dependencies {
compile
group:
'com.fasterxml.jackson.core'
,
name:
'jackson-databind'
,
version:
'2.12.1'
compile
group:
'com.fasterxml.jackson.dataformat'
,
name:
'jackson-dataformat-csv'
,
version:
'2.12.1'
compile
group:
'org.eclipse.emf'
,
name:
'org.eclipse.emf.common'
,
version:
'2.20.0'
compile
group:
'org.apache.commons'
,
name:
'commons-lang3'
,
version:
'3.11'
annotationProcessor
"org.projectlombok:lombok:1.18.12"
}
pom.xml
View file @
45b079cb
...
...
@@ -95,6 +95,12 @@
<version>
2.12.1
</version>
<scope>
compile
</scope>
</dependency>
<dependency>
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-lang3
</artifactId>
<version>
3.11
</version>
<scope>
compile
</scope>
</dependency>
<dependency>
<groupId>
junit
</groupId>
<artifactId>
junit
</artifactId>
...
...
src/main/java/org/activeeon/morphemic/PAGateway.java
View file @
45b079cb
...
...
@@ -245,6 +245,12 @@ public class PAGateway {
commands
.
setPreStop
(
installation
.
optString
(
"preStop"
));
commands
.
setStop
(
installation
.
optString
(
"stop"
));
commands
.
setPostStop
(
installation
.
optString
(
"postStop"
));
OperatingSystemType
operatingSystemType
=
new
OperatingSystemType
();
operatingSystemType
.
setOperatingSystemFamily
(
installation
.
optJSONObject
(
"operatingSystem"
)
.
optString
(
"operatingSystemFamily"
));
operatingSystemType
.
setOperatingSystemVersion
(
installation
.
optJSONObject
(
"operatingSystem"
)
.
optFloat
(
"operatingSystemVersion"
));
commands
.
setOperatingSystemType
(
operatingSystemType
);
newTask
.
setInstallation
(
commands
);
break
;
case
"spark"
:
...
...
@@ -633,7 +639,6 @@ public class PAGateway {
}
else
{
try
{
nodeConfigJson
+=
"\", \"portToOpens\": "
+
mapper
.
writeValueAsString
(
task
.
getPortsToOpen
())
+
"}"
;
;
}
catch
(
IOException
e
)
{
LOGGER
.
error
(
e
.
getStackTrace
());
}
...
...
@@ -791,11 +796,20 @@ public class PAGateway {
String
suffix
=
"_"
+
tasksTokens
.
indexOf
(
taskToken
);
scriptTasks
.
addAll
(
0
,
createAppTasks
(
task
,
suffix
,
taskToken
));
if
(
task
.
getInstallation
().
getOperatingSystemType
().
getOperatingSystemFamily
().
toLowerCase
(
Locale
.
ROOT
).
equals
(
"ubuntu"
)
&&
task
.
getInstallation
().
getOperatingSystemType
().
getOperatingSystemVersion
()
<
2000
)
{
LOGGER
.
info
(
"Adding apt lock handler task since task: "
+
task
.
getName
()
+
" is meant to be executed in: "
+
task
.
getInstallation
().
getOperatingSystemType
().
getOperatingSystemFamily
()
+
" version: "
+
task
.
getInstallation
().
getOperatingSystemType
().
getOperatingSystemVersion
());
scriptTasks
.
add
(
0
,
createLockHandlerTask
(
task
.
getName
(),
suffix
,
taskToken
));
scriptTasks
.
get
(
1
).
addDependence
(
scriptTasks
.
get
(
0
));
}
});
}
scriptTasks
.
forEach
(
scriptTask
->
task
.
addSubmittedTaskName
(
scriptTask
.
getName
()));
return
scriptTasks
;
}
...
...
@@ -844,7 +858,6 @@ public class PAGateway {
scriptTasks
.
forEach
(
scriptTask
->
{
try
{
paJob
.
addTask
(
scriptTask
);
task
.
addSubmittedTaskName
(
scriptTask
.
getName
());
}
catch
(
UserException
e
)
{
LOGGER
.
error
(
"Task "
+
task
.
getName
()
+
" could not be added due to: "
+
e
.
toString
());
}
...
...
src/main/java/org/activeeon/morphemic/model/CommandsInstallation.java
View file @
45b079cb
...
...
@@ -4,6 +4,7 @@ import lombok.*;
import
javax.persistence.Column
;
import
javax.persistence.Embeddable
;
import
javax.persistence.Embedded
;
@AllArgsConstructor
@NoArgsConstructor
...
...
@@ -41,4 +42,7 @@ public class CommandsInstallation {
@Column
(
name
=
"UPDATE_CMD"
,
columnDefinition
=
"TEXT"
)
private
String
updateCmd
;
@Embedded
private
OperatingSystemType
operatingSystemType
;
}
src/main/java/org/activeeon/morphemic/model/OperatingSystemType.java
0 → 100644
View file @
45b079cb
package
org.activeeon.morphemic.model
;
import
lombok.*
;
import
javax.persistence.Column
;
import
javax.persistence.Embeddable
;
@AllArgsConstructor
@NoArgsConstructor
@ToString
@Getter
@Setter
@Embeddable
public
class
OperatingSystemType
{
@Column
(
name
=
"OPERATING_SYSTEM_FAMILY"
)
private
String
operatingSystemFamily
;
@Column
(
name
=
"OPERATING_SYSTEM_VERSION"
)
private
float
operatingSystemVersion
;
}
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