mirror of
https://github.com/clearml/clearml-session
synced 2025-05-05 04:24:30 +00:00
Make sure we call sync workspace on shutdown command for better visibility
This commit is contained in:
parent
a37bfe364c
commit
a180cf7ff8
@ -1533,6 +1533,7 @@ class SyncCallback:
|
||||
"#!/bin/bash",
|
||||
"[ \"$UID\" -ne 0 ] && echo \"shutdown: Permission denied. Try as root.\" && exit 1",
|
||||
"[ ! -f /run/clearml ] && echo \"shutdown: failed.\" && exit 2",
|
||||
"[ ! -z $(command -v {}) ] && echo \"Syncing workspace\" && {}".format(self.cmd_file, self.cmd_file),
|
||||
"kill -9 $(cat /run/clearml 2>/dev/null) && echo \"system is now spinning down - "
|
||||
"it might take a minute if we need to upload the workspace:\""
|
||||
" && for ((i=180; i>=0; i--)); do echo -n \" .\"; sleep 1; done",
|
||||
@ -1725,8 +1726,8 @@ def main():
|
||||
workspace_dir=param.get("store_workspace")
|
||||
)
|
||||
syncer.init()
|
||||
|
||||
# notice this will end when process is done
|
||||
print('Wait until shutdown')
|
||||
syncer.wait_on_process(run_background_sync_thread=True, call_sync_callback_on_return=True)
|
||||
|
||||
print('We are done')
|
||||
|
Loading…
Reference in New Issue
Block a user