The TW creates some files that are then sent to the schedd.
The list of files is hard-coded in DagmanCreator: https://github.com/dmwm/CRABServer/blob/3.3.1510.rc9/src/python/TaskWorker/Actions/DagmanCreator.py#L861
This is because DagmanCreator is the only TaskAction that creates new files (e.g. a file specifying the DAG) that need to be sent to the schedd.
DagmanCreator also creates a temporary directory (https://github.com/dmwm/CRABServer/blob/3.3.1510.rc9/src/python/TaskWorker/Actions/DagmanCreator.py#L880-L884) where it saves these files (and where it copies the necessary CRAB3 code that need to be shipped to the schedd). Then it passes the name of this directory to DagmanSubmiter.
I was working on an issue for which I wanted to create another file to sent to the schedd. And this file had to be created at data discovery time, i.e. earlier than DagmanCreator. The problem I had was that the temporary directory where to save that new file was not available at this stage. So I thought on this solution:
1) Assume that in general any TaskAction (DataDiscovery, Splitter, DagmanCreator, DryRunUploader, DagmanSubmitter, etc) may be interested in creating a file that needs to be sent to the schedd.
2) Lets create then the temporary directory at the very beginning, in the constructor of the TaskHandler object. Add a switch to turn off the creation of this directory when the action to execute is RESUBMIT or KILL.
3) Pass the name of the temporary directory along the chain of TaskActions to execute.
4) I would like to add one thing: Have a list that is passed along the chain of TaskActions to execute, where each TaskAction appends the name of the file it has created and that should be sent to the schedd.
Introduction:
The TW creates some files that are then sent to the schedd. The list of files is hard-coded in DagmanCreator: https://github.com/dmwm/CRABServer/blob/3.3.1510.rc9/src/python/TaskWorker/Actions/DagmanCreator.py#L861 This is because DagmanCreator is the only TaskAction that creates new files (e.g. a file specifying the DAG) that need to be sent to the schedd. DagmanCreator also creates a temporary directory (https://github.com/dmwm/CRABServer/blob/3.3.1510.rc9/src/python/TaskWorker/Actions/DagmanCreator.py#L880-L884) where it saves these files (and where it copies the necessary CRAB3 code that need to be shipped to the schedd). Then it passes the name of this directory to DagmanSubmiter. I was working on an issue for which I wanted to create another file to sent to the schedd. And this file had to be created at data discovery time, i.e. earlier than DagmanCreator. The problem I had was that the temporary directory where to save that new file was not available at this stage. So I thought on this solution:
1) Assume that in general any TaskAction (DataDiscovery, Splitter, DagmanCreator, DryRunUploader, DagmanSubmitter, etc) may be interested in creating a file that needs to be sent to the schedd. 2) Lets create then the temporary directory at the very beginning, in the constructor of the TaskHandler object. Add a switch to turn off the creation of this directory when the action to execute is RESUBMIT or KILL. 3) Pass the name of the temporary directory along the chain of TaskActions to execute.
There is a pull request that implements the solution described in this issue: https://github.com/dmwm/CRABServer/pull/5046
4) I would like to add one thing: Have a list that is passed along the chain of TaskActions to execute, where each TaskAction appends the name of the file it has created and that should be sent to the schedd.