Repository navigation
Release 0.3.0: native cgroup v2 API and v1 compatibility fixes - #15
Merged
Merged
Conversation
Comment on lines
+85
to
+86
| 'import sys,time; sys.stdin.read(1); end=time.process_time()+0.2\n' | ||
| 'while time.process_time()<end: pass'], stdin=subprocess.PIPE) |
| """Use openat, or Linux procfs for the retained Python 2.7 runtime.""" | ||
| flags |= getattr(os, 'O_CLOEXEC', 0) | getattr(os, 'O_NOFOLLOW', 0) | ||
| if os.open in getattr(os, 'supports_dir_fd', ()): | ||
| return _cloexec(os.open(name, flags, dir_fd=directory)) |
| flags |= getattr(os, 'O_CLOEXEC', 0) | getattr(os, 'O_NOFOLLOW', 0) | ||
| if os.open in getattr(os, 'supports_dir_fd', ()): | ||
| return _cloexec(os.open(name, flags, dir_fd=directory)) | ||
| return _cloexec(os.open('/proc/self/fd/{}/{}'.format(directory, name), flags)) |
| self._root_fd = None | ||
| flags = os.O_RDONLY | getattr(os, 'O_DIRECTORY', 0) | ||
| flags |= getattr(os, 'O_CLOEXEC', 0) | getattr(os, 'O_NOFOLLOW', 0) | ||
| self._root_fd = _cloexec(os.open(self.root_path, flags)) |
| path = normalize_tree_path(path) | ||
| return [node for node in self.walk() if node.path == path] | ||
|
|
||
| def get_node_by_raw_path(self, path): |
| def __del__(self): | ||
| try: | ||
| self.close() | ||
| except Exception: |
| self.assertRaises(ValueError, str, rule) | ||
|
|
||
| def test_contenttype_equality_handles_other_objects(self): | ||
| self.assertFalse(DeviceAccess('c', 1, 3) == object()) |
|
|
||
| def test_contenttype_equality_handles_other_objects(self): | ||
| self.assertFalse(DeviceAccess('c', 1, 3) == object()) | ||
| self.assertFalse(DeviceThrottle(10, 8, 0) == object()) |
Comment on lines
+18
to
+21
| from ..interfaces import (BaseFileInterface, BatchWriteError, CommaDashSetFile, | ||
| DictFile, DictOrFlagFile, IntegerFile, IntegerListFile, | ||
| ListFile, MultiLineIntegerFile, OomControlFile, | ||
| SplitValueFile, TypedFile) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds an explicit, read-only-by-default cgroup v2 API with native CPU, memory, cpuset, pids and I/O controls, namespace-aware mount discovery, delegated writes and partial-command error reporting. Existing v1 APIs, value types, units, constructor defaults and Python 2.7/3.6+ compatibility remain; unsafe or malformed commands are intentionally rejected.
Repairs v1 device-rule validation, per-record kernel writes, throttle filenames, I/O parsing, subgroup construction, controller aliases and current libvirt thread layouts. Includes native API/upgrade guides, a 0.3.0 changelog, versioned installation instructions, universal wheels and source archives containing runnable tests.
Validation: all 134 tests pass on Python 2.7 and 3.6–3.15. Linux integration verifies actual v2 CPU throttling, resource commands, effective masks, freeze events, complete/partial process migrations and v1 tasks/procs commands in an isolated named hierarchy. Source/wheel builds, strict metadata checks, source-archive tests, legacy installation of the release wheel, and CodeQL checks pass. Runtime statement coverage is 92% in the local Python 3.14 run.
CI: https://github.com/cloudsigma/cgroupspy/actions/runs/40935087079
Turlo's private GitLab deployment remains unverified and unchanged. Its production pin needs downstream contract tests before rollout. GitHub release assets are prepared; PyPI publishing credentials are unavailable.