From 08c2817d4e4b0ce4322205b1df9b4e81dd3d47be Mon Sep 17 00:00:00 2001 From: jean-roch Date: Thu, 18 Jun 2020 13:23:25 +0200 Subject: [PATCH 1/4] central set --- credentials.sh | 2 ++ postcycle-review-manual.sh | 3 --- postcycle-review-recovering.sh | 3 --- postcycle-strict.sh | 3 --- postcycle-update.sh | 3 --- 5 files changed, 2 insertions(+), 12 deletions(-) diff --git a/credentials.sh b/credentials.sh index a1ffe5290..d1ba9e0d8 100755 --- a/credentials.sh +++ b/credentials.sh @@ -25,3 +25,5 @@ else echo "using grid proxy" $X509_USER_PROXY fi +#talk to rucio +export RUCIO_HOME=~/.local/ diff --git a/postcycle-review-manual.sh b/postcycle-review-manual.sh index 9859a2b44..c924bac3b 100755 --- a/postcycle-review-manual.sh +++ b/postcycle-review-manual.sh @@ -1,9 +1,6 @@ BASE_DIR=/data/unified/WmAgentScripts/ HTML_DIR=/var/www/html/unified/ -## export RUCIO_HOME -export RUCIO_HOME=~/.local/ - lock_name=`echo $BASH_SOURCE | cut -f 1 -d "."`.lock source $BASE_DIR/cycle_common.sh $lock_name diff --git a/postcycle-review-recovering.sh b/postcycle-review-recovering.sh index 742cba725..53f2374a6 100755 --- a/postcycle-review-recovering.sh +++ b/postcycle-review-recovering.sh @@ -1,9 +1,6 @@ BASE_DIR=/data/unified/WmAgentScripts/ HTML_DIR=/var/www/html/unified/ -## export RUCIO_HOME -export RUCIO_HOME=~/.local/ - lock_name=`echo $BASH_SOURCE | cut -f 1 -d "."`.lock source $BASE_DIR/cycle_common.sh $lock_name diff --git a/postcycle-strict.sh b/postcycle-strict.sh index af88ddd02..57cd9f466 100755 --- a/postcycle-strict.sh +++ b/postcycle-strict.sh @@ -1,9 +1,6 @@ BASE_DIR=/data/unified/WmAgentScripts/ HTML_DIR=/var/www/html/unified/ -## export RUCIO_HOME -export RUCIO_HOME=~/.local/ - lock_name=`echo $BASH_SOURCE | cut -f 1 -d "."`.lock source $BASE_DIR/cycle_common.sh $lock_name diff --git a/postcycle-update.sh b/postcycle-update.sh index 80ae781ef..c3cc32d48 100755 --- a/postcycle-update.sh +++ b/postcycle-update.sh @@ -1,9 +1,6 @@ BASE_DIR=/data/unified/WmAgentScripts/ HTML_DIR=/var/www/html/unified/ -## export RUCIO_HOME -export RUCIO_HOME=~/.local/ - lock_name=`echo $BASH_SOURCE | cut -f 1 -d "."`.lock source $BASE_DIR/cycle_common.sh $lock_name From 932345a9a719aa421b358192ed8654b881818696 Mon Sep 17 00:00:00 2001 From: jean-roch Date: Thu, 18 Jun 2020 13:24:03 +0200 Subject: [PATCH 2/4] pick up user account --- RucioClient.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RucioClient.py b/RucioClient.py index 3f014a22a..e7c29a434 100755 --- a/RucioClient.py +++ b/RucioClient.py @@ -27,7 +27,7 @@ def __init__(self, **kwargs): 'auth_host': 'https://cms-rucio-auth.cern.ch', 'auth_type': 'x509_proxy', 'ca_cert': '/etc/grid-security/certificates/', - 'account': 'unified' + 'account': 'unified' if os.getenv('USER')=='cmsunified' else os.getenv('USER') } defaultConfig.update(kwargs) From 38397cb997f748d1cd29ccd9004275c7d9af0aea Mon Sep 17 00:00:00 2001 From: jean-roch Date: Thu, 18 Jun 2020 13:25:02 +0200 Subject: [PATCH 3/4] rucio config central, and away from afs home --- RucioClient.py | 3 +++ Unified/etc/rucio.cfg | 10 ++++++++++ 2 files changed, 13 insertions(+) create mode 100644 Unified/etc/rucio.cfg diff --git a/RucioClient.py b/RucioClient.py index e7c29a434..5bef4888f 100755 --- a/RucioClient.py +++ b/RucioClient.py @@ -9,8 +9,11 @@ ${RUCIO_HOME}/rucio.cfg """ +import os +if not os.getenv('RUCIO_HOME'): os.environ['RUCIO_HOME']='/data/unified/WmAgentScripts/Unified/' from rucio.client import Client + class RucioClient(Client): """ A wrapper class for the Rucio client. diff --git a/Unified/etc/rucio.cfg b/Unified/etc/rucio.cfg new file mode 100644 index 000000000..90f13ba4c --- /dev/null +++ b/Unified/etc/rucio.cfg @@ -0,0 +1,10 @@ +[common] +[client] +rucio_host = http://cms-rucio.cern.ch +auth_host = https://cms-rucio-auth.cern.ch +auth_type = x509 +ca_cert = /etc/grid-security/certificates/ +client_cert = $X509_USER_CERT +client_key = $X509_USER_KEY +client_x509_proxy = $X509_USER_PROXY +request_retries = 3 From ef79e74563d32eb15616fc437b8be445a5f58f66 Mon Sep 17 00:00:00 2001 From: jean-roch Date: Thu, 18 Jun 2020 13:35:21 +0200 Subject: [PATCH 4/4] not necessary thanks to 38397cb --- credentials.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/credentials.sh b/credentials.sh index d1ba9e0d8..faee73aa0 100755 --- a/credentials.sh +++ b/credentials.sh @@ -24,6 +24,3 @@ if [ "$1" == "create" ] ; then else echo "using grid proxy" $X509_USER_PROXY fi - -#talk to rucio -export RUCIO_HOME=~/.local/