Spaces:
Sleeping
Sleeping
inoki-giskard
commited on
Commit
•
dcc9315
1
Parent(s):
45c5476
Link log file before actual running the task
Browse files- run_jobs.py +3 -2
run_jobs.py
CHANGED
@@ -158,8 +158,6 @@ def pop_job_from_pipe():
|
|
158 |
job_info = pipe.jobs.pop()
|
159 |
pipe.current = job_info[2]
|
160 |
task_id = job_info[0]
|
161 |
-
write_log_to_user_file(task_id, f"Running job id {task_id}\n")
|
162 |
-
command = prepare_env_and_get_command(*job_info[1])
|
163 |
|
164 |
# Link to LOG_FILE
|
165 |
log_file_path = Path(LOG_FILE)
|
@@ -167,6 +165,9 @@ def pop_job_from_pipe():
|
|
167 |
log_file_path.unlink()
|
168 |
os.symlink(f"./tmp/{task_id}.log", LOG_FILE)
|
169 |
|
|
|
|
|
|
|
170 |
with open(f"./tmp/{task_id}.log", "a") as log_file:
|
171 |
p = subprocess.Popen(command, stdout=log_file, stderr=subprocess.STDOUT)
|
172 |
p.wait()
|
|
|
158 |
job_info = pipe.jobs.pop()
|
159 |
pipe.current = job_info[2]
|
160 |
task_id = job_info[0]
|
|
|
|
|
161 |
|
162 |
# Link to LOG_FILE
|
163 |
log_file_path = Path(LOG_FILE)
|
|
|
165 |
log_file_path.unlink()
|
166 |
os.symlink(f"./tmp/{task_id}.log", LOG_FILE)
|
167 |
|
168 |
+
write_log_to_user_file(task_id, f"Running job id {task_id}\n")
|
169 |
+
command = prepare_env_and_get_command(*job_info[1])
|
170 |
+
|
171 |
with open(f"./tmp/{task_id}.log", "a") as log_file:
|
172 |
p = subprocess.Popen(command, stdout=log_file, stderr=subprocess.STDOUT)
|
173 |
p.wait()
|