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(slurm_ops): loosen environment variable rules and configure openfile limits #44

Merged
merged 8 commits into from
Oct 16, 2024

Conversation

NucciTheBoss
Copy link
Member

This PR adds support for setting the MYSQL_UNIX_PORT environment variable needed by slurmdbd to connect to MySQL via a unix socket, and it adds configs for expanding the allowed amount open files at once.

This PR also improves the testing coverage of _AptManager by mocking several of the installation steps such as configuring apt to use the Ubuntu HPC PPA, writing security configurations, overriding service files, etc. It refactors the install function to (a) lower the cyclomatic complexity of install - less if/else in a single function - and (b) very easy to unit test.

Misc.

  • Configure black's target version to be py310 so that we can use match/case. Python 3.8 is also EOL, and we're not targeting any bases that use Python 3.8 by default.
  • Simplify unit tests by using only one TestCase class. pyfakefs's version of TestCase inherits from unittest.TestCase, so just don't call self.setupPyfakeFS() and it's pretty much the same 😓

Related issues

Changes:

- Refactor `_AptManager` install mechanism to better encapsulate operations
  such as configuring apt to use Ubuntu HPC PPA, install packages based on the
  mapped service, and apply necessary overrides to systemd and ulimit.

Signed-off-by: Jason C. Nucciarone <[email protected]>
Python 3.8 is no longer supported, and we don't target any bases that
ship a Python version older than 3.10.

Signed-off-by: Jason C. Nucciarone <[email protected]>
@NucciTheBoss
Copy link
Member Author

Yep, needs a rebase :shipit:

@NucciTheBoss
Copy link
Member Author

@jedel1043 R4R now that we're not getting ganked by Python

Copy link
Contributor

@jedel1043 jedel1043 left a comment

Choose a reason for hiding this comment

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

Really impressive work! I have a very tiny nitpick that shouldn't block merging this :)

lib/charms/hpc_libs/v0/slurm_ops.py Outdated Show resolved Hide resolved
…ons in log messages

Co-authored-by: José Julián Espina <[email protected]>
@NucciTheBoss NucciTheBoss merged commit fda80b3 into charmed-hpc:main Oct 16, 2024
4 checks passed
@NucciTheBoss
Copy link
Member Author

Oops - latest commit message got messed up. I'll fix in a vbump PR tomorrow.

@NucciTheBoss NucciTheBoss deleted the feat-configs-galore branch November 14, 2024 18:59
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
2 participants