示例#1
0
def init_run(path=None):
    if not path:
        run_id = runlib.mkid()
        path = os.path.join(var.runs_dir(), run_id)
    else:
        run_id = os.path.basename(path)
    return runlib.Run(run_id, path)
示例#2
0
def _init_step_run(parent_run):
    """Returns the run dir for a step run.

    Directory is based on a new, unique run ID but is not created.
    """
    runs_dir = os.path.dirname(parent_run.path)
    step_run_id = runlib.mkid()
    step_run_dir = os.path.join(runs_dir, step_run_id)
    return runlib.Run(step_run_id, step_run_dir)
示例#3
0
 def _init_remote_new_run_dir(self, opspec):
     run_id = runlib.mkid()
     run_dir = os.path.join(self.guild_home, "runs", run_id)
     cmd = ("set -e; "
            "mkdir -p {run_dir}/.guild; "
            "touch {run_dir}/.guild/PENDING; "
            "mkdir {run_dir}/.guild/attrs; "
            "echo 'pending:? ? ? {opspec}' > {run_dir}/.guild/opref; "
            "echo \"$(date +%s)000000\" > {run_dir}/.guild/attrs/started; "
            "mkdir {run_dir}/.guild/job-packages".format(run_dir=run_dir,
                                                         opspec=opspec))
     log.info("Initializing remote run")
     self._ssh_cmd(cmd)
     return run_dir
示例#4
0
 def _init_run_dir_apply(self, kw):
     run_id = runlib.mkid()
     run_dir = os.path.join(self.guild_home, "runs", run_id)
     kw["run_dir"] = run_dir
     return run_dir
示例#5
0
文件: ipy.py 项目: hkennyv/guildai
def _init_run():
    run_id = runlib.mkid()
    run_dir = os.path.join(var.runs_dir(), run_id)
    run = runlib.Run(run_id, run_dir)
    run.init_skel()
    return run
示例#6
0
 def __init__(self, batch, flags=None, run_id=None, attrs=None):
     self.batch = batch
     self.flags = flags
     self.run_id = run_id or runlib.mkid()
     self.attrs = attrs or {}