Skip to content

Commit

Permalink
Prevent completely empty files
Browse files Browse the repository at this point in the history
  • Loading branch information
wesselb committed Jan 13, 2025
1 parent 0ab6886 commit 6fe52d1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion aurora/foundry/common/channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,9 @@ def _mark(self, name: str) -> None:
with tempfile.TemporaryDirectory() as td:
mark_file_path = Path(td) / f"{name}.finished"
mark_file_path.parent.mkdir(exist_ok=True, parents=True)
mark_file_path.touch()
# Write a few bytes to the file. Blob storage has behaved weirdly for empty files.
with open(mark_file_path, "wb") as f:
f.write(b"File is available")
self._azcopy(["copy", str(mark_file_path), self._blob_path(f"{name}.finished")])

def _is_marked(self, name: str) -> bool:
Expand Down
2 changes: 1 addition & 1 deletion aurora/foundry/server/score.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def run(input_data: AMLRequest) -> dict:
logger.info("Initial condition was found. Submitting task.")
# Send an acknowledgement back to test that the host can write. The client will
# check for this acknowledgement.
channel.write(b"", task_id, "input.nc.ack")
channel.write(b"Acknowledgement of initial condition", task_id, "input.nc.ack")

# Queue the task.
task.task_info.submitted = True
Expand Down

0 comments on commit 6fe52d1

Please sign in to comment.