-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add t0 function to modify agent code file (#4964)
* Add t0 function to modify agent code file * Add help message * Add help message for t0 command * Add help message for t0 command * Adding tweak config files to allow t0 --clear-deployment * t0 command finalized --------- Co-authored-by: Toine <Antonio Linares>
- Loading branch information
1 parent
464c387
commit b9bbe2d
Showing
6 changed files
with
172 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/bin/bash | ||
|
||
CONFIGURATION_FILE=/data/tier0/admin/ProdOfflineConfiguration.py | ||
sed -i 's+TIER0_CONFIG_FILE+'"$CONFIGURATION_FILE"'+' "$config/config.py" | ||
sed -i "s+config.Agent.teamName = 'REPLACE_TEAM_NAME'+config.Agent.teamName = '"$TEAMNAME"'+" "$config/config.py" | ||
sed -i "s+config.Agent.contact = '[email protected]'+config.Agent.contact = '[email protected]'+" "$config/config.py" | ||
sed -i "s+'team1,team2,cmsdataops'+'tier0production'+g" "$config/config.py" | ||
sed -i "s+config.RucioInjector.containerDiskRuleParams.*+config.RucioInjector.containerDiskRuleParams = {}+" "$config/config.py" | ||
echo "config.RucioInjector.blockRuleParams = {}" >> $config/config.py | ||
sed -i "s+config.RucioInjector.metaDIDProject.*+config.RucioInjector.metaDIDProject = 'Tier0'+" "$config/config.py" | ||
echo "config.RucioInjector.blockDeletionDelayHours = 168" >> $config/config.py | ||
##### NOT IN REPLAY ##### | ||
echo "config.RucioInjector.blockDeletionDelayHours = 168" >> $config/config.py | ||
echo 'config.BossAir.pluginNames = ["SimpleCondorPlugin"]' >> $config/config.py | ||
echo 'config.JobAccountant.maxAllowedRepackOutputSize = 24 * 1024 * 1024 * 1024' >> $config/config.py | ||
echo "config.AgentStatusWatcher.runningExpressPercent = 25" >> $config/config.py | ||
echo "config.AgentStatusWatcher.runningRepackPercent = 10" >> $config/config.py | ||
echo 'config.TaskArchiver.archiveDelayHours = 2190' >> $config.py | ||
##### NOT IN REPLAY ##### | ||
echo "config.DBS3Upload.datasetType = 'VALID'" >> $config/config.py | ||
echo "config.Tier0Feeder.serviceProxy = '$WMA_DEPLOY_DIR/certs/myproxy.pem'" >> $config/config.py | ||
echo 'config.TaskArchiver.dashBoardUrl = "http://dashb-luminosity.cern.ch/dashboard/request.py/putluminositydata"' >> $config/config.py | ||
sed -i "s+config.DBS3Upload.uploaderName = 'WMAgent'+config.DBS3Upload.uploaderName = 'T0Prod'+g" "$config/config.py" | ||
sed -i "s/config.ErrorHandler.maxFailTime.*/config.ErrorHandler.maxFailTime=601200/g" "$config/config.py" | ||
|
||
# Enable AgentStatusWatcher - site status automatic updated | ||
sed -i "s+config.AgentStatusWatcher.ignoreDisks.*+config.AgentStatusWatcher.ignoreDisks = [ '/cvmfs/cvmfs-config.cern.ch', '/cvmfs/cms.cern.ch', '/eos/cms', '/cvmfs/cms-ib.cern.ch', '/cvmfs/patatrack.cern.ch' ]+" "$config/config.py" | ||
|
||
|
||
# password for dropbox upload | ||
DROPBOX_USER=`cat $WMA_SECRETS_FILE | grep DROPBOX_USER | sed s/DROPBOX_USER=//` | ||
DROPBOX_PASS=`cat $WMA_SECRETS_FILE | grep DROPBOX_PASS | sed s/DROPBOX_PASS=//` | ||
|
||
if [ "x$DROPBOX_USER" == "x" ] || [ "x$DROPBOX_PASS" == "x" ]; then | ||
echo "Secrets file doesn't contain DROPBOX_USER or DROPBOX_PASS"; | ||
exit 1 | ||
fi | ||
|
||
echo 'config.Tier0Feeder.dropboxuser = "'$DROPBOX_USER'"' >> $config/config.py | ||
echo 'config.Tier0Feeder.dropboxpass = "'$DROPBOX_PASS'"' >> $config/config.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/bin/bash | ||
|
||
CONFIGURATION_FILE=/data/tier0/admin/ReplayOfflineConfiguration.py | ||
sed -i 's+TIER0_CONFIG_FILE+'"$CONFIGURATION_FILE"'+' "$config/config.py" | ||
sed -i "s+config.Agent.teamName = 'REPLACE_TEAM_NAME'+config.Agent.teamName = '"$TEAMNAME"'+" "$config/config.py" | ||
sed -i "s+config.Agent.contact = '[email protected]'+config.Agent.contact = '[email protected]'+" "$config/config.py" | ||
sed -i "s+'team1,team2,cmsdataops'+'tier0replay'+g" "$config/config.py" | ||
sed -i "s+config.RucioInjector.containerDiskRuleParams.*+config.RucioInjector.containerDiskRuleParams = {'lifetime': 7 * 24 * 60 * 60}+" "$config/config.py" | ||
echo "config.RucioInjector.blockRuleParams = {'lifetime': 7 * 24 * 60 * 60}" >> "$config/config.py" | ||
sed -i "s+config.RucioInjector.metaDIDProject.*+config.RucioInjector.metaDIDProject = 'Test'+" "$config/config.py" | ||
echo "config.RucioInjector.blockDeletionDelayHours = 2" >> $config/config.py | ||
echo "config.DBS3Upload.datasetType = 'VALID'" >> $config/config.py | ||
echo "config.Tier0Feeder.serviceProxy = '$WMA_DEPLOY_DIR/certs/myproxy.pem'" >> $config/config.py | ||
echo 'config.TaskArchiver.dashBoardUrl = "http://dashb-luminosity.cern.ch/dashboard/request.py/putluminositydata"' >> $config/config.py | ||
sed -i "s+config.DBS3Upload.uploaderName = 'WMAgent'+config.DBS3Upload.uploaderName = 'T0Replay'+g" "$config/config.py" | ||
#Overwrite ErrorHandler to avoid jobs going to ensure T0 jobs can always be retried | ||
sed -i "s/config.ErrorHandler.maxFailTime.*/config.ErrorHandler.maxFailTime=601200/g" "$config/config.py" | ||
sed -i "s+config.RucioInjector.listTiersToInject.*+config.RucioInjector.listTiersToInject = ['AOD', 'MINIAOD', 'NANOAOD', 'NANOAODSIM', 'RAW', 'FEVT', 'USER', 'ALCARECO', 'ALCAPROMPT','DQMIO','RAW-RECO']+" "$config/config.py" | ||
|
||
##### ONLY IN REPLAY ##### | ||
sed -i "s/config.RetryManager.plugins.*/config.RetryManager.plugins={'default': 'PauseAlgo', 'Cleanup': 'PauseAlgo', 'LogCollect': 'PauseAlgo'}/g" "$config/config.py" | ||
sed -i "s/config.ErrorHandler.maxRetries.*/config.ErrorHandler.maxRetries={'default': 30, 'Cleanup': 30, 'LogCollect': 30}/g" "$config/config.py" | ||
##### ONLY IN REPLAY ##### | ||
|
||
# Enable AgentStatusWatcher - site status automatic updated | ||
sed -i "s+config.AgentStatusWatcher.ignoreDisks.*+config.AgentStatusWatcher.ignoreDisks = [ '/cvmfs/cvmfs-config.cern.ch', '/cvmfs/cms.cern.ch', '/eos/cms', '/cvmfs/cms-ib.cern.ch', '/cvmfs/patatrack.cern.ch' ]+" "$config/config.py" | ||
|
||
# password for dropbox upload | ||
|
||
DROPBOX_USER=`cat $WMA_SECRETS_FILE | grep DROPBOX_USER | sed s/DROPBOX_USER=//` | ||
DROPBOX_PASS=`cat $WMA_SECRETS_FILE | grep DROPBOX_PASS | sed s/DROPBOX_PASS=//` | ||
|
||
if [ "x$DROPBOX_USER" == "x" ] || [ "x$DROPBOX_PASS" == "x" ]; then | ||
echo "Secrets file doesn't contain DROPBOX_USER or DROPBOX_PASS"; | ||
exit 1 | ||
fi | ||
|
||
echo 'config.Tier0Feeder.dropboxuser = "'$DROPBOX_USER'"' >> $config/config.py | ||
echo 'config.Tier0Feeder.dropboxpass = "'$DROPBOX_PASS'"' >> $config/config.py | ||
|
||
##### ONLY IN PROD ##### | ||
#echo "config.RucioInjector.blockDeletionDelayHours = 168" >> ./config/tier0/config.py | ||
#echo 'config.BossAir.pluginNames = ["SimpleCondorPlugin"]' >> ./config/tier0/config.py | ||
#echo 'config.JobAccountant.maxAllowedRepackOutputSize = 24 * 1024 * 1024 * 1024' >> ./config/tier0/config.py | ||
#echo "config.AgentStatusWatcher.runningExpressPercent = 25" >> ./config/tier0/config.py | ||
#echo "config.AgentStatusWatcher.runningRepackPercent = 10" >> ./config/tier0/config.py | ||
#echo 'config.TaskArchiver.archiveDelayHours = 2190' >> $config.py | ||
##### ONLY IN PROD ##### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters