#
# INSTALL PROCEDURE:
#
# 1. CODE AND ENV
# follow instructions at
# 
# https://cms-http-group.web.cern.ch/cms-http-group/tutorials/environ/vm-setup.html
# BUT:
# - use HG1410d
# - copy host*.pem from /etc/grid/security/cert.. to /data/certs
#   and change ownership from root (until Diego fixes it) 
# - in step 7 use -p "admin frontend crabserver crabcache"

# 2. DATABASE
# see https://twiki.cern.ch/twiki/bin/view/CMSPublic/CMSCrabRESTInterface#How_to_create_the_database_for_y
#
# to setup REST environment e.g. to do work on OracleDB or test stuff
# use this instead of the line in the twiki (different path):
source /data/srv/HG1410d/sw.pre/slc6_amd64_gcc481/cms/crabserver/3.3.10.rc5/etc/profile.d/init.sh
# to find WMCore/bin needed for the DB schema creation as indicated in the twiki
# need to pull it from github
git clone git@github.com:dmwm/WMCore.git

# the dbconfig.py is
cat dbconfig.py
from WMCore.Configuration import Configuration
config = Configuration()
config.section_('CoreDatabase')
config.CoreDatabase.connectUrl = 'oracle://crab3_belforte:Crab3-SB@devdb11'

# then
export PYTHONPATH=.:$PYTHONPATH
WMCore/bin/wmcore-db-init --config dbconfig.py --create --modules=Databases.TaskDB,Databases.FileMetaDataDB

# now configuration file
# cat CRABServerAuth.py 
import cx_Oracle as DB
import socket
fqdn = socket.getfqdn().lower()
dbconfig = { "dev":  { "*":   { "user": "crab3_belforte", "dsn" : "devdb11", "password" : "Crab3-SB", "timeout" : 300, "type" : DB, "trace" : True, "schema" : "crab3_belforte", 'clientid': "sitedb-web@%s" % fqdn, 'liveness': "select sysdate from dual"  },  '.title' : 'Title..', '.order' : 'What s this' } }

# put it in the right place
sudo cp CRABServerAuth.py  srv/current/auth/crabserver/CRABServerAuth.py 

# restart all services and this will install DB

#
# 3. REST (aka CRABSERVER)
#
# create a new crabserver REST configuration
# to be put in
/data/srv/current/config/crabserver/config.py
# the version I use now is at
https://gist.github.com/belforte/1edbcb0d552136144bf6

# in that /data/srv/current/config/crabserver/config.py the important line
# is the extconfigurl, which is a configuration fragment which will be
# updated every 30min pulling from the indicated URL, so there is a
# file to put in some web reacheable place like GIST
# so starting from  http://git.cern.ch/pubweb/?p=CAFServicesConfig.git;a=blob_plain;f=cmsweb-rest-config.json
# and changing as needed. 
# I changed the used schedd and the list of hosts who can delegate
# my file is now:
https://gist.github.com/belforte/e9755ebe206bf59d071a
# and the URL for the text version is
# https://gist.githubusercontent.com/belforte/e9755ebe206bf59d071/raw
# see  http://stackoverflow.com/a/21984072


#
# 4. Task Worker
# 
# mix of instructions
# started with these from Marco
#
/afs/cern.ch/user/b/belforte/public/ISTRUZ/CRAB3-TW/
# copied and edited as needed in
/afs/cern.ch/user/b/belforte/WORK/CRAB3/TaskWorker
# and complemented/overridded when needed with

https://twiki.cern.ch/twiki/bin/viewauth/CMS/TWDeploymentNotes

# trickiest part is proxy/certs
# I am trying to follow the twiki on that
# copy my personal proxy to /data/certs/service*.pem
#  this needs to be re-done weekly at least :-(
# copy /etc/grid-security/host*.pme to /data/certs/
# for MyProxy (see bottom of twiki above)
#
# those pem's in /data/certs need to have as owner the user
# who runs TaskWorker, i.e. belforte:zh since I start/stop
# interactively
#

