Project

General

Profile

samweb Usage examples


# get access to samweb, and tell it we are in minerva

source /grid/fermiapp/products/common/etc/setups.sh
setup sam_web_client
export SAM_EXPERIMENT=minerva

samweb list-files "run_number 798 and data_tier raw" 
MN_00000798_0005_numib_v04_0911090339_RawEvents.root
MN_00000798_0004_numib_v04_0911090239_RawEvents.root
MN_00000798_0007_numib_v04_0911090538_RawEvents.root
MN_00000798_0001_pdstl_v04_0911090019_RawEvents.root
MN_00000798_0003_numib_v04_0911090141_RawEvents.root
MN_00000798_0006_numib_v04_0911090439_RawEvents.root
MN_00000798_0002_numib_v04_0911090042_RawEvents.root

samweb locate-file MN_00000798_0002_numib_v04_0911090042_RawEvents.root
minerva_bluearc:/minerva/data/rawdata/downstream/raw/numib/00/00/07/98
enstore:/pnfs/minerva/rawdata/raw/numib/00/00/07/98(301@vp8131)

# get a cert, for write access to SAM

getcert
export X509_USER_PROXY=/tmp/x509up_u${UID}

samweb create-definition --group=minerva run_798_raw_samweb "run_number 798 and data_tier raw" 
Dataset definition 'run_798_raw_samweb' has been created with id 9681

samweb list-definition-files run_798_raw_samweb
MN_00000798_0001_pdstl_v04_0911090019_RawEvents.root
MN_00000798_0007_numib_v04_0911090538_RawEvents.root
MN_00000798_0005_numib_v04_0911090339_RawEvents.root
MN_00000798_0006_numib_v04_0911090439_RawEvents.root
MN_00000798_0002_numib_v04_0911090042_RawEvents.root
MN_00000798_0003_numib_v04_0911090141_RawEvents.root
MN_00000798_0004_numib_v04_0911090239_RawEvents.root

    RUNNING A PROJECT

ME=`id -u -n`
DSET=run_798_raw_samweb
PROJ=${ME}-testproject-`date +%Y-%m-%d_%H-%M-%S`

  START 
PURL=`samweb start-project --defname=${DSET} ${PROJ}`
echo PURL ${PURL}
PURL http://samweb.fnal.gov:8480/sam/minerva/api/projects/minerva/kreymer-testproject-2014-01-09_15-38-18

  START A CONSUMER
SOCK=`samweb start-process ${PURL} --appfamily=test --appname=test --appversion=1 --max-files=10`
echo SOCK ${SOCK}
SOCK 170904

  GET AND RELEASE SOME FILES

FILE=`samweb get-next-file ${PURL} ${SOCK}`
while [ -n "${FILE}" ] 
do
    echo FILE ${FILE}
    samweb release-file  ${PURL} ${SOCK} ${FILE}
    FILE=`samweb get-next-file ${PURL} ${SOCK}`
done
FILE gsiftp://fndca1.fnal.gov:2812/rawdata/raw/pdstl/00/00/07/98/MN_00000798_0001_pdstl_v04_0911090019_RawEvents.root
FILE gsiftp://fndca1.fnal.gov:2812/rawdata/raw/numib/00/00/07/98/MN_00000798_0004_numib_v04_0911090239_RawEvents.root
FILE gsiftp://fndca1.fnal.gov:2812/rawdata/raw/numib/00/00/07/98/MN_00000798_0006_numib_v04_0911090439_RawEvents.root
FILE gsiftp://fndca1.fnal.gov:2812/rawdata/raw/numib/00/00/07/98/MN_00000798_0003_numib_v04_0911090141_RawEvents.root
FILE gsiftp://fndca1.fnal.gov:2812/rawdata/raw/numib/00/00/07/98/MN_00000798_0005_numib_v04_0911090339_RawEvents.root
FILE gsiftp://fndca1.fnal.gov:2812/rawdata/raw/numib/00/00/07/98/MN_00000798_0002_numib_v04_0911090042_RawEvents.root
FILE gsiftp://fndca1.fnal.gov:2812/rawdata/raw/numib/00/00/07/98/MN_00000798_0007_numib_v04_0911090538_RawEvents.root

samweb stop-project  ${PROJ}