Exemplo n.º 1
0
 def start(self):
     if self._started:
         raise RuntimeError("already started")
     self.log_dir = util.mktempdir("guild-tensorboard-")
     self._monitor = util.RunsMonitor(self._list_runs, self.log_dir,
                                      TB_RUNS_MONITOR_INTERVAL)
     self._monitor.start()
     self._app = self._tb.create_app(self.log_dir,
                                     TB_REFRESH_INTERVAL,
                                     path_prefix=self._path_prefix())
     self._started = True
Exemplo n.º 2
0
 def start(self):
     if self._started:
         raise RuntimeError("already started")
     self.log_dir = util.mktempdir("guild-tensorboard-")
     self._monitor = self._tb_mod.RunsMonitor(self.log_dir, self._list_runs,
                                              TB_RUNS_MONITOR_INTERVAL)
     self._monitor.run_once(exit_on_error=True)
     self._monitor.start()
     self._app = self._tb_mod.create_app(
         self.log_dir,
         TB_REFRESH_INTERVAL,
         path_prefix=self._path_prefix(),
         disabled_plugins=TB_DISABLED_PLUGINS,
     )
     self._started = True
Exemplo n.º 3
0
def _export_runs_to_zip(runs, filename, move, copy_resources, quiet):
    import zipfile

    tmp_dir = util.mktempdir("guild-export-")
    tmp_zip = os.path.join(tmp_dir, "export.zip")
    log.debug("writing zip %s", tmp_zip)
    exported = []
    with zipfile.ZipFile(tmp_zip, "w", allowZip64=True) as zf:
        existing = set()
        if os.path.exists(filename):
            try:
                _write_zip_files(filename, zf, existing)
            except zipfile.BadZipfile as e:
                raise RunsExportError("cannot write to %s: %s" % (filename, e))
        _copy_runs_to_zip(runs, move, copy_resources, zf, existing, quiet,
                          exported)
    log.debug("replacing %s with %s", filename, tmp_zip)
    shutil.move(tmp_zip, filename)
    if move:
        _delete_exported_runs(exported)
    return exported