Commit 2a02a342 authored by Romain Reuillon's avatar Romain Reuillon
Browse files

[Plugin] enh: implemement job killAfter for ssh

parent d19e19f8
Pipeline #1223 passed with stages
in 38 minutes and 12 seconds
......@@ -34,7 +34,7 @@ import org.openmole.tool.lock._
import org.openmole.tool.logger.JavaLogger
import squants.information._
import squants.time.TimeConversions._
import squants.time.Time
import scala.ref.WeakReference
object SSHEnvironment extends JavaLogger {
......@@ -54,6 +54,7 @@ object SSHEnvironment extends JavaLogger {
workDirectory: OptionalArgument[String] = None,
openMOLEMemory: OptionalArgument[Information] = None,
threads: OptionalArgument[Int] = None,
killAfter: OptionalArgument[Time] = None,
storageSharedLocally: Boolean = false,
name: OptionalArgument[String] = None,
modules: Seq[String] = Vector(),
......@@ -70,6 +71,7 @@ object SSHEnvironment extends JavaLogger {
workDirectory = workDirectory,
openMOLEMemory = openMOLEMemory,
threads = threads,
killAfter = killAfter,
storageSharedLocally = storageSharedLocally,
name = Some(name.getOrElse(varName.value)),
authentication = SSHAuthentication.find(user, host, port),
......@@ -128,6 +130,7 @@ class SSHEnvironment[A: gridscale.ssh.SSHAuthentication](
val workDirectory: Option[String],
val openMOLEMemory: Option[Information],
val threads: Option[Int],
val killAfter: Option[Time],
val storageSharedLocally: Boolean,
val name: Option[String],
val authentication: A,
......
......@@ -78,7 +78,8 @@ class SSHJobService[S](s: S, tmpDirectory: String, services: BatchEnvironment.Se
val remoteScript = buildScript(serializedJob)
val jobDescription = gridscale.ssh.SSHJobDescription(
command = s"/bin/bash ${remoteScript.content}",
workDirectory = jobDirectory
workDirectory = jobDirectory,
timeout = env.killAfter
)
env.stateRegistry.registerJob(jobDescription, batchExecutionJob, remoteScript.jobWorkDirectory)
......
......@@ -5,7 +5,7 @@ object common {
def scalaVersionValue = "2.13.6"
def scalaXMLVersion = "2.0.0"
def gridscaleVersion = "2.38"
def gridscaleVersion = "2.39"
def mgoVersion = "3.50"
def sshjVersion = "0.31.0"
def containerVersion = "1.17"
......
Markdown is supported
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