src/Pure/Build/build_cluster.scala
changeset 80199 987424bebeb9
parent 80198 7883f221d6d3
child 80200 5f053991315c
equal deleted inserted replaced
80198:7883f221d6d3 80199:987424bebeb9
   171   ) extends AutoCloseable {
   171   ) extends AutoCloseable {
   172     override def toString: String = ssh.toString
   172     override def toString: String = ssh.toString
   173 
   173 
   174     val build_cluster_identifier: String = options.string("build_cluster_identifier")
   174     val build_cluster_identifier: String = options.string("build_cluster_identifier")
   175     val build_cluster_root: Path = Path.explode(options.string("build_cluster_root"))
   175     val build_cluster_root: Path = Path.explode(options.string("build_cluster_root"))
   176     val built_cluster_isabelle_home: Path = build_cluster_root + Path.explode("isabelle")
   176     val build_cluster_isabelle_home: Path = build_cluster_root + Path.explode("isabelle")
   177 
   177 
   178     lazy val build_cluster_isabelle: Other_Isabelle =
   178     lazy val build_cluster_isabelle: Other_Isabelle =
   179       Other_Isabelle(built_cluster_isabelle_home,
   179       Other_Isabelle(build_cluster_isabelle_home,
   180         isabelle_identifier = build_cluster_identifier, ssh = ssh)
   180         isabelle_identifier = build_cluster_identifier, ssh = ssh)
   181 
   181 
   182     def sync(): Other_Isabelle = {
   182     def sync(): Other_Isabelle = {
   183       val context = Rsync.Context(ssh = ssh)
   183       val context = Rsync.Context(ssh = ssh)
   184       val target = built_cluster_isabelle_home
   184       val target = build_cluster_isabelle_home
   185       if (Mercurial.Hg_Sync.ok(Path.ISABELLE_HOME)) {
   185       if (Mercurial.Hg_Sync.ok(Path.ISABELLE_HOME)) {
   186         val source = File.standard_path(Path.ISABELLE_HOME)
   186         val source = File.standard_path(Path.ISABELLE_HOME)
   187         Rsync.exec(context, clean = true,
   187         Rsync.exec(context, clean = true,
   188           args = List("--", Url.direct_path(source), context.target(target))).check
   188           args = List("--", Url.direct_path(source), context.target(target))).check
   189       }
   189       }
   201         build_cluster_isabelle.init_components() ::: build_cluster_isabelle.debug_settings())
   201         build_cluster_isabelle.init_components() ::: build_cluster_isabelle.debug_settings())
   202 
   202 
   203     def benchmark(): Unit = {
   203     def benchmark(): Unit = {
   204       val script =
   204       val script =
   205         Build_Benchmark.benchmark_command(options, host, ssh = ssh,
   205         Build_Benchmark.benchmark_command(options, host, ssh = ssh,
   206           isabelle_home = built_cluster_isabelle_home)
   206           isabelle_home = build_cluster_isabelle_home)
   207       build_cluster_isabelle.bash(script).check
   207       build_cluster_isabelle.bash(script).check
   208     }
   208     }
   209 
   209 
   210     def start(): Process_Result = {
   210     def start(): Process_Result = {
   211       val build_cluster_ml_platform = build_cluster_isabelle.getenv("ML_PLATFORM")
   211       val build_cluster_ml_platform = build_cluster_isabelle.getenv("ML_PLATFORM")
   218       val script =
   218       val script =
   219         Build.build_worker_command(host,
   219         Build.build_worker_command(host,
   220           ssh = ssh,
   220           ssh = ssh,
   221           build_options = build_options.toList,
   221           build_options = build_options.toList,
   222           build_id = build_context.build_uuid,
   222           build_id = build_context.build_uuid,
   223           isabelle_home = built_cluster_isabelle_home,
   223           isabelle_home = build_cluster_isabelle_home,
   224           dirs = Path.split(host.dirs).map(build_cluster_isabelle.expand_path),
   224           dirs = Path.split(host.dirs).map(build_cluster_isabelle.expand_path),
   225           quiet = true)
   225           quiet = true)
   226       build_cluster_isabelle.bash(script).check
   226       build_cluster_isabelle.bash(script).check
   227     }
   227     }
   228 
   228