aces / cbrain

CBRAIN is a flexible Ruby on Rails framework for accessing and processing of large data on high-performance computing infrastructures.
GNU General Public License v3.0
70 stars 43 forks source link

Clean up task log entries by removing some configuration paths #1317

Open prioux opened 1 year ago

prioux commented 1 year ago

Whenever anything is logged in a task's log, we should remove the constant paths that match configuration settings, such as the gridshare path or the DP cache path.

So, a task log entry that now looks like:

[2023-03-27 18:42:27 EDT] make_cluster_workdir() Trying to create workdir '/scratch/prioux/BourreauBeluga/GridShare/224/06/57/blah-FMRIprepBidsSubject-T2240657'.

would instead be logged as:

[2023-03-27 18:42:27 EDT] make_cluster_workdir() Trying to create workdir '224/06/57/blah-FMRIprepBidsSubject-T2240657'.

Given the CbrainTask class already has an overriden version of hte method 'addlog', it should be an easy fix to zap these things before actually logging:

https://github.com/aces/cbrain/blob/431055c4a7fe97ecfdd9dfc1aed6c26bad44aa8f/BrainPortal/app/models/cbrain_task.rb#L816