Example of storing a file on enstore via cdf-sam from anywhere at fnal.

You need a principal that is in sam's .k5login on fcdfdata016.
But notice that is only needed to cpy the file on fcdfdata016 local disk, not to execute sam commands.


  1. Start from a random node on fnal's LAN, and a local disk
    belforte@nts01/...samtest > uname -n
    nts01.fnal.gov
    belforte@nts01/...samtest > pwd
    /data/nts01/c/scratch/belforte/samtest
    belforte@nts01/...samtest > df -h .
    Filesystem            Size  Used Avail Use% Mounted on
    /dev/hdc1             110G   24G   80G  23% /data/nts01/c
    belforte@nts01/...samtest > 
    
  2. Make sure you have k5 ticket and sam setup
    belforte@nts01/...samtest > klist
    Ticket cache: /tmp/krb5cc_p1533
    Default principal: belforte@FNAL.GOV
    
    Valid starting     Expires            Service principal
    04/20/04 03:32:01  04/21/04 05:26:03  krbtgt/FNAL.GOV@FNAL.GOV
            renew until 04/27/04 03:26:03
    belforte@nts01/...samtest > source ~cdfsoft/cdf2.cshrc 
    belforte@nts01/...samtest > setup sam
    belforte@nts01/...samtest > 
    
  3. Have a file and a metadata
    belforte@nts01/...samtest > ls -l
    total 312
    -rw-r-----    1 belforte cdf        307446 Apr 20 03:35 sb_storetest_19.root
    -rw-r-----    1 belforte cdf           761 Apr 20 03:35 temporary-metadata.py
    belforte@nts01/...samtest > 
    
    belforte@nts01/...samtest > cat temporary-metadata.py 
    from import_classes import *
    
    appfamily=AppFamily('generator', '1.00', 'generator')
    filename='sb_storetest_19.root'
    t = SAMMCFile(filename,Events(1, 1, 1),
    "generated",
    appfamily,
    "03/04/2004 02:30:54",
    "03/04/2004 02:30:54",
    1,
    {
    'Global':
    { 'ProducedByName':'sam',
      'OriginName':'pccdf2.ts.infn.it',
      'Phase':'unspecified',
      'FacilityName':'users data',
      'ProducedForName':'sam',
      'RunType':'Monte Carlo',
      'GroupName':'cdf',
      'Stream':'m', 
      'Description':'test of user stored file',
    },
    'CDF':
    { 'DataSet':'belforte-test-003',
    
      'html':'http://cdfdb.fnal.gov/sam/',
    },
    'Generated' :{
    'AppFamily':'generator',
    'FirstEvent':'1',
    'AppVersion':'1.00',
    'LastEvent':'2',
    'NumRecords':'2',
    'AppName':'generator',
    'TotalEvents':'2',
    'RunNumber':54321,}
    }
    )
    belforte@nts01/...samtest > 
    
  4. Copy the file to cdf-sam scratch disk
    belforte@nts01/...samtest > rcp sb_storetest_19.root sam@fcdfdata016:/data1/temp
    
  5. Verify
    belforte@nts01/...samtest > rsh -l sam fcdfdata016 ls -l /data1/temp/sb'*'
    This rsh session is using DES encryption for all data transmissions.
    -rw-r-----    1 sam      sam        307446 Apr 20 03:37 /data1/temp/sb_storetest_19.root
    belforte@nts01/...samtest > 
    
  6. Issue sam store command
    belforte@nts01/...samtest > setenv SAM_HOST_NAME fcdfdata016.fnal.gov
    
    belforte@nts01/...samtest > sam store --descrip=temporary-metadata.py --source=/data1/temp --dest=/pnfs/cdfen/filesets/SM/SMTest --station=cdf-sam
    >>>>>> Loading user description of file(s) from temporary-metadata.py
    >>>>>> Destination for sb_storetest_19.root is /pnfs/cdfen/filesets/SM/SMTest
    >>>>>> Validating metadata for sb_storetest_19.root 
    Warning,local file stat on /data1/temp/sb_storetest_19.root has failed, assuming remote location
    >>>>>> Submitting sb_storetest_19.root to FSS at station cdf-sam
    >>>>>> Submitted all requests, now waiting for callbacks
    
    ... takes a long time here... enstore mounting tape ?
    ... after ~30min
    
    File store complete.
    1
    belforte@nts01/...samtest > 
    
  7. Verify
    belforte@nts01/~ > sam locate sb_storetest_19.root
    ['/pnfs/cdfen/filesets/SM/SMTest,ia2542']
    belforte@nts01/~ > rsh -l sam fcdfdata016 ls -l /pnfs/cdfen/filesets/SM/SMTest/sb_storetest_19.root
    This rsh session is using DES encryption for all data transmissions.
    -rw-r--r--    1 sam      sam        307446 Apr 20 04:03 /pnfs/cdfen/filesets/SM/SMTest/sb_storetest_19.root
    
  8. Clean Up
    belforte@nts01/~ > rsh -l sam fcdfdata016 rm /data1/temp/sb_storetest_19.root
    This rsh session is using DES encryption for all data transmissions.
    belforte@nts01/~ > rsh -l sam fcdfdata016 ls /data1/temp/sb_storetest_19.root
    This rsh session is using DES encryption for all data transmissions.
    ls: /data1/temp/sb_storetest_19.root: No such file or directory
    belforte@nts01/~ > 
    
  9. The end.