Skip to content

Commit

Permalink
Prevent mountpoint collision between ephemeral drive and shared drives (
Browse files Browse the repository at this point in the history
#1589)

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]>
  • Loading branch information
francesco-giordano authored Nov 10, 2022
1 parent 6e5c94c commit fe7d847
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 17 deletions.
25 changes: 16 additions & 9 deletions cookbooks/aws-parallelcluster-config/recipes/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,23 @@

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

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

# Execution timeout 3600 seconds
unless virtualized?
execute "Setup of ephemeral drivers" do
user "root"
command "/usr/local/sbin/setup-ephemeral-drives.sh"
# Execution timeout 3600 seconds
unless virtualized?
execute "Setup of ephemeral drives" do
user "root"
command "/usr/local/sbin/setup-ephemeral-drives.sh"
end
end
end

Expand Down
32 changes: 24 additions & 8 deletions cookbooks/aws-parallelcluster-test/recipes/tests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -334,9 +334,25 @@ module load intelmpi && mpirun --help | grep '#{node['cluster']['intelmpi']['kit
###################
# instance store
###################
bash 'test instance store' do
cwd Chef::Config[:file_cache_path]
code <<-EPHEMERAL

ebs_shared_dirs_array = node['cluster']['ebs_shared_dirs'].split(',')

if ebs_shared_dirs_array.include? node['cluster']['ephemeral_dir']
# In this case the ephemeral storage should not be mounted because the mountpoint
# clashes with the mountpoint coming from t
bash 'test instance store mountpoint collision' do
cwd Chef::Config[:file_cache_path]
user node['cluster']['cluster_user']
code <<-COLLISION
systemctl show setup-ephemeral.service -p ActiveState | grep "=inactive"
systemctl show setup-ephemeral.service -p UnitFileState | grep "=disabled"
COLLISION
end
else
bash 'test instance store' do
cwd Chef::Config[:file_cache_path]
user node['cluster']['cluster_user']
code <<-EPHEMERAL
set -xe
EPHEMERAL_DIR="#{node['cluster']['ephemeral_dir']}"
Expand Down Expand Up @@ -389,11 +405,11 @@ module load intelmpi && mpirun --help | grep '#{node['cluster']['intelmpi']['kit
mkdir -p ${EPHEMERAL_DIR}/test_dir
touch ${EPHEMERAL_DIR}/test_dir/test_file
fi
EPHEMERAL
user node['cluster']['cluster_user']
end
execute 'check setup-ephemeral service is enabled' do
command "systemctl is-enabled setup-ephemeral"
EPHEMERAL
end
execute 'check setup-ephemeral service is enabled' do
command "systemctl is-enabled setup-ephemeral"
end
end

###################
Expand Down

0 comments on commit fe7d847

Please sign in to comment.