bootstrapCTA.sh 1.67 KB
Newer Older
1
#!/bin/bash -e
2
3
4

set -x

5
echo Preparing CTA sources...
6
7
8
cd ~/CTA
git submodule update --init --recursive

9
10
11
12
13
14
15
16
cat > ~/CTA/.git/hooks/post-checkout << EOFGitHook
#!/bin/sh
cd `git rev-parse --show-toplevel`
git submodule update --init --recursive
EOFGitHook

chmod +x ~/CTA/.git/hooks/post-checkout
cp ~/CTA/.git/hooks/post-checkout ~/CTA/.git/hooks/post-merge
17

18
echo Creating source rpm
19
rm -rf ~/CTA-build-srpm
20
21
22
23
mkdir -p ~/CTA-build-srpm
(cd ~/CTA-build-srpm && cmake -DPackageOnly:Bool=true ../CTA; make cta_srpm)

echo Installing repos
24
for r in `ls -1 ~/CTA/continuousintegration/docker/ctafrontend/cc7/etc/yum.repos.d/*.repo` ; do
Eric Cano's avatar
Eric Cano committed
25
26
  sudo yum-config-manager --add-repo=$r
done
27
28
sudo yum install -y yum-plugin-priorities

29
30
31
32
33
34
35
sudo wget https://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol7 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
sudo tee /etc/yum.repos.d/oracle-instant-client.repo > /dev/null << 'EOF'
[oracle-instant-client]
name=Oracle instant client
baseurl=https://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
Volodymyr Yurchenko's avatar
Volodymyr Yurchenko committed
36
enabled=1
37
38
EOF

39
echo Adding versionlock for xrootd:
40
sudo cp ~/CTA/continuousintegration/docker/ctafrontend/cc7/etc/yum/pluginconf.d/versionlock.list /etc/yum/pluginconf.d/versionlock.list
41

42
echo Installing build dependencies
Volodymyr Yurchenko's avatar
Volodymyr Yurchenko committed
43
sudo yum-builddep -y ~/CTA-build-srpm/RPM/SRPMS/cta-0-1.src.rpm
44

45
46
47
echo Installing mhvtl
sudo yum install -y mhvtl-utils kmod-mhvtl mhvtl-utils --enablerepo=castor

48
49
50
51
echo Building CTA
mkdir -p ~/CTA-build
(cd ~/CTA-build && cmake ../CTA; make -j 4)

52
53
54
55
echo Tuning the system for EOS
sudo bash -c "echo net.ipv4.tcp_tw_reuse = 1 >> /etc/sysctl.d/00-eos.conf"
sudo sysctl -p

56
echo CTA setup finished successfully