Skip to content

[agent_docker] add support for cgroups v2#1116

Open
anthonygego wants to merge 3 commits into
mainfrom
cgroupsv2
Open

[agent_docker] add support for cgroups v2#1116
anthonygego wants to merge 3 commits into
mainfrom
cgroupsv2

Conversation

@anthonygego

Copy link
Copy Markdown
Member

This PR follows #1115 and adds full support for cgroups v2. It preserves the cgroups v1 support as this is still the default in some RHEL versions.

  • The Docker interface file is modified to detect the cgroups version return by the Docker API
  • With cgroups v1, the OOM Killer is disabled. OOM is caught in Docker events, and the container is then killed by INGInious.
  • With cgroups v2, the container checks if memory.oom.group set to 1 to ensure all the container tasks are killed by the OOM killer once one it runs out of memory, since the OOM killer cannot be disabled anymore. This results in the container being killed by the system and INGInious checking if it died from OOM.
  • The documentation is updated and now explains how to ensure systemd set the memory.oom.group flag to 1 for containers spawned by the Docker daemon.

This full support for cgroups v2 allows to runs the code with rootless podman socket set as DOCKER_HOST. Since podman does not support enumerating container runtimes from the API and that podman-py does not implement container attach yet, I suggest to keep Docker as the recommended runtime for now, yet I mention it is compatible in the doc.

@anthonygego anthonygego requested a review from nrybowski June 4, 2026 15:57
@anthonygego anthonygego changed the title [agent_docker] add supports for cgroupsv2 [agent_docker] add supports for cgroups v2 Jun 4, 2026
@codacy-production

codacy-production Bot commented Jun 4, 2026

Copy link
Copy Markdown

Not up to standards β›”

πŸ”΄ Issues 1 medium

Alerts:
⚠ 1 issue (≀ 0 issues of at least minor severity)

Results:
1 new issue

Category Results
Security 1 medium

View in Codacy

🟒 Metrics 6 complexity · 2 duplication

Metric Results
Complexity 6
Duplication 2

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@anthonygego anthonygego changed the title [agent_docker] add supports for cgroups v2 [agent_docker] add support for cgroups v2 Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant