Thanks for the information.  I am going to CC this to the software list.

I just had a long talk with two of the experts here on the SRS data catalog.  It is being used for three experiments, which are EXO, Fermi telecope and the (upcoming) LSST.  I think we should try and make it work rather than rolling our own, and they are more than willing to work with us on this and support its use.  It will be getting some major feature additions too such as a REST web interface, that are planned to occur before we start running, so this should benefit us.

Accessing the SRS data catalog does require an external connection.  If outbound SSH is allowed from the counting house (which I assume it is), then we can use Homer's strategy of connecting to SLAC via a password-less account and executing a script located here to make an entry for a file along with its metadata.  This could be done at any point in the data processing or reconstruction chain, provided the SSH key for accessing SLAC is available to the script running this update process.  It would be best to make a new shared account at SLAC for this purpose rather than use someone's user account.

The other strategy, which I think would work for the reconstruction (but not the live data taking?), is having a periodic cron job that updates the data catalog based on looking at a directory where the files are stored at JLab.  It would have a timestamp file that it touched.  Files that are newer than the timestamp would be processed and input into the data catalog.  If the job failed, then the timestamp wouldn't be updated.  Tony indicated that updating the same exact "logical file name" in the catalog simply overwrites it with the new information, so there is no need to worry about duplication.

I'm not sure that run quality is a built-in concept of the catalog but it can be handled through meta data tags.  You should talk to Matt about this.  He has all kinds of ideas about it.

So breaking down your workflow (which is very useful information), I would do the following if we were to use the SRS catalog:

1.1 When the files go from RAID to tape, trigger a script using password-less SSH login to make an entry in the data catalog for each file.  (Not sure what would trigger this though.  How do we insert a hook when this happens?)

2.1 For the recon, execute a cron script that looks for new files in the output directory where the recon files go and updates the data catalog accordingly.  This could run every 10-15 minutes.  (If they are only staged to disk for a short time and then written to tape, this might not work.)

2.2 My first suggestion is saving the log files from the batch job and pulling out the required meta data such as number of events processed from there.  Then update the catalog similar to 2.1, e.g. asynchronously via a cron job.

3.1 Do this like 2.2.

For replication to SLAC, I'd trigger the update via a cron job that used rsync to see what files needed to be copied to SLAC and made entries for the new files in the catalog as they were copied over.

I do see some problems here having to do with...

A) Usage of tape storage, in which case using an rsync or an asynchronous process might not be able to catch the data on disk before it was written to tape.  In this case, you would need to fire off a script that did it.  I don't actually know much about tape storage.  If a simple 'ls' command returns reasonable results, then having a cron job handle this might work fine provided the directory locations are known.

B) External access via the batch system, if you want to update a data catalog within the actual batch job itself.  I assume the batch system does NOT have internet access to outside sites, in which case that is problemmatical to try and update the file catalog from within your batch script.  I think you may not want to do this anyways.

I'm not sure about running the actual app at JLab.  Unfortunately, it uses an Oracle database here at SLAC.  Not sure there's one of those just lying around for us to use at JLab and probably setting it up there is more trouble than it is worth.  Since both EXO and Fermi have gotten this working remotely, I think it should definitely be possible for us, too.  We should give it a try.



-----Original Message-----
From: Maurik Holtrop [mailto:[log in to unmask]] 
Sent: Friday, April 04, 2014 5:13 PM
To: McCormick, Jeremy I.
Subject: Re: software schedule

Hi Jeremy,

I think that the system that Homer showed is fine for the job. I just think that we have to run this at JLab, perhaps with some integration glue with the Silo tape storage system.

Let me run through what I think the data catalog needs to do.

1.	A run is finished in the counting house. It will produce something like 60 to 100 files, with some naming convention that includes the run number and a sequence number. These file are automatically copied from the counting house RAID to the Silo cache storage and spun to tape.

	1.	At this point, I would like these files to be added to the data catalog, including date and time, and some of the run information from the DAQ, like the number of events, the DAQ settings and the user comment.

2.	The data is next processed by reconstruction scripts. These scripts will process the 100 files for the run.

	1.	 For each file processed the number of events in the original raw data file is added to the catalog.
	2.	When a processing job is done, it will write to the catalog the number of events it processed (should be the same as 1, unless there was a file read error), and the number of events it wrote out.

3.	Some post processing jobs are run on each of the files from step 2. These jobs do some simple quality checking, i.e. number of events with identified e- and e+, number of events that pass certain cuts. Determine the amount of noise, the quality of the tracks.

	1.	Quality of the data is determined from step 3 in some quantitative manner and added to the catalog.

We would then want to be able to query the data catalog for correlated information from the data quality check, such as "how many e+ e- pairs were there for all the run files", and then plot this quantity versus the time of the run. 

If the SLAC data catalog cannot do things like store the data quality information per run file, it would not be all that difficult (but time consuming) to do this in a MySQL database. (That is what I did way back when I was still smart.)


On Apr 4, 2014, at 7:43 PM, McCormick, Jeremy I. <[log in to unmask]> wrote:

	I'm going to talk to Tony about the SRS data catalog access from JLAB.  Let you know what I find out...
	-----Original Message-----
	From: Maurik Holtrop [mailto:[log in to unmask]] 
	Sent: Friday, April 04, 2014 4:24 PM
	To: McCormick, Jeremy I.
	Subject: Re: software schedule
	I think what is missing for the SLAC database is that it would be impossible, or nearly so, to update it with the run data as it is produced, and the same issue would exist for any scripts that run the batch jobs. We'd be much better of having a data catalog that runs at Jlab. 
	A very, very, long time ago when I did a lot of processing of data at Jlab I had setup a simply MySQL database that I filled from the scripts. Nothing fancy, but it did keep track of the jobs for me. I am also surprised that there isn't any effort to make a data catalog system. I asked around a little and no one seemed to know. I'll ask a bit more.
	We could possibly just install the SLAC system at Jlab? Then at least it can be used there.
	- Maurik 

Use REPLY-ALL to reply to list

To unsubscribe from the HPS-SOFTWARE list, click the following link: