forked from cta-observatory/CTADIRAC
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSingularity
More file actions
122 lines (103 loc) · 3.75 KB
/
Singularity
File metadata and controls
122 lines (103 loc) · 3.75 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
Bootstrap: docker
From: centos:7
%environment
source /opt/dirac/bashrc
source /opt/dirac/dirac_env.sh
%post
# CTADIRAC client location
export DIRAC_ROOT=/opt/dirac
# Retrieve the latest CTADIRAC release from defaults. Modified for dirac v7
PYTHON_VERSION=27
RELEASE=$(curl -s -L http://cta-dirac.in2p3.fr/DIRAC/defaults/cta.cfg | grep Release | tail -1 | awk -F "= " '{print $2}')
yum -y update
# General packages needed inside the container
yum -y install epel-release less strace wget git which emacs
# Packages DIRAC depends on
yum -y install boost-program-options boost-python boost-system boost-thread c-ares lfc-libs libtool-ltdl protobuf
# Install ntpdate to make sure clock is exact
# yum -y install ntpdate.x86_64
# Sync the clock
# ntpdate ntp.inria.fr
# Install CAs in the default location /etc/grid-security/certificates
cat <<EOF > /etc/yum.repos.d/ca-policy-egi.repo
[EGI-trustanchors]
name=EGI-trustanchors
baseurl=http://repository.egi.eu/sw/production/cas/1/current/
gpgkey=http://repository.egi.eu/sw/production/cas/1/GPG-KEY-EUGridPMA-RPM-3
gpgcheck=1
enabled=1
EOF
yum -y install ca-policy-egi-core
# Create base directory for CTADIRAC client installation
mkdir -p $DIRAC_ROOT
# Install lcg bundles
# mkdir -p $DIRAC_ROOT/.installCache
# cd $DIRAC_ROOT/.installCache
# wget http://diracproject.web.cern.ch/diracproject/tars/../lcgBundles/DIRAC-lcg-${LCGVER}-Linux_x86_64_glibc-2.17-python27.tar.gz
# Install CTADIRAC client
cd $DIRAC_ROOT
wget --no-check-certificate https://raw.githubusercontent.com/DIRACGrid/management/master/dirac-install.py
python dirac-install.py -V CTA -v
# Since there is no proxy available, manually configure the CTADIRAC client
cat <<EOF > $DIRAC_ROOT/etc/dirac.cfg
LocalInstallation
{
ConfigurationServer = dips://ccdcta-server04.in2p3.fr:9135/Configuration/Server
ConfigurationServer += dips://ccdcta-server05.in2p3.fr:9135/Configuration/Server
ConfigurationServer += dips://dcta-agents.pic.es:9135/Configuration/Server
ConfigurationServer += dips://dcta-servers.pic.es:9135/Configuration/Server
VirtualOrganization = vo.cta.in2p3.fr
Setup = CTA
PythonVersion = ${PYTHONVERSION}
Project = CTA
InstallType = client
Extensions = COMDIRAC
Extensions += CTA
SkipCAChecks = True
Release = ${RELEASE}
SkipCADownload = False
}
DIRAC
{
Configuration
{
Servers = dips://ccdcta-server04.in2p3.fr:9135/Configuration/Server
Servers += dips://ccdcta-server05.in2p3.fr:9135/Configuration/Server
Servers += dips://dcta-agents.pic.es:9135/Configuration/Server
Servers += dips://dcta-servers.pic.es:9135/Configuration/Server
}
Setup = CTA
VirtualOrganization = vo.cta.in2p3.fr
Extensions = COMDIRAC
Extensions += CTA
Security
{
# This option is specific to the usage in singularity container
CALocation = /tmp/etc/grid-security/certificates
UseServerCertificate = no
SkipCAChecks = yes
}
}
EOF
mkdir -p $DIRAC_ROOT/etc/grid-security/vomses
cat <<EOF > $DIRAC_ROOT/etc/grid-security/vomses/vo.cta.in2p3.fr
"vo.cta.in2p3.fr" "cclcgvomsli01.in2p3.fr" "15008" "/O=GRID-FR/C=FR/O=CNRS/OU=CC-IN2P3/CN=cclcgvomsli01.in2p3.fr" "vo.cta.in2p3.fr" "24"
EOF
mkdir -p $DIRAC_ROOT/etc/grid-security/vomsdir/vo.cta.in2p3.fr
cat <<EOF > $DIRAC_ROOT/etc/grid-security/vomsdir/vo.cta.in2p3.fr/cclcgvomsli01.in2p3.fr.lsc
/O=GRID-FR/C=FR/O=CNRS/OU=CC-IN2P3/CN=cclcgvomsli01.in2p3.fr
/C=FR/O=MENESR/OU=GRID-FR/CN=AC GRID-FR Services
EOF
# Create the dirac env script to customize the CAs location
cat <<EOF > /opt/dirac/dirac_env.sh
#!/bin/bash
# Copy CAs in a writable location shared with the host
if ! [ -d "/tmp/etc/grid-security/certificates" ]
then
mkdir -p /tmp/etc/grid-security
cp -R /etc/grid-security/certificates /tmp/etc/grid-security
fi
# Add 2 variables
export COLUMNS=155
export TERM=xterm-256color
EOF