Skip to content

Commit

Permalink
Merge pull request #159 from kellyaa/main
Browse files Browse the repository at this point in the history
add .complete file to output dir when done
  • Loading branch information
anhuong authored May 16, 2024
2 parents eba20f3 + 756faf1 commit d515f78
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions build/launch_training.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"""

# Standard
from pathlib import Path
import os
import tempfile
import shutil
Expand Down Expand Up @@ -187,6 +188,9 @@ def main():
)
if os.path.exists(train_logs_filepath):
shutil.copy(train_logs_filepath, original_output_dir)
# The .complete file will signal to users that we are finished copying
# files over
Path(os.path.join(original_output_dir, ".complete")).touch()
except Exception as e: # pylint: disable=broad-except
logging.error(traceback.format_exc())
write_termination_log(
Expand Down
1 change: 1 addition & 0 deletions tests/build/test_launch_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ def test_successful_pt():

assert main() == 0
assert os.path.exists(tempdir + "/termination-log") is False
assert os.path.exists(os.path.join(tempdir, ".complete")) is True


def test_bad_script_path():
Expand Down

0 comments on commit d515f78

Please sign in to comment.