@@ -879,8 +879,21 @@ def get_tar_command(dir='./', flags='cf', filename='checkpoint.tar'):
879879 tarcommand = get_tar_command (filename = fn )
880880 actionlogger .info ("Taring " + tarcommand )
881881
882+ # create a README file with instruction on how to use checkpoint
883+ readmefile = open ('README_CHECKPOINT_PID' + str (os .getpid ()) + '.txt' ,'w' )
884+
885+ for tid in taskids :
886+ taskspec = self .workflowspec ['stages' ][tid ]
887+ name = taskspec ['name' ]
888+ readmefile .write ('Checkpoint created because of failure in task ' + name + '\n ' )
889+ readmefile .write ('In order to reproduce with this checkpoint, do the following steps:\n ' )
890+ readmefile .write ('a) setup the appropriate O2sim environment using alienv\n ' )
891+ readmefile .write ('b) run: $O2DPG_ROOT/MC/bin/o2_dpg_workflow_runner.py -f workflow.json -tt ' + name + '$ --retry-on-failure 0\n ' )
892+ readmefile .close ()
893+
882894 # first of all the base directory
883895 os .system (tarcommand )
896+
884897 # then we add stuff for the specific timeframes ids if any
885898 for tid in taskids :
886899 taskspec = self .workflowspec ['stages' ][tid ]
@@ -890,6 +903,10 @@ def get_tar_command(dir='./', flags='cf', filename='checkpoint.tar'):
890903 actionlogger .info ("Tar command is " + tarcommand )
891904 os .system (tarcommand )
892905
906+ # prepend file:/// to denote local file
907+ fn = "file://" + fn
908+ actionlogger .info ("Local checkpoint file is " + fn )
909+
893910 # location needs to be an alien path of the form alien:///foo/bar/
894911 copycommand = 'alien.py cp ' + fn + ' ' + str (location ) + '@disk:1'
895912 actionlogger .info ("Copying to alien " + copycommand )
0 commit comments