forked from M-Labs/artiq
1
0
Fork 0

Scheduler: replace relative path to absolute

Signed-off-by: Egor Savkin <es@m-labs.hk>
This commit is contained in:
Egor Savkin 2022-12-09 12:23:19 +08:00 committed by Sébastien Bourdeauducq
parent e80442811e
commit 2a58981822
1 changed files with 8 additions and 2 deletions

View File

@ -1,6 +1,7 @@
import asyncio import asyncio
import logging import logging
import csv import csv
import os.path
from enum import Enum from enum import Enum
from time import time from time import time
@ -131,7 +132,8 @@ class RunPool:
writer.writerow([rid, start_time, expid["file"]]) writer.writerow([rid, start_time, expid["file"]])
def submit(self, expid, priority, due_date, flush, pipeline_name): def submit(self, expid, priority, due_date, flush, pipeline_name):
# mutates expid to insert head repository revision if None. # mutates expid to insert head repository revision if None and
# replaces relative path with the absolute one.
# called through scheduler. # called through scheduler.
rid = self.ridc.get() rid = self.ridc.get()
if "repo_rev" in expid: if "repo_rev" in expid:
@ -141,6 +143,9 @@ class RunPool:
expid["repo_rev"]) expid["repo_rev"])
else: else:
wd, repo_msg = None, None wd, repo_msg = None, None
if "file" in expid:
expid["file"] = os.path.abspath(expid["file"])
run = Run(rid, pipeline_name, wd, expid, priority, due_date, flush, run = Run(rid, pipeline_name, wd, expid, priority, due_date, flush,
self, repo_msg=repo_msg) self, repo_msg=repo_msg)
if self.log_submissions is not None: if self.log_submissions is not None:
@ -425,7 +430,8 @@ class Scheduler:
When called through an experiment, the default values of When called through an experiment, the default values of
``pipeline_name``, ``expid`` and ``priority`` correspond to those of ``pipeline_name``, ``expid`` and ``priority`` correspond to those of
the current run.""" the current run."""
# mutates expid to insert head repository revision if None # mutates expid to insert head repository revision if None, and
# replaces relative file path with absolute one
if self._terminated: if self._terminated:
return return
try: try: