Isolate ENVI temp files from repo root
This commit is contained in:
@@ -55,6 +55,7 @@ backend/result_products/
|
|||||||
nginx/temp/
|
nginx/temp/
|
||||||
experiments/**/scratch/
|
experiments/**/scratch/
|
||||||
backend/quality_model.pkl
|
backend/quality_model.pkl
|
||||||
|
/_par_win_*.xls
|
||||||
|
|
||||||
# Large local datasets / installers
|
# Large local datasets / installers
|
||||||
Data/
|
Data/
|
||||||
|
|||||||
@@ -873,6 +873,12 @@ def _get_envi_progress_file(job_id: str) -> str:
|
|||||||
return os.path.join(runtime_dir, f"job_{job_id}_progress.json")
|
return os.path.join(runtime_dir, f"job_{job_id}_progress.json")
|
||||||
|
|
||||||
|
|
||||||
|
def _get_envi_runtime_cwd() -> str:
|
||||||
|
runtime_dir = os.path.normpath(os.path.abspath(settings.IDL_WORKER_RUNTIME_DIR))
|
||||||
|
os.makedirs(runtime_dir, exist_ok=True)
|
||||||
|
return runtime_dir
|
||||||
|
|
||||||
|
|
||||||
# Stale threshold: no progress file update AND no output file activity
|
# Stale threshold: no progress file update AND no output file activity
|
||||||
# for this many seconds -> consider the subprocess dead.
|
# for this many seconds -> consider the subprocess dead.
|
||||||
_ENVI_FILE_STALE_SECONDS = int(settings.ENVI_FILE_STALE_SECONDS)
|
_ENVI_FILE_STALE_SECONDS = int(settings.ENVI_FILE_STALE_SECONDS)
|
||||||
@@ -1057,7 +1063,7 @@ async def _run_envi_runner_command(
|
|||||||
runner_cmd,
|
runner_cmd,
|
||||||
stdout=stdout_fd,
|
stdout=stdout_fd,
|
||||||
stderr=stderr_fd,
|
stderr=stderr_fd,
|
||||||
cwd=type(settings).PROJECT_ROOT,
|
cwd=_get_envi_runtime_cwd(),
|
||||||
)
|
)
|
||||||
proc_state["pid"] = proc.pid
|
proc_state["pid"] = proc.pid
|
||||||
loop.call_soon_threadsafe(pid_ready.set)
|
loop.call_soon_threadsafe(pid_ready.set)
|
||||||
@@ -1296,7 +1302,7 @@ async def _run_envi_workflow_job(
|
|||||||
runner_cmd,
|
runner_cmd,
|
||||||
stdout=stdout_fd,
|
stdout=stdout_fd,
|
||||||
stderr=stderr_fd,
|
stderr=stderr_fd,
|
||||||
cwd=type(settings).PROJECT_ROOT,
|
cwd=_get_envi_runtime_cwd(),
|
||||||
)
|
)
|
||||||
# Close our copy of the fds; the child process has its own.
|
# Close our copy of the fds; the child process has its own.
|
||||||
os.close(stdout_fd)
|
os.close(stdout_fd)
|
||||||
|
|||||||
Reference in New Issue
Block a user