-
Notifications
You must be signed in to change notification settings - Fork 2
/
install_rucio_client.sh
47 lines (39 loc) · 2.24 KB
/
install_rucio_client.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash -ex
#Rucio version to install, default is latest available in pypi.org
RUCIO_VERSION="latest"
#RUCIO_VERSION="1.23.11.post3" # 18DEC2020
#CVMFS repository name
CVMFS_REPO="cms.cern.ch"
#Use pre-install pip from CVMFS
ARCHITECTURE="slc7_amd64_gcc700"
CMS_PIP_VERSION="9.0.3-pafccj"
#Create a workspace area and download rucio install/setup scripts
WORKSPACE=/tmp/install-rucio
rm -rf $WORKSPACE && mkdir -p $WORKSPACE
cd $WORKSPACE
git clone --depth -1 https://github.com/cms-sw/cms-bot
#Start CVMFS transaction
cvmfs_server transaction
#[ -d /cvmfs/cms.cern.ch/rucio ] || mkdir -p /cvmfs/cms.cern.ch/rucio
#source PIP environment and install rucio-client. Make use of docker container if needed
DOCKER_TAG=cmssw/slc7-installer:latest
DOCKER_TAG=cmssw/cc7:amd64
#DOCKER_CMD="docker run --net=host --rm -t -v /tmp:/tmp -v /cvmfs:/cvmfs -v /home:/home -u $(whoami) cmssw/slc7-installer:latest"
DOCKER_CMD="docker run --net=host --rm -t -v /tmp:/tmp -v /cvmfs:/cvmfs -v /home:/home -u $(id -u):$(id -g) $DOCKER_TAG"
echo INFO Running $DOCKER_CMD sh -c "source /cvmfs/${CVMFS_REPO}/${ARCHITECTURE}/external/py2-pip/${CMS_PIP_VERSION}/etc/profile.d/init.sh ; ${WORKSPACE}/cms-bot/rucio/install.sh -c -v '${RUCIO_VERSION}' -i '/cvmfs/${CVMFS_REPO}/rucio' -C 'file://${WORKSPACE}/cms-bot/rucio/rucio.cfg'"
$DOCKER_CMD sh -c "source /cvmfs/${CVMFS_REPO}/${ARCHITECTURE}/external/py2-pip/${CMS_PIP_VERSION}/etc/profile.d/init.sh ; \
${WORKSPACE}/cms-bot/rucio/install.sh -c -v '${RUCIO_VERSION}' -i '/cvmfs/${CVMFS_REPO}/rucio' -C 'file://${WORKSPACE}/cms-bot/rucio/rucio.cfg'"
# 18DEC2020
#$DOCKER_CMD sh -c "source /cvmfs/${CVMFS_REPO}/${ARCHITECTURE}/external/py2-pip/${CMS_PIP_VERSION}/etc/profile.d/init.sh ; \
#export PATH=\$PATH:/cvmfs/cms.cern.ch/common ; \
# ${WORKSPACE}/cms-bot/rucio/install.sh -c -v '${RUCIO_VERSION}' -i '/cvmfs/${CVMFS_REPO}/rucio'" # -C 'file://${WORKSPACE}/cms-bot/rucio/rucio.cfg'"
if [ $? -eq 0 ] ; then
grep -q "Rucio_Client_0 $ARCHITECTURE" /cvmfs/$CVMFS_REPO/cvmfs-cms.cern.ch-updates || echo "Rucio_Client_0 $ARCHITECTURE" $(date +%s) $(date -u) >> /cvmfs/$CVMFS_REPO/cvmfs-cms.cern.ch-updates
#echo Success $0 Done
cvmfs_server publish
rm -rf $WORKSPACE
echo Success $0 Done
else
echo Fail $0
cvmfs_server abort -f
fi