-
Notifications
You must be signed in to change notification settings - Fork 4
/
openstack_setup_cmssw.sh
140 lines (96 loc) · 7.28 KB
/
openstack_setup_cmssw.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
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
#!/bin/bash
# Script used in https://openstack.cern.ch/ to setup a machine based on Alma8 to use CMSSW
printf "\033c" #clear screen
printf "TEST SILVIO" #clear screen
mkdir ~/testSilvio
yum -y install git puppet-agent locmap-release locmap rpm-build voms-clients-java krb5-devel perl python3-devel rpm-build pip git make cmake gcc-c++ gcc binutils libX11-devel libXpm-devel libXft-devel libXext-devel python39 openssl-devel perl screen wget x2goserver xterm mesa-libGLU mesa-libGLU-devel ant javaws pciutils nano vim wget
### yum install xfdesktop
locmap --enable all
locmap --list
locmap --configure all
echo "export CMS_LOCAL_SITE=T2_CH_CERN" > /etc/cvmfs/config.d/cms.cern.ch.local
echo "CVMFS_HTTP_PROXY='http://cmsmeyproxy.cern.ch:3128;http://ca-proxy.cern.ch:3128'" >> /etc/cvmfs/config.d/cms.cern.ch.local
cvmfs_config reload
#locmap --enable all
#locmap --configure all
printf "DONE" #clear screen
exit 0
### Login as user (!!!), copy missing files
sudo scp -r [email protected]:/etc/grid-security /etc/grid-security
sudo scp -r [email protected]:/etc/vomses /etc/vomses
sudo scp -r [email protected]:/etc/grid-security/certificates/* /etc/grid-security/certificates
ln -s /afs/cern.ch/user/s/sdonato afs
ln -s /afs/cern.ch/user/s/sdonato/.globus .
pip install omsapi --index-url https://gitlab.cern.ch/api/v4/projects/45046/packages/pypi/simple
voms-proxy-init --voms cms
### Test CMSSW
source /cvmfs/cms.cern.ch/cmsset_default.sh
cmsrel CMSSW_13_0_0_pre4
cd CMSSW_13_0_0_pre4
cmsenv
voms-proxy-init
runTheMatrix.py --show | grep HLTPhysics202
runTheMatrix.py -l 141.111 --ibeos
### PROXY all
ssh -f -N -D 12345 lxtunnel.cern.ch
export ALL_PROXY=socks5://localhost:12345
pip install oauth2client gspread --proxy socks5://localhost:12345
#OR
#use_proxy=yes
#http_proxy=localhost:12345
#https_proxy=localhost:12345
# test
wget https://ubuntu.mirror.garr.it/releases/24.04/ubuntu-24.04-desktop-amd64.iso
# kinit
python3 /afs/cern.ch/user/s/sdonato/SilvioCronJob2/renewticket.py
#### To make a new disk partition
###### Remember to attach Volume to Instance from OpenStack! ################
###### CREATE PARTITION ################
```
[root@sdonato-openstack /]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vda 252:0 0 40G 0 disk
|-vda1 252:1 0 39.5G 0 part /
|-vda14 252:14 0 4M 0 part
`-vda15 252:15 0 545M 0 part /boot/efi
vdb 252:16 0 240G 0 disk
`-vdb1 252:17 0 240G 0 part
```
```
fdisk /dev/vdb
Welcome to fdisk (util-linux 2.32.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
The old ext4 signature will be removed by a write command.
Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0x4b129eef.
Command (m for help): F
Unpartitioned space /dev/vdb: 240 GiB, 257696989184 bytes, 503314432 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
Start End Sectors Size
2048 503316479 503314432 240G
Command (m for help): n
Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1):
First sector (2048-503316479, default 2048):
Last sector, +sectors or +size{K,M,G,T,P} (2048-503316479, default 503316479):
Created a new partition 1 of type 'Linux' and of size 240 GiB.
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
```
### CREAT FILESYSTEM (XFS or EXT4)
mkfs.xfs -K /dev/vdb1
### MOUNT
mkdir /scratch
mount /dev/vdb1 /scratch/
############# Install CUDA Drivers ##################################
wget https://developer.download.nvidia.com/compute/cuda/12.6.0/local_installers/cuda_12.6.0_560.28.03_linux.run ## (see https://developer.nvidia.com/cuda-downloads for the latest version )
## Disable Nouveau: follow https://docs.nvidia.com/ai-enterprise/deployment-guide-vmware/0.1.0/nouveau.html
sudo dnf install kernel-devel
sudo sh ./cuda_12.6.0_560.28.03_linux.run