habemus-papadum-hostfork
pdum.hostfork creates reusable environments derived from a Linux host, with
private writable trees, ordinary Python-owned subprocesses, aggregate resource
limits, independently enforced deadlines, and retained evidence. It is a tool for
trusted Linux operators, not a security boundary. Unchanged host paths, localhost
services and the host PID namespace remain visible.
The library requires Python 3.12+, Linux user/mount namespaces, cgroup v2 and a usable user systemd manager with PIDFD scope registration. The tested starting point is systemd 255. Prepared Btrfs snapshots, stable OverlayFS lowers and ordinary copies are supported. Hostfork never formats devices during launch.
import asyncio
from pathlib import Path
from pdum.hostfork import EnvironmentSpec, HostView, Hostfork, Lifetime, PrivateTree
async def main():
source = Path("/srv/experiment") # existing host directory
host = Hostfork("/srv/hostfork-state")
request = EnvironmentSpec(
trees={"work": PrivateTree(source, storage="copy")},
view=HostView(replace={str(source): "work"}, fresh=("/dev/shm",)),
lifetime=Lifetime(max_runtime=1200),
)
async with await host.create(request) as environment:
command = await environment.spawn(["python3", "worker.py"], cwd=source)
result = await command.wait()
print(result.returncode, result.stdout_path)
await environment.export("work", "/srv/results/finished-run")
asyncio.run(main())
The command exposes its actual asyncio.Process as native_process. Pass
asyncio.subprocess.PIPE for pipe access; file output is the default and survives
caller failure. Direct-command exit, descendant-group completion, environment
stop and filesystem deletion are separate operations.
pdum-hostfork --root /srv/hostfork-state doctor --probe
pdum-hostfork --root /srv/hostfork-state run --ttl 1200 \
--copy /srv/experiment=/srv/experiment --cwd /srv/experiment -- python3 worker.py
pdum-hostfork --root /srv/hostfork-state shell --ttl 1200 \
--copy /srv/experiment=/srv/experiment --cwd /srv/experiment
pdum-hostfork --root /srv/hostfork-state support plan
pdum-hostfork --root /srv/hostfork-state support install
pdum-hostfork --root /srv/hostfork-state reap
pdum-hostfork --root /srv/hostfork-state usage
Both a mountable app and create_app() are exported from pdum.hostfork.cli.
Importing them starts no processes or signal handlers.
Read the operator/API guide for Btrfs preparation, shared services, retention and recovery. Native macOS, private PID namespaces, allocated PTYs, FastAPI management and GPU allocation are future backends/adapters. Existing-terminal shell inheritance is supported.
Metadata
Release files for habemus-papadum-hostfork 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| habemus_papadum_hostfork-0.1.0.tar.gz | 72.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| habemus_papadum_hostfork-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 134.9 kB
Release files / habemus_papadum_hostfork-0.1.0.tar.gz
| Download URL | habemus_papadum_hostfork-0.1.0.tar.gz |
|---|---|
| Size | 72.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1fca9b9d6d37d77de8ce7aba44783b80e8be3a218adaa355c7fb6c9460ac2bee
|
|
BLAKE2b-256 checksum How to use checksums |
373d89ec88cc80896d3e444aaa095537c3cd5756457ec2670a93717399204705
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / habemus_papadum_hostfork-0.1.0-py3-none-any.whl
| Download URL | habemus_papadum_hostfork-0.1.0-py3-none-any.whl |
|---|---|
| Size | 62.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
738400d5566230005458518f37abdc85e214749445b2402bce03bfbebb6d2ed7
|
|
BLAKE2b-256 checksum How to use checksums |
62adaa93b45a74b0651aa74a1804144cac855e6b9648e1a83c13c819fa49c35a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Security for habemus-papadum-hostfork 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.