ComputeCanada / puppet-magic_castle

Puppet Environment repo for Magic Castle - https://github.com/ComputeCanada/magic_castle
MIT License
13 stars 21 forks source link

Add support for Slurm >=24.05.3 InstanceType #376

Open cmd-ntrf opened 2 months ago

cmd-ntrf commented 2 months ago

Slurm added the notion of cloud instance type in the accounting: https://slurm.schedmd.com/power_save.html#accounting

The InstanceType attribute cannot be defined in slurm.conf. It has to be passed as a parameter during slurmd startup.

To enable InstanceType configuration in Magic Castle, we could create the slurmd environment file and provide the slurmd parameter via SLURMD_OPTION like this:

if versioncmp(lookup('profile::slurm::base::slurm_version', '24.05')) >= 0 {
  instance_type = lookup('terraform.self.specs.type')
  file { '/etc/sysconfig/slurmd':
    content => "SLURMD_OPTIONS='--instance-type ${instance_type}'"
  }
}

This requires terraform_data to be updated in Magic Castle to include the instance type in its specs.