Skip to content

Commit

Permalink
make the two implementations analogous to each other
Browse files Browse the repository at this point in the history
  • Loading branch information
leoschwarz committed Sep 23, 2024
1 parent d2196cb commit b33d0e1
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
import cyclopts
import yaml

from bfabric import Bfabric
from bfabric.experimental.app_interface.workunit.definition import WorkunitDefinition

app = cyclopts.App()


Expand All @@ -11,11 +14,14 @@ def collect_chunk(workunit_ref: int | Path, chunk_dir: Path) -> None:
chunk_dir = chunk_dir.absolute()
zip_file_path = chunk_dir / f"{chunk_dir.name}.zip"

workunit_definition = WorkunitDefinition.from_ref(workunit_ref, client=Bfabric.from_config())
workunit_id = workunit_definition.registration.workunit_id

outputs = [
{
"type": "bfabric_copy_resource",
"local_path": str(zip_file_path.absolute()),
"store_entry_path": zip_file_path.name,
"store_entry_path": f"WU{workunit_id}_result_{chunk_dir.name}.zip",
}
]
result = {"outputs": outputs}
Expand Down

0 comments on commit b33d0e1

Please sign in to comment.