<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://t2bwiki.iihe.ac.be/index.php?action=history&amp;feed=atom&amp;title=CrabBabysitter</id>
	<title>CrabBabysitter - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://t2bwiki.iihe.ac.be/index.php?action=history&amp;feed=atom&amp;title=CrabBabysitter"/>
	<link rel="alternate" type="text/html" href="https://t2bwiki.iihe.ac.be/index.php?title=CrabBabysitter&amp;action=history"/>
	<updated>2026-04-20T11:14:15Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://t2bwiki.iihe.ac.be/index.php?title=CrabBabysitter&amp;diff=66&amp;oldid=prev</id>
		<title>Maintenance script: Created page with &quot; == Crab Babysitting tool wiki ==  PageOutline  === Description of the tool === The Crab Babysitting tool is a new tool built on top of the AutoMaticToptreeProduction...&quot;</title>
		<link rel="alternate" type="text/html" href="https://t2bwiki.iihe.ac.be/index.php?title=CrabBabysitter&amp;diff=66&amp;oldid=prev"/>
		<updated>2015-08-26T12:28:23Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot; == Crab Babysitting tool wiki ==  &lt;a href=&quot;/index.php?title=PageOutline&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;PageOutline (page does not exist)&quot;&gt;PageOutline&lt;/a&gt;  === Description of the tool === The Crab Babysitting tool is a new tool built on top of the AutoMaticToptreeProduction...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
== Crab Babysitting tool wiki ==&lt;br /&gt;
&lt;br /&gt;
[[PageOutline]]&lt;br /&gt;
&lt;br /&gt;
=== Description of the tool ===&lt;br /&gt;
The Crab Babysitting tool is a new tool built on top of the AutoMaticToptreeProduction CrabHandler class. The latter class takes care of the GRID related part in the TopTree Production and also the setting up of the crab config. Except for the creation of the crab config in CrabHandler, this class is generic and could be used for any GRID task using CRAB. This is why the Crab Babysitter was created. It uses all the generic functions of the CrabHandler e.g. create proxy/myproxy credentials, submit jobs, fetch jobs, resubmit crashed jobs, publish to DBS etc.... The only difference to the TopTree production mechanism is that it does not generate your crab.cfg neither any CMSSW setup. The aim is that you create your own CMSSW setup (if needed) and CRAB configuration and then pass it on to the CrabBabysitter tool to process it.&lt;br /&gt;
&lt;br /&gt;
=== What can I submit with this tool? ===&lt;br /&gt;
Anything from creating DQM files, simulation to analysis. Anything that uses CRAB:-)&lt;br /&gt;
=== How to use it ===&lt;br /&gt;
&lt;br /&gt;
First you should get the code in your directory on the m-machines (you should NOT put this inside any CMSSW area)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cvs co -d AutoMaticTopTreeProducer UserCode/mmaes/AutoMaticTopTreeProducer&lt;br /&gt;
cd AutoMaticTopTreeProducer&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now create a .config file to store your grid-pass. It will be used to generate credentials&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
touch .config&lt;br /&gt;
&lt;br /&gt;
chmod 600 .config // important&lt;br /&gt;
&lt;br /&gt;
open .config and add: GridPass mypass -&amp;gt; save&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then you should link your CMSSW area inside this folder for convenience. For example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ln -s /path/to/my/CMSSW/Project MyProject&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Use it to submit and handle jobs ====&lt;br /&gt;
In this running-mode, you use the script to submit jobs for a new task. Let&amp;#039;s assume you used &amp;quot;MyProject&amp;quot; as symlink-name in the previous command. Further let&amp;#039;s assume that the crab config you created is called crab.cfg.&lt;br /&gt;
**First: make shure you have sourced the CMSSW environment (e.g.: you should be able to run scram list CMSSW)&lt;br /&gt;
**Second: make shure you have sourced the relevant CRAB installation!&lt;br /&gt;
Now you are ready to run the script&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
python CrabBabysitter.py -h // if you want to see all options&lt;br /&gt;
&lt;br /&gt;
python CrabBabysitter.py -d MyProject/src/myfolder-where-crab.cfg-is &amp;amp; // change argument to your proper setup&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will find a log-file (timestamp.txt) under logs/ showing the progress of the task&lt;br /&gt;
&lt;br /&gt;
NOTE: If your crab config is not called crab.cfg you should provide --cfgname=filename as extra option!&lt;br /&gt;
&lt;br /&gt;
==== Use it to handle jobs from a previously submitted task ====&lt;br /&gt;
&lt;br /&gt;
If you have a crab task where you already sumitted your jobs, the babysitter can take over from you and handle the jobs. Again we assume you linked &amp;quot;MyProject&amp;quot; to your directory containing your crab working directory e.g. crab_0_110517_101636. If the jobs are already sumitted and you want to attach this task to the CrabBabysitter, you can do this the following way:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
python CrabBabysitter.py -d MyProject/src/myfolder-where-crab-working-dir-is --attach=crab_0_110517_101636 &amp;amp; // change both arguments to your proper setup&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You will find a log-file (timestamp.txt) under logs/ showing the progress of the task&lt;br /&gt;
&lt;br /&gt;
==== If you don&amp;#039;t want to use the symlinks ====&lt;br /&gt;
&lt;br /&gt;
That&amp;#039;s fine, there is no technical reason why to use them except for convenience.&lt;br /&gt;
If you did not symlink, your -d argument will look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
-d /path/to/my/CMSSW/Project/src/myfolder // no symlinks&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
rather than&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
-d MyProject/src/myfolder // symlink&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Blacklisting sites ====&lt;br /&gt;
There are two options to blacklist certain sites on-the-fly (meaning without having to change your crab.cfg)&lt;br /&gt;
&lt;br /&gt;
**Method 1 (task-per-task blacklist): in the crab working directory, e.g.: crab_0_110517_101636, place a file &amp;quot;.blacklist&amp;quot; containing one line with the following syntax: T2_ES_IFCA,T2_BE_UCL. This will blacklist any number of sites. Remove sites from the file (or remove the file) to undo the blacklist.&lt;br /&gt;
**Method 2 (all-task-blacklist): Instead of applying a blacklist for one babysit task (as method 1 did), we apply a blacklist for all tasks governed by the CrabBabysitter. To do this, you should add the following line to AutoMaticTopTreeProducer/.config&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GridBlacklist T2_RU_IHEP,T2_RU_SINP,T2_UK_London_Brunel,T2_FR_GRIF_LLR,T3_CO_Uniandes,T2_RU_RRC_KI&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{TracNotice|{{PAGENAME}}}}&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>