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

Support cgroups v1 and v2 for memory limits #1286

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Support cgroups v1 and v2 for memory limits #1286

wants to merge 3 commits into from

Commits on Jun 27, 2024

  1. Configuration menu
    Copy the full SHA
    ce0a915 View commit details
    Browse the repository at this point in the history

Commits on Jul 1, 2024

  1. Read container memory limit from cgroup (v1 and v2)

    Uses memory.high if available (recommended way of setting a functioning soft limit), then first falls back to memory.max (e.g. from 'docker run -m'), then to memory.low (e.g. from 'docker run --memory-reservation'), and finally to memory.min.
    
    Falls back to direct reading of '/sys/fs/cgroup/memory/memory.limit_in_bytes' for cases where that exists, but no full cgroupfs is mounted (e.g. on Heroku).
    
    Limit enforcement (now to 8 TB) is still in place this way - a Docker v1 value will be read, and run into the limit for unrestricted containers, without hitting the fallback and getting returned.
    
    GUS-W-16052317
    dzuelke committed Jul 1, 2024
    Configuration menu
    Copy the full SHA
    7604313 View commit details
    Browse the repository at this point in the history
  2. Fix CI workflow to use bash as shell instead of sh

    From https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idcontainer:
    
    > Note: The default shell for run steps inside a container is sh instead of bash. This can be overridden with jobs.<job_id>.defaults.run or jobs.<job_id>.steps[*].shell.
    dzuelke committed Jul 1, 2024
    Configuration menu
    Copy the full SHA
    33a0414 View commit details
    Browse the repository at this point in the history