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
71 stars 42 forks source link

Bourreau can log job info in CSV file. #1246

Closed prioux closed 2 years ago

prioux commented 2 years ago

Optional feature: the admin can configure a Bourreau to log information about submitted jobs in an external CSV file.

MontrealSergiy commented 2 years ago

was not able to log any tasks stats, no log is created. (Running local bourreau)

prioux commented 2 years ago

Hi Sergiy. No wonder, I wasn't asking anyone to review this PR, so I have not provided any information about how to enable the feature. But since you want to try...

In the console, find your Bourreau then configure the path where you want to log things:

b=Bourreau.find(12345)
b.meta[:user_logfile_path] = '/some/path/user_submit.log'

Then restart your bourreau.

MontrealSergiy commented 2 years ago

well, I done almost what you asked

  RemoteResource Load (0.9ms)  SELECT  `remote_resources`.* FROM `remote_resources` ORDER BY `remote_resources`.`id` ASC LIMIT 1 OFFSET 1
  MetaDataStore Load (0.7ms)  SELECT `meta_data_store`.* FROM `meta_data_store` WHERE `meta_data_store`.`ar_id` = 2 AND `meta_data_store`.`ar_table_name` = 'remote_resources'
 => "/home/users/sboroday/logpath2" 
prioux commented 2 years ago

@MontrealSergiy Sure, that looks good. So did you get a log file ?

MontrealSergiy commented 2 years ago

yes, though not imeddiatly


"2022-06-30T16:59:19-04:00","admin","3322","BashScriptor","0","0","600"```
prioux commented 2 years ago

Yes, the log entries appear at the end of a task's lifecycle.

prioux commented 2 years ago

Thanks for looking at it.

MontrealSergiy commented 2 years ago

ok then