#
# finally add this TaskWorker host machine to the
# schedd whitelist (the schedd is listed in the REST config)
# 



#
# in order to use custom version of the code

Go to these websites and fork
https://github.com/dmwm/CRABServer
https://github.com/dmwm/CRABClient
https://github.com/dmwm/WMCore

# then clone the copy in belforte and add dmwm as remote "upstream"
#
git clone git@github.com:belforte/CRABClient.git
git clone git@github.com:belforte/CRABServer.git
git clone git@github.com:belforte/WMCore.git
cd CRABServer/
git remote add upstream git@github.com:dmwm/CRABServer.git
cd ../CRABClient/
git remote add upstream git@github.com:dmwm/CRABClient.git
cd ../WMCore/
git remote add upstream git@github.com:dmwm/WMCore.git




#Edit file /data/srv/HG1408a/sw.pre/slc5_amd64_gcc461/cms/crabserver/3.3.7.rc6/etc/profile.d/init.sh
#and comment out last two lines. In the end add this :
#export PYTHONPATH=/data/user/CRABServer/src/python/:/data/user/WMCore/src/python/:$PYTHONPATH

#
# in my case I modify
/data/srv/current/sw.pre/slc6_amd64_gcc481/cms/crabserver/3.3.10.rc5/etc/profile.d/init.sh

# and added
#
export PYTHONPATH=/afs/cern.ch/user/b/belforte/WORK/CRAB3/CRABServer/src/python/:/afs/cern.ch/user/b/belforte/WORK/CRAB3/WMCore/src/python/:$PYTHONPATH

#
# do the same for TaskWorker
#
cd /data/srv/TaskWorker/slc6_amd64_gcc481/cms/crabtaskworker/3.3.10.rc5/etc/profile.d
cp init.sh init.sh.ORIG
cat >> init.sh
export PYTHONPATH=/afs/cern.ch/user/b/belforte/WORK/CRAB3/CRABServer/src/python/:/afs/cern.ch/user/b/belforte/WORK/CRAB3/WMCore/src/python/:$PYTHONPATH
Ctl-D

# finally edit and comment old lines as above











# then every time
source /afs/cern.ch/user/b/belforte/WORK/CRAB3/SetupTaskWorker/env.sh
. /afs/cern.ch/user/b/belforte/WORK/CRAB3/SetupTaskWorker/start.sh

# to stop it
pkill -f TaskWorker




#
# USEFUL STUFF
#
# admin commands
pushd /data; /data/cfg/admin/InstallDev -d /data/srv/ -s status; popd
# this also does restart in case
pushd /data; /data/cfg/admin/InstallDev -d /data/srv/ -s start; popd


# UPDATE 2015
# https://hypernews.cern.ch/HyperNews/CMS/get/computing-tools/498/1/1/1/1/1.html
# i.e.
#
about the documentation, here it is the main link with all the twikis
we have: https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideCrab#CRAB3_Documentation

In particular for the Client, the Server frontend (aka REST
interface), the Server backend (aka TaskWorker) you can have a look
at:

- https://twiki.cern.ch/twiki/bin/view/CMSPublic/CMSCrabClient
- https://twiki.cern.ch/twiki/bin/view/CMSPublic/CMSCrabRESTInterface
- https://twiki.cern.ch/twiki/bin/view/CMSPublic/CMSCrabTaskWorker

At a quick glance they seem up to date (maybe the server backend one
require some updates). We also have some instructions on how to run
some other part of the code (jobwrapper and postjob) here:

 https://twiki.cern.ch/twiki/bin/view/CMSPublic/Crab3OperatorDebugging#Development_Oriented_Tricks_I_di

-- StefanoBelforte - 2015-05-07

Edit | Attach | Watch | Print version | History: r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r1 - 2015-05-07 - StefanoBelforte
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Sandbox All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback