Commit 73c41b7f authored by Andrea Sciaba's avatar Andrea Sciaba
Browse files

First version

parent 64b9da30
#!/bin/bash
#
# Script to update the SAM installation with the latest CMS tests from CVS
#
SAME_DIR=$1
TEMPDIR=/tmp
export CVSROOT=:pserver:anonymous@cmscvs.cern.ch:/cvs_server/repositories/CMSSW
cd $TEMPDIR
rm -rf CMSSAM
cvs co CMSSAM > /dev/null
res=$?
if [ $res != 0 ] ; then
echo "CVS checkout failed"
exit 1
fi
CMS_DIR=$TEMPDIR/CMSSAM/SiteTests
# testjob sensor
sensor='testjob'
modules='FroNtier MonteCarlo testjob'
for i in $modules ; do
cd $CMS_DIR/$i
for j in `find . -not -regex '.*\(CVS\).*'` ; do
if [ -d $j ] ; then
mkdir -p $SAME_DIR/client/sensors/$sensor/$j
else
cp $j $SAME_DIR/client/sensors/$sensor/`dirname $j`
fi
done
done
#!/usr/bin/perl
#
# Script to modify the SAM configuration to use the list of CMS sites taken from the WWW
#
# Usage: ./makesitelist.pl template sam_conf
#
$template = $ARGV[0];
$confile = $ARGV[1];
@sites = (
'https://twiki.cern.ch/twiki/pub/CMS/SitesList/CMS-T1.txt',
'https://twiki.cern.ch/twiki/pub/CMS/SitesList/CMS-T2.txt',
'https://twiki.cern.ch/twiki/pub/CMS/SitesList/CMS-T2-candidates.txt',
'https://twiki.cern.ch/twiki/pub/CMS/SitesList/CMS-T3.txt',
'https://twiki.cern.ch/twiki/pub/CMS/SitesList/CMS-opportunistic.txt'
);
#$sites = 'https://twiki.cern.ch/twiki/pub/CMS/SitesList/CMS-T1.txt https://twiki.cern.ch/twiki/pub/CMS/SitesList/CMS-T2.txt https://twiki.cern.ch/twiki/pub/CMS/SitesList/CMS-T2-candidates.txt https://twiki.cern.ch/twiki/pub/CMS/SitesList/CMS-T3.txt https://twiki.cern.ch/twiki/pub/CMS/SitesList/CMS-opportunistic.txt';
$sites = join ' ', @sites;
$ret = system("wget $sites -O /tmp/sitelist");
if ( $ret ) {
die "makesitelist.pl: error downloading site lists\n";
}
$conf = "sitename=";
open(FILE, "cat /tmp/sitelist | dos2unix |") or die "makesitelist.pl: cannot read temporary file\n";
while (<FILE>) {
chomp;
next if /^\#/;
next unless /\w+/;
$conf .= "$_,";
}
close FILE;
$conf =~ s/,$//;
open(TEMPLATE, "$template") or die "makesitelist.pl: Cannot open $template\n";
open(CONF, "> $confile") or die "makesitelist.pl: Cannot open $confile\n";
while (<TEMPLATE>) {
chomp;
if ( /^common_filter/ ) {
s/\"$//;
$_ .= " $conf\"";
}
print CONF "$_\n";
}
close TEMPLATE;
close CONF;
#!/bin/bash --login
# Define the location of the log file
log=$HOME/same-cron/same-cron-publish.log
# Define the Myproxy server to use
myproxy=myproxy-fts.cern.ch
# START of block to duplicate to add new SAM instances
#Define the location of SAM
SAME_DIR=$HOME/same
# Define which sensors to run and to publish
publish_sensors="CE gCE"
sensors="SE CE gCE"
echo "" >> $log
echo "" >> $log
echo -n "----------------------[ " >> $log
date >> $log
# Define the location of your certificate
export X509_USER_CERT=$HOME/.globus/usercert.pem
export X509_USER_KEY=$HOME/.globus/userkey.pem
# Choose an FQAN and a lifetime for the VOMS extensions
fqan='/cms/Role=lcgadmin'
lifetime='24:00'
echo "+++ Using the $fqan FQAN" >> $log
voms-proxy-init -valid $lifetime -voms cms:$fqan -pwstdin < $HOME/.grid-cert-passphrase >> $log 2>&1
for sensor in $publish_sensors ; do
echo "" >> $log
echo "----------" >> $log
echo "Publishing $sensor sensor: " >> $log
echo "" >> $log
$SAME_DIR/client/bin/same-exec --publish $sensor >> $log 2>&1
done
# end of block to duplicate to add new SAM instances
#!/bin/bash --login
# Define the location of the log file
log=$HOME/same-cron/same-cron.log
# Define the Myproxy server to use
myproxy=myproxy-fts.cern.ch
# START of block to duplicate to add new SAM instances
#Define the location of SAM
SAME_DIR=$HOME/same
# Define which sensors to run and to publish
publish_sensors="CE gCE"
sensors="SE CE gCE"
# Update CMS scripts from CVS (comment if you do not want automatic updates)
./cms2sam.sh $SAME_DIR >> $log 2>&1
# Update list of CMS sites to test (comment if you do not want automatic updates)
./makesitelist.pl $SAME_DIR/client/etc/same.conf.CMS $SAME_DIR/client/etc/same.conf
# Uncomment if you are running with the /cms/Role=production FQAN
#cp -f $SAME_DIR/client/sensors/testjob/test-sequence-prod.lst $SAME_DIR/client/sensors/testjob/test-sequence.lst
echo "" >> $log
echo "" >> $log
echo -n "----------------------[ " >> $log
date >> $log
# Define the location of your certificate
export X509_USER_CERT=$HOME/.globus/usercert.pem
export X509_USER_KEY=$HOME/.globus/userkey.pem
# Choose an FQAN and a lifetime for the VOMS extensions
fqan='/cms/Role=lcgadmin'
lifetime='24:00'
echo "+++ Using the $fqan FQAN" >> $log
voms-proxy-init -valid $lifetime -voms cms:$fqan -pwstdin < $HOME/.grid-cert-passphrase >> $log 2>&1
for sensor in $publish_sensors ; do
echo "" >> $log
echo "----------" >> $log
echo "Publishing $sensor sensor: " >> $log
echo "" >> $log
$SAME_DIR/client/bin/same-exec --publish $sensor >> $log 2>&1
done
for sensor in $sensors ; do
echo "" >> $log
echo "----------" >> $log
echo "Executing $sensor sensor: " >> $log
echo "" >> $log
$SAME_DIR/client/bin/same-exec $sensor >> $log 2>&1
done
# end of block to duplicate to add new SAM instances
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment