Management of build cluster: independent ssh hosts with access to shared PostgreSQL server.
NB: extensible classes allow quite different implementations in user-space, via the service class Build.Engine and overridable methods Build.Engine.open_build_process(), Build_Process.open_build_cluster().
*/
val names = str.takeWhile(c => !rfc822_specials.contains(c) || c == ',') val more_specs = try { val n = str.length val m = names.length val l = if (m == n) n elseif (str(m) == ':') m + 1 else error("Missing \":\" after host name")
Options.Spec.parse(str.substring(l))
} catch { case ERROR(msg) => err(msg) }
def get_registry(a: String): Registry.Cluster.Value =
Registry.Cluster.try_unqualify(a) match { case Some(b) => Registry.Cluster.get(registry, b) case None => List(a -> Registry.Host.get(registry, a))
}
class Host( val name: String, val hostname: String, val user: String, val port: Int, val jobs: Int, val numa: Boolean, val dirs: String, val home: String, val shared: Boolean, val settings: List[String], val options: List[Options.Spec]
) {
host =>
def open_ssh(options: Options): SSH.System =
SSH.open_system(options ++ host.options, ssh_host, port = host.port,
user = host.user, user_home = host.home)
def open_session(build_context: Build.Context, progress: Progress = new Progress): Session = { val ssh_options = build_context.build_options ++ host.options val ssh = open_ssh(build_context.build_options) new Session(build_context, host, ssh_options, ssh, progress)
}
}
/* SSH sessions */
class Session( val build_context: Build.Context, val host: Host, val options: Options, val ssh: SSH.System, val progress: Progress
) extends AutoCloseable { overridedef toString: String = ssh.toString
val build_cluster_identifier: String = options.string("build_cluster_identifier") val build_cluster_isabelle_home: Path =
Path.explode(options.string("build_cluster_root")) + Path.explode("isabelle")
def make(build_context: Build.Context, progress: Progress = new Progress): Build_Cluster = { val remote_hosts = build_context.build_hosts.filter(_.is_remote) if (remote_hosts.isEmpty) none elsenew Remote_Build_Cluster(build_context, remote_hosts, progress = progress)
}
}
// NB: extensible via Build.Engine.build_process() and Build_Process.init_cluster() trait Build_Cluster extends AutoCloseable { def rc: Int = Process_Result.RC.ok def ok: Boolean = rc == Process_Result.RC.ok def return_code(rc: Int): Unit = () def return_code(res: Process_Result): Unit = return_code(res.rc) def return_code(exn: Throwable): Unit = return_code(Process_Result.RC(exn)) def open(): Build_Cluster = this def init(): Build_Cluster = this def benchmark(): Build_Cluster = this def start(): Build_Cluster = this def active(): Boolean = false def join: List[Build_Cluster.Result] = Nil def stop(): Unit = { join; close() } overridedef close(): Unit = ()
}
class Remote_Build_Cluster( val build_context: Build.Context, val remote_hosts: List[Build_Cluster.Host], val progress: Progress = new Progress
) extends Build_Cluster {
require(remote_hosts.nonEmpty && remote_hosts.forall(_.is_remote), "remote hosts required")
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.