From 1c39ac8fb4237ab03319ccab3fa4fa21a47bddd5 Mon Sep 17 00:00:00 2001 From: Egor Savkin Date: Fri, 9 Dec 2022 12:23:19 +0800 Subject: [PATCH] Scheduler: replace relative path to absolute Signed-off-by: Egor Savkin --- artiq/master/scheduler.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/artiq/master/scheduler.py b/artiq/master/scheduler.py index eea832a17..6d53ae97e 100644 --- a/artiq/master/scheduler.py +++ b/artiq/master/scheduler.py @@ -1,6 +1,7 @@ import asyncio import logging import csv +import os.path from enum import Enum from time import time @@ -131,7 +132,8 @@ class RunPool: writer.writerow([rid, start_time, expid["file"]]) 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. rid = self.ridc.get() if "repo_rev" in expid: @@ -141,6 +143,9 @@ class RunPool: expid["repo_rev"]) else: 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, self, repo_msg=repo_msg) if self.log_submissions is not None: @@ -425,7 +430,8 @@ class Scheduler: When called through an experiment, the default values of ``pipeline_name``, ``expid`` and ``priority`` correspond to those of 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: return try: