clarified modules;
authorwenzelm
Mon May 08 12:04:58 2017 +0200 (2017-05-08)
changeset 65770fb8a7962f2ae
parent 65769 490b7c517000
child 65771 688a7dd22cbb
clarified modules;
src/Pure/Admin/isabelle_cronjob.scala
src/Pure/Admin/isabelle_devel.scala
src/Pure/build-jars
     1.1 --- a/src/Pure/Admin/isabelle_cronjob.scala	Mon May 08 11:33:04 2017 +0200
     1.2 +++ b/src/Pure/Admin/isabelle_cronjob.scala	Mon May 08 12:04:58 2017 +0200
     1.3 @@ -28,11 +28,6 @@
     1.4    val isabelle_release_source = "http://bitbucket.org/isabelle_project/isabelle-release"
     1.5    val afp_source = "https://bitbucket.org/isa-afp/afp-devel"
     1.6  
     1.7 -  val devel_dir = Path.explode("~/html-data/devel")
     1.8 -  val release_snapshot_dir = devel_dir + Path.explode("release_snapshot")
     1.9 -  val build_log_db = devel_dir + Path.explode("build_log.db")
    1.10 -  val build_status_dir = devel_dir + Path.explode("build_status")
    1.11 -
    1.12    val jenkins_jobs = "identify" :: Jenkins.build_log_jobs
    1.13  
    1.14  
    1.15 @@ -43,7 +38,6 @@
    1.16  
    1.17    private val build_release =
    1.18      Logger_Task("build_release", logger =>
    1.19 -      Isabelle_System.with_tmp_dir("isadist")(base_dir =>
    1.20          {
    1.21            val rev = Mercurial.repository(isabelle_repos).id()
    1.22            val afp_rev = Mercurial.setup_repository(afp_source, afp_repos).id()
    1.23 @@ -51,19 +45,9 @@
    1.24            File.write(logger.log_dir + Build_Log.log_filename("isabelle_identify", logger.start_date),
    1.25              Build_Log.Identify.content(logger.start_date, Some(rev), Some(afp_rev)))
    1.26  
    1.27 -          val new_snapshot = release_snapshot_dir.ext("new")
    1.28 -          val old_snapshot = release_snapshot_dir.ext("old")
    1.29 -
    1.30 -          Isabelle_System.rm_tree(new_snapshot)
    1.31 -          Isabelle_System.rm_tree(old_snapshot)
    1.32 -
    1.33 -          Build_Release.build_release(base_dir, rev = rev, afp_rev = afp_rev,
    1.34 -            parallel_jobs = 4, remote_mac = "macbroy31", website = Some(new_snapshot))
    1.35 -
    1.36 -          if (release_snapshot_dir.is_dir) File.move(release_snapshot_dir, old_snapshot)
    1.37 -          File.move(new_snapshot, release_snapshot_dir)
    1.38 -          Isabelle_System.rm_tree(old_snapshot)
    1.39 -        }))
    1.40 +          Isabelle_Devel.release_snapshot(rev = rev, afp_rev = afp_rev,
    1.41 +            parallel_jobs = 4, remote_mac = "macbroy31")
    1.42 +        })
    1.43  
    1.44  
    1.45    /* integrity test of build_history vs. build_history_base */
    1.46 @@ -175,33 +159,9 @@
    1.47        })
    1.48    }
    1.49  
    1.50 -
    1.51 -  /* maintain build_log database */
    1.52 -
    1.53 -  val database_dirs =
    1.54 -    List(Path.explode("~/log"), Path.explode("~/afp/log"), Path.explode("~/cronjob/log"))
    1.55 -
    1.56 -  def database_update(options: Options)
    1.57 -  {
    1.58 -    val store = Build_Log.store(options)
    1.59 -    using(store.open_database())(db =>
    1.60 -    {
    1.61 -      store.update_database(db, database_dirs, ml_statistics = true)
    1.62 -      store.snapshot_database(db, build_log_db)
    1.63 -    })
    1.64 -  }
    1.65 -
    1.66 -
    1.67 -  /* present build status */
    1.68 -
    1.69    val build_status_profiles: List[Build_Status.Profile] =
    1.70      (remote_builds_old :: remote_builds).flatten.map(_.profile)
    1.71  
    1.72 -  def build_status(options: Options)
    1.73 -  {
    1.74 -    Build_Status.present_data(Build_Status.read_data(options), target_dir = build_status_dir)
    1.75 -  }
    1.76 -
    1.77  
    1.78  
    1.79    /** task logging **/
    1.80 @@ -349,8 +309,10 @@
    1.81            SEQ(List(build_release, build_history_base,
    1.82              PAR(remote_builds.map(seq => SEQ(seq.map(remote_build_history(rev, _))))),
    1.83              Logger_Task("jenkins_logs", _ => Jenkins.download_logs(jenkins_jobs, main_dir)),
    1.84 -            Logger_Task("build_log_database", logger => database_update(logger.options)),
    1.85 -            Logger_Task("build_status", logger => build_status(logger.options)))))))
    1.86 +            Logger_Task("build_log_database",
    1.87 +              logger => Isabelle_Devel.build_log_database(logger.options)),
    1.88 +            Logger_Task("build_status",
    1.89 +              logger => Isabelle_Devel.build_status(logger.options)))))))
    1.90  
    1.91      log_service.shutdown()
    1.92  
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/src/Pure/Admin/isabelle_devel.scala	Mon May 08 12:04:58 2017 +0200
     2.3 @@ -0,0 +1,68 @@
     2.4 +/*  Title:      Pure/Admin/isabelle_devel.scala
     2.5 +    Author:     Makarius
     2.6 +
     2.7 +Website for Isabelle development resources.
     2.8 +*/
     2.9 +
    2.10 +package isabelle
    2.11 +
    2.12 +
    2.13 +object Isabelle_Devel
    2.14 +{
    2.15 +  val root_dir = Path.explode("~/html-data/devel")
    2.16 +
    2.17 +  val release_snapshot_dir = root_dir + Path.explode("release_snapshot")
    2.18 +  val build_log_db = root_dir + Path.explode("build_log.db")
    2.19 +  val build_status_dir = root_dir + Path.explode("build_status")
    2.20 +
    2.21 +  val log_dirs =
    2.22 +    List(Path.explode("~/log"), Path.explode("~/afp/log"), Path.explode("~/cronjob/log"))
    2.23 +
    2.24 +
    2.25 +  /* release snapshot */
    2.26 +
    2.27 +  def release_snapshot(
    2.28 +    rev: String = "",
    2.29 +    afp_rev: String = "",
    2.30 +    parallel_jobs: Int = 1,
    2.31 +    remote_mac: String = "")
    2.32 +  {
    2.33 +    Isabelle_System.with_tmp_dir("isadist")(base_dir =>
    2.34 +      {
    2.35 +        val new_snapshot = release_snapshot_dir.ext("new")
    2.36 +        val old_snapshot = release_snapshot_dir.ext("old")
    2.37 +
    2.38 +        Isabelle_System.rm_tree(new_snapshot)
    2.39 +        Isabelle_System.rm_tree(old_snapshot)
    2.40 +
    2.41 +        Build_Release.build_release(base_dir, rev = rev, afp_rev = afp_rev,
    2.42 +          parallel_jobs = parallel_jobs, remote_mac = remote_mac, website = Some(new_snapshot))
    2.43 +
    2.44 +        if (release_snapshot_dir.is_dir) File.move(release_snapshot_dir, old_snapshot)
    2.45 +        File.move(new_snapshot, release_snapshot_dir)
    2.46 +        Isabelle_System.rm_tree(old_snapshot)
    2.47 +      })
    2.48 +  }
    2.49 +
    2.50 +
    2.51 +  /* maintain build_log database */
    2.52 +
    2.53 +  def build_log_database(options: Options)
    2.54 +  {
    2.55 +    val store = Build_Log.store(options)
    2.56 +    using(store.open_database())(db =>
    2.57 +    {
    2.58 +      store.update_database(db, log_dirs, ml_statistics = true)
    2.59 +      store.snapshot_database(db, build_log_db)
    2.60 +    })
    2.61 +  }
    2.62 +
    2.63 +
    2.64 +  /* present build status */
    2.65 +
    2.66 +  def build_status(options: Options)
    2.67 +  {
    2.68 +    val data = Build_Status.read_data(options)
    2.69 +    Build_Status.present_data(data, target_dir = build_status_dir)
    2.70 +  }
    2.71 +}
     3.1 --- a/src/Pure/build-jars	Mon May 08 11:33:04 2017 +0200
     3.2 +++ b/src/Pure/build-jars	Mon May 08 12:04:58 2017 +0200
     3.3 @@ -22,6 +22,7 @@
     3.4    Admin/check_sources.scala
     3.5    Admin/ci_profile.scala
     3.6    Admin/isabelle_cronjob.scala
     3.7 +  Admin/isabelle_devel.scala
     3.8    Admin/jenkins.scala
     3.9    Admin/news.scala
    3.10    Admin/other_isabelle.scala