Skip to content

ValueError while parsing cgroup config #392

@as-polyakov

Description

@as-polyakov

We seem to incorrectly handle the CGroup (and possible other) config when doing

test case:

    a = pyslurm.slurmctld.config.Config.load()
    ctl_dict = a.to_dict()

config from Slurm:

root@slurm:/tmp$  scontrol show config

Cgroup Support Configuration:
AllowedRAMSpace         = 95.0%
AllowedSwapSpace        = 100.0%
CgroupMountpoint        = /sys/fs/cgroup
CgroupPlugin            = autodetect
ConstrainCores          = yes
ConstrainDevices        = yes
ConstrainRAMSpace       = yes
ConstrainSwapSpace      = yes
EnableControllers       = yes
EnableExtraControllers  = (null)
IgnoreSystemd           = yes
IgnoreSystemdOnFailure  = yes
MaxRAMPercent           = 100.0%
MaxSwapPercent          = 100.0%
MemorySwappiness        = (null)
MinRAMSpace             = 30MB
SystemdTimeout          = 1000 ms

Actual behavior:

ctl_dict = a.to_dict() 
File "pyslurm/core/slurmctld/config.pyx", line 225, in pyslurm.core.slurmctld.config.Config.to_dict  
File "pyslurm/utils/helpers.pyx", line 335, in pyslurm.utils.helpers.instance_to_dict 
File "pyslurm/core/slurmctld/config.pyx", line 234, in pyslurm.core.slurmctld.config.Config.cgroup_config.__get__ 
File "pyslurm/core/slurmctld/config.pyx", line 120, in pyslurm.core.slurmctld.config.CgroupConfig.from_ptr 
 ValueError: could not convert string to float: '95.0%'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions