more robust hostname for Isabelle cronjobs: do not rely on target OS installation for resulting build_log database content;
authorwenzelm
Wed Nov 14 21:28:48 2018 +0100 (3 weeks ago)
changeset 693041f4afcde3334
parent 69303 51d8b4dbc61b
child 69305 5a71b5145201
more robust hostname for Isabelle cronjobs: do not rely on target OS installation for resulting build_log database content;
src/Pure/Admin/build_history.scala
src/Pure/Admin/isabelle_cronjob.scala
     1.1 --- a/src/Pure/Admin/build_history.scala	Wed Nov 14 20:59:53 2018 +0100
     1.2 +++ b/src/Pure/Admin/build_history.scala	Wed Nov 14 21:28:48 2018 +0100
     1.3 @@ -114,6 +114,7 @@
     1.4      ml_statistics_step: Int = 1,
     1.5      components_base: String = "",
     1.6      fresh: Boolean = false,
     1.7 +    hostname: String = "",
     1.8      nonfree: Boolean = false,
     1.9      multicore_base: Boolean = false,
    1.10      multicore_list: List[(Int, Int)] = List(default_multicore),
    1.11 @@ -176,7 +177,7 @@
    1.12        Other_Isabelle(root, isabelle_identifier = isabelle_identifier,
    1.13          user_home = user_home, progress = progress)
    1.14  
    1.15 -    val build_host = Isabelle_System.hostname()
    1.16 +    val build_host = proper_string(hostname) getOrElse Isabelle_System.hostname()
    1.17      val build_history_date = Date.now()
    1.18      val build_group_id = build_host + ":" + build_history_date.time.ms
    1.19  
    1.20 @@ -402,6 +403,7 @@
    1.21        var afp_partition = 0
    1.22        var more_settings: List[String] = Nil
    1.23        var fresh = false
    1.24 +      var hostname = ""
    1.25        var init_settings: List[String] = Nil
    1.26        var arch_64 = false
    1.27        var nonfree = false
    1.28 @@ -428,6 +430,7 @@
    1.29      -U SIZE      maximal ML heap in MB (default: unbounded)
    1.30      -e TEXT      additional text for generated etc/settings
    1.31      -f           fresh build of Isabelle/Scala components (recommended)
    1.32 +    -h NAME      override local hostname
    1.33      -i TEXT      initial text for generated etc/settings
    1.34      -m ARCH      processor architecture (32=x86, 64=x86_64, default: x86)
    1.35      -n           include nonfree components
    1.36 @@ -455,6 +458,7 @@
    1.37          "U:" -> (arg => max_heap = Some(Value.Int.parse(arg))),
    1.38          "e:" -> (arg => more_settings = more_settings ::: List(arg)),
    1.39          "f" -> (_ => fresh = true),
    1.40 +        "h:" -> (arg => hostname = arg),
    1.41          "i:" -> (arg => init_settings = init_settings ::: List(arg)),
    1.42          "m:" ->
    1.43            {
    1.44 @@ -484,7 +488,7 @@
    1.45          build_history(Options.init(), root, user_home = user_home, progress = progress, rev = rev,
    1.46            afp_rev = afp_rev, afp_partition = afp_partition,
    1.47            isabelle_identifier = isabelle_identifier, ml_statistics_step = ml_statistics_step,
    1.48 -          components_base = components_base, fresh = fresh, nonfree = nonfree,
    1.49 +          components_base = components_base, fresh = fresh, hostname = hostname, nonfree = nonfree,
    1.50            multicore_base = multicore_base, multicore_list = multicore_list, arch_64 = arch_64,
    1.51            heap = heap.getOrElse(if (arch_64) default_heap * 2 else default_heap),
    1.52            max_heap = max_heap, init_settings = init_settings, more_settings = more_settings,
     2.1 --- a/src/Pure/Admin/isabelle_cronjob.scala	Wed Nov 14 20:59:53 2018 +0100
     2.2 +++ b/src/Pure/Admin/isabelle_cronjob.scala	Wed Nov 14 21:28:48 2018 +0100
     2.3 @@ -350,7 +350,7 @@
     2.4                  afp_rev = afp_rev,
     2.5                  options =
     2.6                    " -N " + Bash.string(task_name) + (if (i < 0) "" else "_" + (i + 1).toString) +
     2.7 -                  " -f " + r.options,
     2.8 +                  " -f -h " + Bash.string(r.host) + " " + r.options,
     2.9                  args = "-o timeout=10800 " + r.args)
    2.10  
    2.11              for ((log_name, bytes) <- results) {