From 479b6cbd3fd9ed75696e7a5b982db2ae53c9dae3 Mon Sep 17 00:00:00 2001 From: Jacopo De Amicis Date: Thu, 7 Dec 2023 18:28:18 +0100 Subject: [PATCH] Add support for passing Slurm patches from S3 Add support for passing an URL for an archive containing Slurm patches to be used when building Slurm via the build-image Extra Chef Attributes. Signed-off-by: Jacopo De Amicis --- .../recipes/install/install_slurm.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/cookbooks/aws-parallelcluster-slurm/recipes/install/install_slurm.rb b/cookbooks/aws-parallelcluster-slurm/recipes/install/install_slurm.rb index 323191437..656c5b33a 100644 --- a/cookbooks/aws-parallelcluster-slurm/recipes/install/install_slurm.rb +++ b/cookbooks/aws-parallelcluster-slurm/recipes/install/install_slurm.rb @@ -55,6 +55,25 @@ recursive true end +# Copy Slurm patches from S3 if passed via dna.json +if !node['cluster']['slurm_patches_s3_archive'].nil? && !node['cluster']['slurm_patches_s3_archive'].empty? + remote_object 'Retrieve Custom Slurm Settings' do + url node['cluster']['slurm_patches_s3_archive'] + destination "#{node['cluster']['sources_dir']}/slurm_patches_from_s3.tar.gz" + sensitive true + end + + bash 'extract Slurm patches from archive' do + user 'root' + group 'root' + cwd "#{node['cluster']['sources_dir']}/slurm_patches" + code <<-UNTAR + set -e + tar xf #{node['cluster']['sources_dir']}/slurm_patches_from_s3.tar.gz + UNTAR + end +end + # Install Slurm bash 'make install' do not_if { redhat_on_docker? }