|
5 | 5 | nvidia_imex_shared_dir = "SHARED_DIR/nvidia-imex" |
6 | 6 | imex_binary = '/usr/bin/nvidia-imex' |
7 | 7 | imex_ctl_binary = '/usr/bin/nvidia-imex-ctl' |
8 | | -launch_template_id = 'lt-123456789012' |
| 8 | +queue_name = 'queue-name' |
| 9 | +compute_resource_name = 'compute-resource-name' |
9 | 10 | cluster_artifacts_s3_url = 'https://aws_region-aws-parallelcluster.s3.aws_region.AWS_DOMAIN' |
10 | 11 |
|
11 | 12 | class ConvergeNvidiaImex |
@@ -330,50 +331,52 @@ def self.configure(chef_run) |
330 | 331 | chef_run.node.override['cluster']['nvidia']['imex']['force_configuration'] = force_indicator |
331 | 332 | chef_run.node.override['cluster']['nvidia']['imex']['shared_dir'] = nvidia_imex_shared_dir |
332 | 333 | chef_run.node.override['cluster']['node_type'] = node_type |
333 | | - chef_run.node.override['cluster']['launch_template_id'] = launch_template_id |
| 334 | + chef_run.node.override['cluster']['scheduler_queue_name'] = queue_name |
| 335 | + chef_run.node.override['cluster']['scheduler_compute_resource_name'] = compute_resource_name |
| 336 | + |
334 | 337 | ConvergeNvidiaImex.configure(chef_run) |
335 | 338 | end |
336 | 339 |
|
337 | 340 | if (platform == 'amazon' && version == '2') || %w(HeadNode LoginNode).include?(node_type) |
338 | 341 | it 'does not configure nvidia-imex' do |
339 | | - is_expected.not_to create_if_missing_template("#{nvidia_imex_shared_dir}/nodes_config_#{launch_template_id}.cfg") |
| 342 | + is_expected.not_to create_if_missing_template("#{nvidia_imex_shared_dir}/nodes_config_#{queue_name}_#{compute_resource_name}.cfg") |
340 | 343 | .with(source: 'nvidia-imex/nvidia-imex-nodes.erb') |
341 | 344 | .with(user: 'root') |
342 | 345 | .with(group: 'root') |
343 | 346 | .with(mode: '0755') |
344 | | - is_expected.not_to create_if_missing_template("#{nvidia_imex_shared_dir}/config_#{launch_template_id}.cfg") |
| 347 | + is_expected.not_to create_if_missing_template("#{nvidia_imex_shared_dir}/config_#{queue_name}_#{compute_resource_name}.cfg") |
345 | 348 | .with(source: 'nvidia-imex/nvidia-imex-config.erb') |
346 | 349 | .with(user: 'root') |
347 | 350 | .with(group: 'root') |
348 | 351 | .with(mode: '0755') |
349 | | - .with(variables: { imex_nodes_config_file_path: "#{nvidia_imex_shared_dir}/nodes_config_#{launch_template_id}.cfg" }) |
| 352 | + .with(variables: { imex_nodes_config_file_path: "#{nvidia_imex_shared_dir}/nodes_config_#{queue_name}_#{compute_resource_name}.cfg" }) |
350 | 353 | is_expected.not_to create_template("/etc/systemd/system/nvidia-imex.service") |
351 | 354 | .with(source: 'nvidia-imex/nvidia-imex.service.erb') |
352 | 355 | .with(user: 'root') |
353 | 356 | .with(group: 'root') |
354 | 357 | .with(mode: '0644') |
355 | | - .with(variables: { imex_main_config_file_path: "#{nvidia_imex_shared_dir}/config_#{launch_template_id}.cfg" }) |
| 358 | + .with(variables: { imex_main_config_file_path: "#{nvidia_imex_shared_dir}/config_#{queue_name}_#{compute_resource_name}.cfg" }) |
356 | 359 | is_expected.not_to start_service('nvidia-imex').with_action(%i(enable start)).with_supports({ status: true }) |
357 | 360 | end |
358 | 361 | else |
359 | 362 | it 'it starts nvidia-imex service' do |
360 | | - is_expected.to create_if_missing_template("#{nvidia_imex_shared_dir}/nodes_config_#{launch_template_id}.cfg") |
| 363 | + is_expected.to create_if_missing_template("#{nvidia_imex_shared_dir}/nodes_config_#{queue_name}_#{compute_resource_name}.cfg") |
361 | 364 | .with(source: 'nvidia-imex/nvidia-imex-nodes.erb') |
362 | 365 | .with(user: 'root') |
363 | 366 | .with(group: 'root') |
364 | 367 | .with(mode: '0755') |
365 | | - is_expected.to create_if_missing_template("#{nvidia_imex_shared_dir}/config_#{launch_template_id}.cfg") |
| 368 | + is_expected.to create_if_missing_template("#{nvidia_imex_shared_dir}/config_#{queue_name}_#{compute_resource_name}.cfg") |
366 | 369 | .with(source: 'nvidia-imex/nvidia-imex-config.erb') |
367 | 370 | .with(user: 'root') |
368 | 371 | .with(group: 'root') |
369 | 372 | .with(mode: '0755') |
370 | | - .with(variables: { imex_nodes_config_file_path: "#{nvidia_imex_shared_dir}/nodes_config_#{launch_template_id}.cfg" }) |
| 373 | + .with(variables: { imex_nodes_config_file_path: "#{nvidia_imex_shared_dir}/nodes_config_#{queue_name}_#{compute_resource_name}.cfg" }) |
371 | 374 | is_expected.to create_template("/etc/systemd/system/nvidia-imex.service") |
372 | 375 | .with(source: 'nvidia-imex/nvidia-imex.service.erb') |
373 | 376 | .with(user: 'root') |
374 | 377 | .with(group: 'root') |
375 | 378 | .with(mode: '0644') |
376 | | - .with(variables: { imex_main_config_file_path: "#{nvidia_imex_shared_dir}/config_#{launch_template_id}.cfg" }) |
| 379 | + .with(variables: { imex_main_config_file_path: "#{nvidia_imex_shared_dir}/config_#{queue_name}_#{compute_resource_name}.cfg" }) |
377 | 380 | is_expected.to start_service('nvidia-imex').with_action(%i(enable start)).with_supports({ status: true }) |
378 | 381 | end |
379 | 382 | end |
|
0 commit comments