dmwm / CRABServer

16 stars 38 forks source link

change how user "debug" files in `debug_files.tar.gz` are handled #8719

Open belforte opened 1 month ago

belforte commented 1 month ago

currently we put in S3 cache debug_files.tar.gz which contains user's config and script exe to help operators debug problems and to create a new task to submit in crab recovery

But in order to make those files visible in the UI, we need an URL which points to the text version. We currently do this by placing files in WEB_DIR/debug and fetching via scheduler.

Also for historical reasons the TW sends to the scheduler both the tarball and the explicit files, which is a duplication of content.

Can we do something better, simpler and easier to document and understand ?

Since those files are small, the duplication in sending from TW to scheduler is not a big worry, but confusion and lack of documentation is bad.

belforte commented 1 month ago

move my thoughts here from https://github.com/dmwm/CRABServer/issues/8699#issuecomment-2376562701

about debug directory in tarball. the reason to expand debug_files.tar.gz in DagmanCreator is to make the files available to the CRABServerUI https://github.com/dmwm/CRABServer/blob/e8149dda5ff7a4fee80d3b25d5c038ead60c711d/src/python/TaskWorker/Actions/DagmanCreator.py#L1126 so that in the UI they can be fetched from the scheduler [1] OTOH this could be done in AdjustSites when WEB_DIR is prepared instead of both copying there debug_files.tar.gz and creating a symlink for debug/ directory https://github.com/dmwm/CRABServer/blob/e8149dda5ff7a4fee80d3b25d5c038ead60c711d/scripts/AdjustSites.py#L228-L233

And leave for a future optimization to simply put files in S3, like we do for twlog. w/o creating the debug_files.tar.gz. That will require changes to crab recovery and crab getsandbox too, besides of course task_info.js where files will be downloaded from S3, not the scheduler.

Having a tar saves on repeated calls to crabserver (to get preapproved url's) and S3 from the client. The idea was that when CRABClient is executed from sites with a large RTT, the fewer http calls, the better. Maybe do this in the TW ? DagmanCreator could upload the files to S3 instead of adding to InputFiles.tar.gz.

Maybe better to settle on the final solution, and do all changes in one go. Avoid putting code there "for a few months" which is hard to remove.

[1] https://github.com/dmwm/CRABServer/blob/e8149dda5ff7a4fee80d3b25d5c038ead60c711d/src/script/task_info.js#L231-L245