Skip to content

Commit 18a1a34

Browse files
authored
Prevent mountpoint collision between ephemeral drive and shared drives
Disable ephemeral mount if mountpoint clashes with shared file system mountpoint Set up kitchen tests for mountpoint collision for ephemeral and shared drives Signed-off-by: Jacopo De Amicis <[email protected]>
1 parent bf72a98 commit 18a1a34

File tree

2 files changed

+40
-17
lines changed
  • cookbooks
    • aws-parallelcluster-config/recipes
    • aws-parallelcluster-test/recipes

2 files changed

+40
-17
lines changed

cookbooks/aws-parallelcluster-config/recipes/base.rb

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,23 @@
2727

2828
include_recipe 'aws-parallelcluster-config::nfs' unless virtualized?
2929

30-
service "setup-ephemeral" do
31-
supports restart: false
32-
action :enable
33-
end
30+
# Mount the ephemeral drive unless there is a mountpoint collision with shared drives
31+
shared_dir_array = node['cluster']['ebs_shared_dirs'].split(',') + \
32+
node['cluster']['efs_shared_dirs'].split(',') + \
33+
node['cluster']['fsx_shared_dirs'].split(',') + \
34+
[ node['cluster']['raid_shared_dir'] ]
35+
unless shared_dir_array.include? node['cluster']['ephemeral_dir']
36+
service "setup-ephemeral" do
37+
supports restart: false
38+
action :enable
39+
end
3440

35-
# Execution timeout 3600 seconds
36-
unless virtualized?
37-
execute "Setup of ephemeral drivers" do
38-
user "root"
39-
command "/usr/local/sbin/setup-ephemeral-drives.sh"
41+
# Execution timeout 3600 seconds
42+
unless virtualized?
43+
execute "Setup of ephemeral drives" do
44+
user "root"
45+
command "/usr/local/sbin/setup-ephemeral-drives.sh"
46+
end
4047
end
4148
end
4249

cookbooks/aws-parallelcluster-test/recipes/tests.rb

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -363,9 +363,25 @@ module load intelmpi && mpirun --help | grep '#{node['cluster']['intelmpi']['kit
363363
###################
364364
# instance store
365365
###################
366-
bash 'test instance store' do
367-
cwd Chef::Config[:file_cache_path]
368-
code <<-EPHEMERAL
366+
367+
ebs_shared_dirs_array = node['cluster']['ebs_shared_dirs'].split(',')
368+
369+
if ebs_shared_dirs_array.include? node['cluster']['ephemeral_dir']
370+
# In this case the ephemeral storage should not be mounted because the mountpoint
371+
# clashes with the mountpoint coming from t
372+
bash 'test instance store mountpoint collision' do
373+
cwd Chef::Config[:file_cache_path]
374+
user node['cluster']['cluster_user']
375+
code <<-COLLISION
376+
systemctl show setup-ephemeral.service -p ActiveState | grep "=inactive"
377+
systemctl show setup-ephemeral.service -p UnitFileState | grep "=disabled"
378+
COLLISION
379+
end
380+
else
381+
bash 'test instance store' do
382+
cwd Chef::Config[:file_cache_path]
383+
user node['cluster']['cluster_user']
384+
code <<-EPHEMERAL
369385
set -xe
370386
EPHEMERAL_DIR="#{node['cluster']['ephemeral_dir']}"
371387
@@ -418,11 +434,11 @@ module load intelmpi && mpirun --help | grep '#{node['cluster']['intelmpi']['kit
418434
mkdir -p ${EPHEMERAL_DIR}/test_dir
419435
touch ${EPHEMERAL_DIR}/test_dir/test_file
420436
fi
421-
EPHEMERAL
422-
user node['cluster']['cluster_user']
423-
end
424-
execute 'check setup-ephemeral service is enabled' do
425-
command "systemctl is-enabled setup-ephemeral"
437+
EPHEMERAL
438+
end
439+
execute 'check setup-ephemeral service is enabled' do
440+
command "systemctl is-enabled setup-ephemeral"
441+
end
426442
end
427443

428444
###################

0 commit comments

Comments
 (0)