Skip to content

Bug (upgrade): Support for cgroupv2 in coder app when pulling stats #16

@bjornrobertsson

Description

@bjornrobertsson

Changes in cgroupv2 cause coder stat to fail for CPU and memory

$ coder stat mem
Encountered an error running "coder stat mem", see "coder stat mem --help" for more information
error: read memory total: read /sys/fs/cgroup/memory/memory.limit_in_bytes: open /sys/fs/cgroup/memory/memory.limit_in_bytes: no such file or directory

This happens when cgroupv2 is active, and you're inside a container.

The default location of these for cgroupv2 has changed to, i.e.: /sys/fs/cgroup/memory.max BUT this is only true of a 'native' execution, i.e. a VM/host/node. When you run inside a container (read as a pod in k8s) the files will be split up, i.e. /sys/fs/cgroup/system.slice/memory.max or address with some 'obscure' identifiers.

The current agents are therefore likely to show up as failing due to not finding the right resource.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions