diff --git a/server/runner.py b/server/runner.py index 267fe3a..27f3b94 100644 --- a/server/runner.py +++ b/server/runner.py @@ -341,11 +341,25 @@ class Runner: p = Path(out["path"]) if not p.is_absolute(): p = outdir / p + if not p.exists(): + # a remote worker writes result.json with paths on ITS disk + # (/data/remote//out/...); after collect() those + # files sit in the local outdir — remap by the out/-relative + # tail, falling back to the basename + marker = f"/data/remote/{job_id}/out/" + _, _, tail = str(out["path"]).partition(marker) + if tail and (outdir / tail).exists(): + p = outdir / tail + else: + p = outdir / Path(out["path"]).name if p.exists(): a = store.register_file(con, p, name=out.get("name"), parent_job=job_id, move=True, meta=out.get("meta"), user_id=owner_id) registered.append(a["id"]) + else: + print(f"[runner] {job_id}: result.json output not found after " + f"collect, skipped: {out.get('path')}", flush=True) else: for p in sorted(outdir.iterdir()): if p.name == "result.json" or p.name.startswith("."):