Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

would like to be able to set slurmdbd_storage_port to "" instead of an actual port number #57

Open
jakerundall opened this issue Feb 28, 2024 · 4 comments

Comments

@jakerundall
Copy link
Contributor

We often configure MariaDB to not listen via TCP/IP and instead to only accept socket connections. And then we set StoragePort="" in slurmdbd.conf and slurmdbd will connect via socket.

Can we update the type for slurmdbd_storage_port as follows to accept an empty string as a valid value?

Variant[Stdlib::Port, Enum['""']]

I've forked and created a branch here: https://github.com/jakerundall/puppet-slurm/tree/rundall/ncsa/svcplan-4943

If you'd like I can submit a PR.

Thanks!

@treydock
Copy link
Owner

I'd recommend instead do

Variant[Stdlib::Port, String[0,0]]

To allow either a port of empty string.

@jakerundall
Copy link
Contributor Author

I should have described it better — it needs to accept a string that contains "", not an actual empty string. Because we need Puppet to put the following in slurmdbd.conf (set the param as an empty string surrounded by ""):

StoragePort=""

If we only allow an actual string, then Puppet tries to put in the following (param w/o value):

StoragePort=

But then slurmdbd won't start:

[root@mgsched2 ~]# slurmdbd -D -vvvvv
slurmdbd: error: Parse error in file /etc/slurm/slurmdbd.conf line 50: "StoragePort="
slurmdbd: fatal: Could not open/read/parse slurmdbd.conf file /etc/slurm/slurmdbd.conf

@treydock
Copy link
Owner

treydock commented Feb 29, 2024

Ah, so in that case that might mean to update the template. So if you set empty string, ie String[0,0] then something like this in template:

<%- elsif value == '' -%>
<%= key %>=""

Here:

<%- elsif value.is_a?(Hash) -%>
<%- v = value.map {|k,v| "#{k}=#{v}" }.join(',') %>
<%= key %>=<%= v %>
<% else -%>

@jakerundall
Copy link
Contributor Author

Yep, that does also work, and it's definitely cleaner in terms of usage and documentation.

master...jakerundall:puppet-slurm:rundall/ncsa/svcplan-4943

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants