forked from aws/aws-parallelcluster-cookbook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
kitchen.recipes-config.yml
374 lines (371 loc) · 12.9 KB
/
kitchen.recipes-config.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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
# Allows to test single recipes
#
# Must be run as local file (override) of kitchen.docker.yml
# export KITCHEN_YAML=kitchen.docker.yml
# export KITCHEN_LOCAL_YAML=kitchen.recipes.yml
# See: https://kitchen.ci/docs/reference/configuration
<%
aws_region = ENV['KITCHEN_AWS_REGION'] || ENV['AWS_DEFAULT_REGION'] || 'eu-west-1'
%>
---
verifier:
name: inspec
inspec_tests:
# recipe tests will use controls from these directories
- test/recipes
- test/resources
lifecycle:
<% %w(post_create pre_converge pre_destroy).each do |op| %>
<%= op %>:
- local: bash ./test/recipes/hooks/run.sh <%= op %> $(dirname "$0")
<% end %>
# If you need to test a recipe with recipe/resources dependencies,
# add recipe[aws-parallelcluster::add_dependencies] as first item in the run_list
# then define a dependencies attribute, listing them with recipe: or resource: prefix.
# You can find an example in the add_depdendencies.rb file.
suites:
- name: fs_update
run_list:
- recipe[aws-parallelcluster::add_dependencies]
- recipe[aws-parallelcluster-config::fs_update]
verifier:
controls:
- fs_data_file_created_correctly
attributes:
dependencies:
- recipe:aws-parallelcluster-install::directories
- recipe:aws-parallelcluster::test_dummy
cluster:
ebs_shared_dirs: ebs1,ebs2
volume: volume1,volume2
raid_shared_dir: raid1
raid_type: 1
raid_vol_ids: volume1,volume2
efs_shared_dirs: efs1,efs2
efs_fs_ids: efs-id1,efs-id2
efs_encryption_in_transits: true,false
efs_iam_authorizations: iam1,iam2
fsx_shared_dirs: fsx1,fsx2
fsx_fs_ids: fsx-id1,fsx-id2
fsx_fs_types: type1,type2
fsx_dns_names: dns1,dns2
fsx_mount_names: mount1,mount2
fsx_volume_junction_paths: value1,value2
- name: fs_update_default_values
run_list:
- recipe[aws-parallelcluster::add_dependencies]
- recipe[aws-parallelcluster-config::fs_update]
verifier:
controls:
- fs_data_file_with_default_values
attributes:
dependencies:
#- recipe:aws-parallelcluster-install::directories
- recipe:aws-parallelcluster::test_dummy
cluster:
ebs_shared_dirs: '/shared'
volume: ''
efs_shared_dirs: ''
fsx_shared_dirs: ''
raid_shared_dir: ''
- name: networking_configured
run_list:
- recipe[aws-parallelcluster-config::networking]
verifier:
controls:
- networking_configured
- name: ssh_target_checker
run_list:
- recipe[aws-parallelcluster-config::openssh]
verifier:
controls:
- ssh_target_checker_script_created
attributes:
ec2:
mac: mac1
network_interfaces_macs:
mac1:
vpc_ipv4_cidr_blocks: |
cidr1
cidr2
- name: ephemeral_drives_mounted
driver:
instance_type: m5d.xlarge # instance type with ephemeral drives
run_list:
- recipe[aws-parallelcluster::add_dependencies]
- recipe[aws-parallelcluster-config::ephemeral_drives]
verifier:
controls:
- ephemeral_drives_service_running
- ephemeral_drives_configured
attributes:
dependencies:
#- recipe:aws-parallelcluster-install::ephemeral_drives
- recipe:aws-parallelcluster-test::cfnconfig_mock
cluster:
ebs_shared_dirs: test1,test2
efs_shared_dirs: ''
fsx_shared_dirs: ''
raid_shared_dir: ''
ephemeral_dir: /scratch
- name: ephemeral_drives_skipped
driver:
instance_type: m5d.xlarge # instance type with ephemeral drives
run_list:
- recipe[aws-parallelcluster::add_dependencies]
- recipe[aws-parallelcluster-config::ephemeral_drives]
verifier:
controls:
- ephemeral_drives_with_name_clashing_not_mounted
attributes:
dependencies:
#- recipe:aws-parallelcluster-install::ephemeral_drives
cluster:
ebs_shared_dirs: test1,test2
efs_shared_dirs: ''
fsx_shared_dirs: ''
raid_shared_dir: ''
ephemeral_dir: test1
- name: sudo_configured
run_list:
- recipe[aws-parallelcluster::add_dependencies]
- recipe[aws-parallelcluster-config::sudo]
verifier:
controls:
- sudo_configured
attributes:
dependencies:
#- recipe:aws-parallelcluster-install::directories
#- recipe:aws-parallelcluster-install::sudo
- name: chrony_configured
run_list:
- recipe[aws-parallelcluster::add_dependencies]
- recipe[aws-parallelcluster-config::chrony]
verifier:
controls:
- chrony_configured
attributes:
dependencies:
#- recipe:aws-parallelcluster-install::chrony
- name: imds_configured
run_list:
- recipe[aws-parallelcluster::add_dependencies]
- recipe[aws-parallelcluster-config::imds]
verifier:
controls:
- /only_allowed_users_can_access_imds/
- /iptables_correctly_configured/
attributes:
dependencies:
#- recipe:aws-parallelcluster-install::directories
#- resource:package_repos
#- resource:install_packages
cluster:
node_type: HeadNode
scheduler: slurm
head_node_imds_secured: 'true'
head_node_imds_allowed_users: ['root', 'nobody']
- name: head_node_base
run_list:
- recipe[aws-parallelcluster::add_dependencies]
- recipe[aws-parallelcluster-config::head_node_base]
verifier:
controls:
- head_node_base_configured
driver:
privileged: true # required to set hostname
iam_profile_name: <%= ENV['AWS_IAM_PROFILE'] %>
attributes:
dependencies:
#- recipe:aws-parallelcluster-install::directories
#- resource:package_repos
- recipe:aws-parallelcluster-test::docker_mock
#- resource:install_packages
#- resource:nfs
#- recipe:aws-parallelcluster-install::python
#- recipe:aws-parallelcluster-install::users
- recipe:aws-parallelcluster-slurm::init_dns
cluster:
stack_name: "mock"
ebs_shared_dirs: ""
node_type: HeadNode
dns_domain: test-domain
assigned_hostname: fqn-hostname
assigned_short_hostname: short-hostname
ddb_table: <%= ENV['DDB_TABLE'] %>
region: <%= aws_region %>
ec2:
local_hostname: ip-10-0-0-200.eu-west-1.compute.internal
local_ipv4: 10.0.0.200
mac: 02:04:c9:66:6c:23
network_interfaces_macs:
02:04:c9:66:6c:23:
device_number: '0'
interface_id: eni-084e384b139c88340
ipv4-associations:
3.253.9.238: 10.0.0.200
local_hostname: ip-10-0-0-200.eu-west-1.compute.internal
local_ipv4s: 10.0.0.200
mac: 02:04:c9:66:6c:23
public_hostname: ec2-3-253-9-238.eu-west-1.compute.amazonaws.com
public_ipv4s: 3.253.9.238
security_group_ids: sg-0d6ed39436326b0c1
security_groups: Security Group kitchen
subnet_id: subnet-061d5d152f1ea6e1f
subnet_ipv4_cidr_block: 10.0.0.0/24
vpc_id: vpc-0f2e67ad1d48c13c6
vpc_ipv4_cidr_block: 10.0.0.0/16
vpc_ipv4_cidr_blocks: 10.0.0.0/16
ipaddress: 10.0.0.200
- name: init_dns
run_list:
- recipe[aws-parallelcluster::add_dependencies]
- recipe[aws-parallelcluster-slurm::init_dns]
verifier:
controls:
- hostname_configured
driver:
privileged: true # required to set hostname
attributes:
dependencies:
#- recipe:aws-parallelcluster-install::directories
#- resource:dns_domain:setup
cluster:
node_type: HeadNode
dns_domain: test-domain
assigned_hostname: fqn-hostname
assigned_short_hostname: short-hostname
ec2:
local_hostname: dokken
local_ipv4: 172.17.1.15
ipaddress: 172.17.1.15
- name: compute_base
run_list:
- recipe[aws-parallelcluster::add_dependencies]
- recipe[aws-parallelcluster-config::compute_base]
verifier:
controls:
- compute_base_configured
attributes:
dependencies:
#- resource:nfs
- recipe:aws-parallelcluster-test::compute_base_mock
cluster:
node_type: ComputeNode
cluster_user: test_user
exported_intel_dir: exported_intel
raid_shared_dir: raid1
exported_raid_shared_dir: exported_raid1
ebs_shared_dirs: ebs1,ebs2
exported_ebs_shared_dirs: exported_ebs1,exported_ebs2
nfs:
hard_mount_options: hard,_netdev,noatime
head_node_private_ip: '127.0.0.1'
- name: network_interfaces
# Verifies multiple Network Interfaces recipes
# These recipes can be tested on EC2 on instance type with multiple network interfaces
# https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html#network-cards
run_list:
- recipe[aws-parallelcluster-config::network_interfaces]
driver:
instance_type: c6in.32xlarge # available in eu-west-1, all AZs
# availability_zone: ...
# subnet_id: ...
verifier:
controls:
- network_interfaces_configuration_script_created
- network_interfaces_configured
- multiple_network_interfaces_can_ping_gateway
- name: custom_slurm_settings_file_via_s3
# check that we can retrieve a custom slurm settings file using the S3 protocol
run_list:
- recipe[aws-parallelcluster::add_dependencies]
- recipe[aws-parallelcluster-slurm::retrieve_remote_custom_settings_file]
verifier:
controls:
- custom_settings_file_retrieved
attributes:
dependencies:
- recipe:aws-parallelcluster-install::directories
- recipe:aws-parallelcluster-install::python
cluster:
config:
Scheduling:
SlurmSettings:
# here we are just interested in testing that we can retrieve a file from S3 through S3 protocol
CustomSlurmSettingsIncludeFile: 's3://us-east-1-aws-parallelcluster/templates/1-click/serverless-database.yaml'
LocalPath: '/tmp/custom_slurm_settings_include_file_slurm.conf'
- name: custom_slurm_settings_file_via_https
# check that we can retrieve a custom slurm settings file from internet through HTTP/S
run_list:
- recipe[aws-parallelcluster::add_dependencies]
- recipe[aws-parallelcluster-slurm::retrieve_remote_custom_settings_file]
verifier:
controls:
- custom_settings_file_retrieved
attributes:
dependencies:
- recipe:aws-parallelcluster-install::directories
- recipe:aws-parallelcluster-install::python
cluster:
config:
Scheduling:
SlurmSettings:
# here we are just interested in testing that we can retrieve a file from S3 through https protocol
CustomSlurmSettingsIncludeFile: 'https://us-east-1-aws-parallelcluster.s3.amazonaws.com/templates/1-click/serverless-database.yaml'
LocalPath: '/tmp/custom_slurm_settings_include_file_slurm.conf'
- name: directory_service
run_list:
- recipe[aws-parallelcluster::add_dependencies]
- recipe[aws-parallelcluster-config::directory_service]
verifier:
controls:
- sssd_configured_correctly
attributes:
cluster:
node_type: HeadNode
directory_service:
enabled: 'true'
domain_name: corp.something.com
domain_addr: ldaps://corp.something.com
password_secret_arn: arn:aws:secretsmanager:eu-west-1:123456789:secret:a-secret-name
domain_read_only_user: cn=ReadOnlyUser,ou=Users,ou=CORP,dc=corp,dc=something,dc=com
ldap_tls_ca_cert: /path/to/domain-certificate.crt
ldap_tls_req_cert: never
ldap_access_filter: filter-string
generate_ssh_keys_for_users: 'true'
additional_sssd_configs:
debug_level: "0x1ff"
dependencies:
- recipe:aws-parallelcluster-install::directories
- resource:package_repos
- resource:system_authentication
- name: nvidia
run_list:
- recipe[aws-parallelcluster::add_dependencies]
- recipe[aws-parallelcluster-config::nvidia]
verifier:
controls:
- /nvidia-fabricmanager_enabled/
- /gdrcopy_enabled/
- /gdrcopy_disabled/
driver:
# nvidia_driver can be executed only on a graphic EC2 instance example: g4dn.xlarge(x86_86) or g5g.xlarge(aarm64)
instance_type: g4dn.xlarge
attributes:
dependencies:
- recipe:aws-parallelcluster::test_dummy
cluster:
nvidia:
enabled: true
- name: health_check
run_list:
- recipe[aws-parallelcluster-test::slurm_mock]
- recipe[aws-parallelcluster-slurm::config_health_check]
verifier:
controls:
- health_check_configured
attributes:
cluster:
slurm:
install_dir: "/opt/slurm"