Skip to content

Commit

Permalink
enhancement(slurmctld): enforce job level memory
Browse files Browse the repository at this point in the history
These changes introduce default values for SelectTypeParameters
and MemSpecLimit.

`SelectTypeParameters=CR_CPU_Memory` to enable memory allocation
enforcement.

`MemSpecLimit=1024` to ensure systems always have 1G available
memory that jobs cannot consume.
  • Loading branch information
jamesbeedy committed Nov 24, 2024
1 parent b3b2679 commit 7e5d358
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions charms/slurmctld/src/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"PluginDir": ["/usr/lib/x86_64-linux-gnu/slurm-wlm"],
"PlugStackConfig": "/etc/slurm/plugstack.conf.d/plugstack.conf",
"SelectType": "select/cons_tres",
"SelectTypeParameters": "CR_CPU_Memory",
"SlurmctldPort": "6817",
"SlurmdPort": "6818",
"StateSaveLocation": "/var/lib/slurm/checkpoint",
Expand Down
2 changes: 2 additions & 0 deletions charms/slurmd/src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import logging
from typing import Any, Dict, cast

from constants import CHARM_MAINTAINED_NODE_PARAMETERS
from interface_slurmctld import Slurmctld, SlurmctldAvailableEvent
from ops import (
ActionEvent,
Expand Down Expand Up @@ -326,6 +327,7 @@ def get_node(self) -> Dict[Any, Any]:
node = {
"node_parameters": {
**machine.get_slurmd_info(),
**CHARM_MAINTAINED_NODE_PARAMETERS,
**self._user_supplied_node_parameters,
},
"new_node": self._new_node,
Expand Down
6 changes: 6 additions & 0 deletions charms/slurmd/src/constants.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Copyright 2024 Omnivector, LLC.
# See LICENSE file for licensing details.

"""This module provides constants for the slurmd-operator charm."""

CHARM_MAINTAINED_NODE_PARAMETERS = {"MemSpecLimit": "1024"}

0 comments on commit 7e5d358

Please sign in to comment.