-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhpc.yml
190 lines (168 loc) · 4.72 KB
/
hpc.yml
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
- name: Setup base hpc
hosts: all
gather_facts: true
tasks:
- name: Add user hpc
become: yes
user:
name: hpc
shell: /bin/bash
- name: Set SSH key
become: yes
authorized_key:
user: hpc
state: present
key: "{{ lookup('file', '~/hpc.key.pub') }}"
- name: Distribute private keyfiles to hosts
become: yes
become_user: hpc
copy:
src: "~/hpc.key"
dest: "/home/hpc/.ssh/id_dsa"
mode: 0600
- name: Add hpc to sudoers
become: yes
copy:
dest: "/etc/sudoers.d/devops"
content: "hpc ALL=(ALL) NOPASSWD: ALL"
- name: Disable host SSH key checking
become: yes
become_user: hpc
copy:
dest: "~/.ssh/config"
content: "Host *\n StrictHostKeyChecking no\n"
- name: apt packages
become: yes
apt:
name: "{{ packages }}"
vars:
packages:
- cmake
- git
- makedepf90
- gfortran
- gcc
- patch
- unzip
- libxtst6
- libxt6
# Debug stuff below
- iptraf-ng
- iptraf
- iftop
- htop
- iotop
- name: Create a new primary partition
parted:
device: /dev/sdc
number: 1
state: present
- name: Creating file system
become: yes
filesystem:
fstype: xfs
dev: /dev/sdc1
- name: Mounting file system
become: yes
mount:
path: /data
src: /dev/sdc1
fstype: xfs
state: mounted
backup: yes
- name: Install azcopy to /usr/bin
become: yes
unarchive:
src: https://aka.ms/downloadazcopy-v10-linux
dest: /usr/bin
creates: /usr/bin/azcopy
remote_src: yes
extra_opts: [--strip-components=1]
retries: 3
- name: Change file ownership, group and permissions
become: yes
file:
path: /data
mode: '0777'
- name: Change file ownership, group and permissions
become: yes
file:
path: /mnt
mode: '0777'
- name: Download blob
become: yes
become_user: hpc
shell: 'azcopy copy "{{ lookup("env","SAS_RAMDAM_URL") }}" /data --recursive=true'
args:
creates:
/data/ramdam
- name: Install Matlab Runtime
become: yes
become_user: hpc
shell: |
cd /data/ramdam
mkdir matlab
mv MATLAB_Runtime_R2019a_Update_2_glnxa64.zip matlab
cd matlab
unzip MATLAB_Runtime_R2019a_Update_2_glnxa64.zip
sudo ./install -mode silent -agreeToLicense yes
args:
creates: /usr/local/MATLAB/MATLAB_Runtime/v96/runtime/glnxa64/libMatlabCppSharedLib.so
- name: Update ld.so with matlab paths
become: yes
copy:
dest: /etc/ld.so.conf.d/matlab.conf
content: |
/usr/local/MATLAB/MATLAB_Runtime/v96/runtime/glnxa64
/usr/local/MATLAB/MATLAB_Runtime/v96/bin/glnxa64
/usr/local/MATLAB/MATLAB_Runtime/v96/sys/os/glnxa64
/usr/local/MATLAB/MATLAB_Runtime/v96/extern/bin/glnxa64
#/usr/local/MATLAB/MATLAB_Runtime/v96/opengl/bin/glnxa64
- name: Update Workspace
become: yes
lineinfile:
path: /data/ramdam/ramdam/rl_pdf/workspace_parameters.txt
regexp: '^wkspc_param.input_dir'
line: "wkspc_param.input_dir = '/data/ramdam/EGSL/';"
- name: Update Workspace
become: yes
lineinfile:
path: /data/ramdam/ramdam/rl_pdf/workspace_parameters.txt
regexp: '^wkspc_param.intermed_maindir'
line: "wkspc_param.intermed_maindir = '/mnt/intermediates/';"
- name: Update Workspace
become: yes
lineinfile:
path: /data/ramdam/ramdam/rl_pdf/workspace_parameters.txt
regexp: '^wkspc_param.output_dir'
line: "wkspc_param.output_dir = '/mnt/outputs/';"
- name: Update Workspace
become: yes
lineinfile:
path: /data/ramdam/ramdam/rl_pdf/workspace_parameters.txt
regexp: '^wkspc_param.toolboxes_dir'
line: "wkspc_param.toolboxes_dir = '/data/ramdam/ramdam/toolboxes/';"
- name: Update Workspace
become: yes
lineinfile:
path: /data/ramdam/ramdam/rl_pdf/workspace_parameters.txt
regexp: '^wkspc_param.logs_maindir'
line: "wkspc_param.logs_maindir = '/mnt/logs/';"
- name: Update Workspace Cores
become: yes
lineinfile:
path: /data/ramdam/ramdam/rl_pdf/workspace_parameters.txt
regexp: '^wkspc_param.n_workers'
line: "wkspc_param.n_workers = 60;"
- name: Do science
become: yes
become_user: hpc
run_once: true
shell: |
sudo ldconfig
mkdir /mnt/logs &> /dev/null
mkdir /mnt/intermediates &> /dev/null
mkdir /mnt/outputs &> /dev/null
sudo chmod 755 -R /data
#cd /data/ramdam/ramdam/rl_pdf/
#/data/ramdam/ramdam/compilation/run_main_SPL_distribution.sh /usr/local/MATLAB/MATLAB_Runtime/v96 StLawrenceGulf 16 1000 1000