ResourcePlan#
Run commands and agent-written programs inside an operating-system boundary. See the guide.
- class zett_agent.sandbox.resources.ResourcePlan(report, rlimits=(), cgroup=None, watchdog=False, warnings=(), sample_seconds=0.25)[源代码]#
What will be done about resources for one run.
- 参数:
report (ResourceReport)
rlimits (tuple[RlimitStep, ...])
cgroup (CgroupHandle | None)
watchdog (bool)
warnings (tuple[str, ...])
sample_seconds (float)
- report#
The mechanism behind each limit, before the run measured anything.
- rlimits#
The
setrlimitcalls to make in the child.- Type:
tuple[zett_agent.sandbox.resources.RlimitStep, ...]
- cgroup#
The group the child joins, when one was created.
- Type:
- watchdog#
Whether the parent samples the process group's memory.
- Type:
bool
- warnings#
Limits that were asked for and cannot be enforced here.
- Type:
tuple[str, ...]
- sample_seconds: float#
The watchdog's sampling interval, from the limits it was planned for.
- preexec()[源代码]#
Return a callable for
subprocess'preexec_fn, or None when nothing to do.- 返回类型:
Callable[[], None] | None