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, Mac or Linux. The code is based on IPython and provides access to find your favorite data, to copy desired LFNs from/to storage elements and local disk, manage your CMS releases, etc. Since it is based on python you can extended as you wish, e.g. you can write your own code, use matplotlib, etc. A brief introduction of cmssh capabilities are outlined in this talk.
Prerequisites
- cmssh relies on usage of your GRID certificate. Please ensure that it is located in usual $HOME/.globus area, e.g. you should have there your private key (userkey.pem) and public certificate (usercert.pem).
- cmssh supports access to RunSummary data-service located at P5. The access to this service requires CERN SSO authentication. In order to gain the access 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 installer script and run it as
python cmssh_install.py --help
python cmssh_install.py --install --dir=$PWD
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-user
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=160915
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
lumi dataset=/Photon/Run2012A-29Jun2012-v1/AOD
lumi block=/Photon/Run2012A-29Jun2012-v1/AOD#3e33ce8e-c44d-11e1-9a26-003048f0e1c6
lumi file=/store/data/Run2012A/Photon/AOD/29Jun2012-v1/0000/001B241C-ADC3-E111-BD1D-001E673971CA.root
lumi run=190704
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 file status in background (data queue)
dqueue
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_Z
cmsrel CMSSW_X_Y_Z
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.