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

feat: add set_configs operation to SlurmManager #6

Closed
wants to merge 1 commit into from

Conversation

jedel1043
Copy link
Contributor

Implements a simple utility method to be able to set configs in bulk. This is required by the Slurm charms since they generate and set configs in bulk.

@NucciTheBoss NucciTheBoss self-requested a review July 8, 2024 15:06
@NucciTheBoss NucciTheBoss added the enhancement New feature or request label Jul 8, 2024
Copy link
Member

@NucciTheBoss NucciTheBoss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@NucciTheBoss
Copy link
Member

@jedel1043 overall, I'm good with the implementation, but I have an idea that I'd like to know your thoughts on.

Why not have set_config(...) just accept a mapping rather than two positional arguments for both key and value? That way we don't need to have two methods that somewhat implement the same functionality. Reason saying is that when I look at a method like set_config(...), I think of snapctl set ... which accepts multiple configuration arguments.

I think it could potentially be better to have just one set_config(...) method that takes in a mapping of multiple configuration options. I see us using set_configs(...) way more often than set_config(...) as we'll likely need to handle a variable amount of configuration options as they come in from relations, actions, etc. rather than granular, single option changes.

Let me know what your thoughts are 😄

@jedel1043
Copy link
Contributor Author

The main reason is to avoid breaking changes, but if we wanna do them, I think your suggestion would be better, yeah.

@NucciTheBoss
Copy link
Member

The main reason is to avoid breaking changes, but if we wanna do them, I think your suggestion would be better, yeah.

You have the right idea, but I don't think we have to worry about breaking changes right now given that this lib is very much in development, and we'll very much likely be the only consumers. Better to get it how we want it now rather than later when we're stable 😅

Let's go ahead with the proposed approach of having set_config(...) accept a mapping rather than two positional arguments so we only have one method for getting configuration options.

@NucciTheBoss
Copy link
Member

#8 adds the set_config(...) functionality where you're able to set multiple Slurm configurations at once.

@jedel1043
Copy link
Contributor Author

Superseeded by that then.

@jedel1043 jedel1043 closed this Jul 9, 2024
@jedel1043 jedel1043 deleted the get-configs branch July 9, 2024 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants