diff --git a/src/depiction_targeted_preproc/pipeline/run.py b/src/depiction_targeted_preproc/pipeline/run.py index f4eef12..0ced2bd 100644 --- a/src/depiction_targeted_preproc/pipeline/run.py +++ b/src/depiction_targeted_preproc/pipeline/run.py @@ -60,7 +60,7 @@ def run(workunit_id: int, work_dir: Path, ssh_user: str | None = None) -> None: ssh_user=ssh_user, ) zip_file_path = run_workflow(sample_dir=sample_dir) - store_outputs(client=client, zip_file_path=zip_file_path, workunit_id=workunit_id) + store_outputs(client=client, zip_file_path=zip_file_path, workunit_id=workunit_id, ssh_user=ssh_user) if __name__ == "__main__": diff --git a/src/depiction_targeted_preproc/pipeline/store_outputs.py b/src/depiction_targeted_preproc/pipeline/store_outputs.py index e9c4541..f8ebad8 100644 --- a/src/depiction_targeted_preproc/pipeline/store_outputs.py +++ b/src/depiction_targeted_preproc/pipeline/store_outputs.py @@ -5,6 +5,7 @@ import yaml from bfabric import Bfabric from bfabric.entities import Workunit +from bfabric.experimental.app_interface.output_registration import register_outputs def _get_outputs_spec(zip_file_path: Path, workunit: Workunit) -> dict[str, list[dict[str, str | int | bool]]]: @@ -21,13 +22,15 @@ def _get_outputs_spec(zip_file_path: Path, workunit: Workunit) -> dict[str, list } -def write_outputs_spec(zip_file_path: Path, workunit: Workunit) -> None: +def write_outputs_spec(zip_file_path: Path, workunit: Workunit) -> Path: output_spec = _get_outputs_spec(zip_file_path=zip_file_path, workunit=workunit) outputs_yaml = zip_file_path.parent / f"{zip_file_path.stem}_outputs_spec.yml" with outputs_yaml.open("w") as file: yaml.safe_dump(output_spec, file) + return outputs_yaml -def store_outputs(client: Bfabric, zip_file_path: Path, workunit_id: int): +def store_outputs(client: Bfabric, zip_file_path: Path, workunit_id: int, ssh_user: str | None): workunit = Workunit.find(id=workunit_id, client=client) - write_outputs_spec(zip_file_path=zip_file_path, workunit=workunit) + outputs_yaml = write_outputs_spec(zip_file_path=zip_file_path, workunit=workunit) + register_outputs(outputs_yaml=outputs_yaml, client=client, ssh_user=ssh_user)