Welcome to cmssh project.
The cmssh (CMS shell) is a part of CMS software initiative to simplify your daily activity in CMS environment. It as combination of data discovery, file mover and release management tools in one user-friendly shell which runs on your favorite OS, e.g. Mac or Linux. The code is based on IPython project and provides access to find your favorite data, copies LFNs from/to storage elements and local disk and manages your CMS releases, etc. Python code base allows you to extend it in any direction and use any 3-d party python libraries. A brief introduction of cmssh capabilities is outlined in cmssh tutorial.
Prerequisites
- cmssh relies on usage of your GRID certificate. Please ensure that it is located in $HOME/.globus area, e.g. you should have there your private key (userkey.pem) and public certificate (usercert.pem).
- cmssh supports access to CMS RunSummary data-service. The access to this service requires CERN SSO authentication. To make it work please check that your user certificate is mapped at https://ca.cern.ch/ca/Certificates/MapCertificate.aspx
- If you intend to install cmssh on Mac OS X (Snow Leopard/Lion/Mountain Lion) please ensure that you have Xcode installed on your Mac. It can be found from AppleStore or here is direct link. Mountain Lion users please install command line tools and Java.
Installation
To install cmssh please download installer script and run it aspython cmssh_install.py --helpIt will print out all options you can use during install procedure. Most of the time you'll run it as simple as
python cmssh_install.py --install --dir=$PWDPlease note that python should be version 2.6 or above (but not python 3 yet) and you'll need to have your JAVA_HOME environment set, since cmssh uses GRID middleware based on java. But don't worry the install script will prompt you about that.
Installtion within CMSSW environment
If you want to install cmssh on a system with already existing CMSSW environment please use the following command:python ./cmssh_install.py -i -d YOUR_INSTALL_AREA -v 1 \ --cmssw=YOUR_CMSSW_AREA --arch=YOUR_FAVORITE_ARCHITECTURE --multi-userPlease note that if you have multiple architectures in your CMSSW area you may specify any architecture you like. It will be used to build cmssh dependencies, but cmssh will be able to use CMSSW release from different architectures.
Usage
The usage of cmssh is very simple, in fact it is very similar to your normal shell. Here is a few basic commands you may find interesting:
search for some data
find dataset=*CRUZET3*RAW for r in results(): print r, type(r)
ls/find/info command
ls /Cosmics/CRUZET3-v1/RAW info /Cosmics/CRUZET3-v1/RAW find file dataset=/Cosmics/CRUZET3-v1/RAW find site dataset=/Cosmics/CRUZET3-v1/RAW find run=160915 info run=160915
Every time you run a command in cmssh there is results() helper function which captures its output. It allows you to re-iterate over last command output. For example, if you run
find run=160915you can iterate over results again by using
for r in results(): # do something useful with r, e.g. print r.initLumi, type(r.initLumi), r.DeliveredLumi, type(r.DeliveredLumi)
find lumi information
find lumi dataset=/Photon/Run2012A-29Jun2012-v1/AOD find lumi block=/Photon/Run2012A-29Jun2012-v1/AOD#3e33ce8e-c44d-11e1-9a26-003048f0e1c6 find lumi file=/store/data/Run2012A/Photon/AOD/29Jun2012-v1/0000/001B241C-ADC3-E111-BD1D-001E673971CA.root find lumi run=190704 find lumi {190704:[1,2,3,4], 201706:[1,2,3,67]}
list/copy LFN to local disk
ls /store/data/CRUZET3/Cosmics/RAW/path/file.root cp /store/data/CRUZET3/Cosmics/RAW/path/file.root .
SE operations, e.g. list its content, create/delete directory, etc.
du T3_US_Cornell ls T3_US_Cornell ls T3_US_Cornell:/store/user/me mkdir T3_US_Cornell:/store/user/me/foo rmdir T3_US_Cornell:/store/user/me/foo
copy local file to SE
cp file.root T3_US_Cornell:/store/user/me
copy LFN from SE to local disk
cp T3_US_Cornell:/store/user/me/file.root .
delete file on SE
rm T3_US_Cornell:/xrootdfs/cms/store/user/me/file.root
copy LFN to SE area
cp /store/data/CRUZET3/Cosmics/RAW/path/file.root T3_US_Cornell:/store/user/me
copy multiple files in background
cp /store/data/CRUZET3/Cosmics/RAW/path/file1.root . & cp /store/data/CRUZET3/Cosmics/RAW/path/file2.root . &
look-up job's transfer
jobs list
jobs command
# look-up job information jobs jobs list jobs site=T2_US_UCSD jobs dashboard # find user information find user=oliver jobs user=AikenOliver
look-up available releases
releases
install your favorite release
If you install cmssh on your system withon --cmssw option, you'll be able to manually install CMSSW releases by using the following commandinstall CMSSW_X_Y_ZOnce CMSSW release is installed in your shell, you can simply invoke your favorite release as simple as
cmsrel CMSSW_X_Y_ZThis command will setup release area and you'll be ready to use it.
run cms job
Once CMSSW release is available in your shell (cmsrel CMSSW_X_Y_Z), you can run your cms run job as followingcmsRun runevt_cfg.py
Help and Support
You can find cmssh help by typing cmshelp in your shell. For more information please contact the author. For bugs please use GitHub tracking system.