Skip to content

Commit

Permalink
Avoid to start NFS server on compute nodes
Browse files Browse the repository at this point in the history
Signed-off-by: Luca Carrogu <carrogu@amazon.com>
  • Loading branch information
lukeseawalker committed Jun 29, 2023
1 parent 469c7fa commit 1c93e0d
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 16 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ This file is used to list changes made in each version of the AWS ParallelCluste
- Forward SLURM_RESUME_FILE to ParallelCluster resume program.
- Allow to override aws-parallelcluster-node package at cluster creation and update time (only on the head node during update).
Useful for development purposes only.
- Avoid to start NFS server on compute nodes.

**CHANGES**
- Assign Slurm dynamic nodes a priority (weight) of 1000 by default. This allows Slurm to prioritize idle static nodes over idle dynamic ones.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ suites:
- network_service_running
attributes:
resource: network_service:reload
- name: nfs
- name: nfs_headnode
run_list:
- recipe[aws-parallelcluster-tests::setup]
- recipe[aws-parallelcluster-tests::test_resource]
Expand All @@ -196,6 +196,21 @@ suites:
resource: nfs:configure
dependencies:
- resource:nfs
cluster:
node_type: HeadNode
- name: nfs_computefleet
run_list:
- recipe[aws-parallelcluster-tests::setup]
- recipe[aws-parallelcluster-tests::test_resource]
verifier:
controls:
- /tag:config_nfs/
attributes:
resource: nfs:configure
dependencies:
- resource:nfs
cluster:
node_type: ComputeFleet
- name: raid_mount
run_list:
- recipe[aws-parallelcluster-tests::setup]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# See the License for the specific language governing permissions and limitations under the License.

action :configure do
return if node['cluster']['node_type'] != "HeadNode"
node.force_override['nfs']['threads'] = node['cluster']['nfs']['threads']

override_server_template
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def self.configure(chef_run)

describe 'nfs:configure' do
for_all_oses do |platform, version|
context "on #{platform}#{version}" do
context "on #{platform}#{version} on node type HeadNode" do
cached(:threads) { 10 }
cached(:server_template) { 'server_template' }
cached(:nfs_service) { 'nfs_service' }
Expand All @@ -68,6 +68,7 @@ def self.configure(chef_run)
node.override['cluster']['nfs']['threads'] = threads
node.override['nfs']['config']['server_template'] = server_template
node.override['nfs']['service']['server'] = nfs_service
node.override['cluster']['node_type'] = "HeadNode"
end
ConvergeNfs.configure(runner)
end
Expand Down Expand Up @@ -113,5 +114,28 @@ def self.configure(chef_run)
.with(supports: { restart: true })
end
end

context "on #{platform}#{version} on node type ComputeFleet" do
cached(:server_template) { 'server_template' }
cached(:nfs_service) { 'nfs_service' }
cached(:chef_run) do
runner = runner(platform: platform, version: version, step_into: ['nfs']) do |node|
node.override['cluster']['node_type'] = "ComputeFleet"
end
ConvergeNfs.configure(runner)
end

it 'configures nfs' do
is_expected.to configure_nfs('configure')
end

it 'not overrides nfs config with custom template' do
is_expected.to_not create_template(server_template)
end

it 'not enables and restarts service' do
is_expected.to_not restart_service(nfs_service)
end
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
end
end

control 'tag:config_nfs_configured' do
control 'tag:config_nfs_configured_on_head_node' do
title 'Check that nfs is configured correctly'