kento-core 1.6.3.dev0__tar.gz → 1.7.0.dev0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {kento_core-1.6.3.dev0/src/kento_core.egg-info → kento_core-1.7.0.dev0}/PKG-INFO +3 -1
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/README.md +12 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/pyproject.toml +7 -1
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/src/kento/__init__.py +38 -18
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/src/kento/_images.py +494 -179
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/src/kento/_instances.py +610 -290
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/src/kento/_references.py +407 -22
- kento_core-1.7.0.dev0/src/kento/_result.py +499 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/src/kento/create.py +189 -25
- kento_core-1.7.0.dev0/src/kento/extract.py +192 -0
- kento_core-1.7.0.dev0/src/kento/fetch.py +378 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/src/kento/pve.py +17 -2
- kento_core-1.7.0.dev0/src/kento/urlvm.py +96 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/src/kento/vm.py +40 -5
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/src/kento/vm_hook.py +17 -5
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0/src/kento_core.egg-info}/PKG-INFO +3 -1
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/src/kento_core.egg-info/SOURCES.txt +9 -0
- kento_core-1.7.0.dev0/src/kento_core.egg-info/requires.txt +3 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/tests/test_create.py +332 -1
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/tests/test_diagnose_module.py +41 -9
- kento_core-1.7.0.dev0/tests/test_extract.py +404 -0
- kento_core-1.7.0.dev0/tests/test_fetch.py +761 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/tests/test_hold.py +40 -14
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/tests/test_image_ops.py +119 -80
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/tests/test_image_record.py +46 -31
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/tests/test_images_types.py +39 -17
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/tests/test_init.py +17 -17
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/tests/test_instances.py +629 -154
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/tests/test_pve.py +46 -0
- kento_core-1.7.0.dev0/tests/test_references.py +1174 -0
- kento_core-1.7.0.dev0/tests/test_result.py +590 -0
- kento_core-1.7.0.dev0/tests/test_urlvm.py +328 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/tests/test_vm.py +158 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/tests/test_vm_hook.py +23 -0
- kento_core-1.6.3.dev0/tests/test_references.py +0 -606
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/LICENSE.md +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/setup.cfg +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/src/kento/_diagnosis.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/src/kento/_network.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/src/kento/_platform.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/src/kento/_storage.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/src/kento/attach.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/src/kento/cloudinit.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/src/kento/defaults.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/src/kento/destroy.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/src/kento/diagnose.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/src/kento/errors.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/src/kento/exec_cmd.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/src/kento/hook.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/src/kento/hook.sh +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/src/kento/images.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/src/kento/info.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/src/kento/inject.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/src/kento/inject.sh +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/src/kento/layers.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/src/kento/list.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/src/kento/locking.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/src/kento/logs.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/src/kento/lxc_hook.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/src/kento/portfwd.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/src/kento/reconcile.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/src/kento/reset.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/src/kento/set_cmd.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/src/kento/start.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/src/kento/stop.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/src/kento/subprocess_util.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/src/kento/suspend.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/src/kento_core.egg-info/dependency_links.txt +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/src/kento_core.egg-info/top_level.txt +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/tests/test_adopt.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/tests/test_attach.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/tests/test_cloudinit.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/tests/test_create_locking.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/tests/test_create_passthrough.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/tests/test_defaults.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/tests/test_destroy.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/tests/test_diagnose.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/tests/test_diagnosis.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/tests/test_errors.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/tests/test_exec.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/tests/test_hook.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/tests/test_image_hold.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/tests/test_images.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/tests/test_info.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/tests/test_inject.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/tests/test_layers.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/tests/test_list.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/tests/test_locking.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/tests/test_logs.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/tests/test_lxc_hook.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/tests/test_network.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/tests/test_platform.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/tests/test_portfwd.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/tests/test_reconcile.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/tests/test_reset.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/tests/test_run_or_die_integration.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/tests/test_set.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/tests/test_start.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/tests/test_stop.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/tests/test_storage.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/tests/test_subprocess_util.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/tests/test_suspend.py +0 -0
- {kento_core-1.6.3.dev0 → kento_core-1.7.0.dev0}/tests/test_validate_name.py +0 -0
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: kento-core
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.7.0.dev0
|
|
4
4
|
Summary: Kento core library — compose OCI images into LXC/VM system containers (importable engine)
|
|
5
5
|
License-Expression: GPL-3.0-only
|
|
6
6
|
Requires-Python: >=3.11
|
|
7
7
|
License-File: LICENSE.md
|
|
8
|
+
Provides-Extra: docs
|
|
9
|
+
Requires-Dist: pdoc>=14; extra == "docs"
|
|
8
10
|
Dynamic: license-file
|
|
@@ -396,8 +396,20 @@ and its writable layer. Errors if the instance is running unless
|
|
|
396
396
|
└── rootfs/ # Overlayfs mount point
|
|
397
397
|
```
|
|
398
398
|
|
|
399
|
+
## Environment overrides
|
|
400
|
+
|
|
401
|
+
- `KENTO_STATE_DIR` — base directory for the writable overlay layer (sidesteps
|
|
402
|
+
overlay-on-overlay when the default location sits on an overlayfs).
|
|
403
|
+
- `KENTO_URL_MAX_BYTES` — size cap for a URL fetch (VM URL-source rootfs /
|
|
404
|
+
kernel / initramfs). Default **2 GiB**; a fetch exceeding the cap fails.
|
|
405
|
+
- `KENTO_APPARMOR_PROFILE` — override the emitted plain-LXC AppArmor profile
|
|
406
|
+
(default `generated`).
|
|
407
|
+
|
|
399
408
|
## Documentation
|
|
400
409
|
|
|
410
|
+
- [Library Guide](docs/library-guide.md) — using `kento-core` as an importable
|
|
411
|
+
Python library (`import kento`): the typed object model, `Result` handling,
|
|
412
|
+
and URL-VM from code. Start here if you are a library consumer.
|
|
401
413
|
- [Getting Started](docs/getting-started.md) — install, first instance walkthrough
|
|
402
414
|
- [Modes](docs/modes.md) — lxc vs pve-lxc vs vm vs pve-vm, auto-detection, defaults
|
|
403
415
|
- [VM Mode](docs/vm-mode.md) — image requirements, SSH access, port forwarding
|
|
@@ -4,13 +4,19 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "kento-core"
|
|
7
|
-
version = "1.
|
|
7
|
+
version = "1.7.0.dev0"
|
|
8
8
|
description = "Kento core library — compose OCI images into LXC/VM system containers (importable engine)"
|
|
9
9
|
requires-python = ">=3.11"
|
|
10
10
|
license = "GPL-3.0-only"
|
|
11
11
|
|
|
12
12
|
# NO [project.scripts] — the console entry point lives in kento-cli (separate repo).
|
|
13
13
|
|
|
14
|
+
# Optional dependency groups. `docs` supplies the API-reference generator
|
|
15
|
+
# (pdoc renders the public docstrings to HTML). Install + generate with:
|
|
16
|
+
# pip install -e '.[docs]' then make docs
|
|
17
|
+
[project.optional-dependencies]
|
|
18
|
+
docs = ["pdoc>=14"]
|
|
19
|
+
|
|
14
20
|
[tool.setuptools.packages.find]
|
|
15
21
|
where = ["src"]
|
|
16
22
|
|
|
@@ -21,6 +21,7 @@ from kento.errors import ( # noqa: F401 (public re-export)
|
|
|
21
21
|
)
|
|
22
22
|
from kento._references import ( # noqa: F401 (public re-export)
|
|
23
23
|
MalformedReference, Endpoint, Digest, SourceReference, OciReference,
|
|
24
|
+
UrlReference,
|
|
24
25
|
)
|
|
25
26
|
from kento._network import ( # noqa: F401 (public re-export)
|
|
26
27
|
NetworkMode, ForwardProtocol, NetworkConnection,
|
|
@@ -38,11 +39,15 @@ from kento._storage import ( # noqa: F401 (public re-export)
|
|
|
38
39
|
)
|
|
39
40
|
from kento._images import ( # noqa: F401 (public re-export)
|
|
40
41
|
DiskFormat, Layer, Hold, ManagedStatus, ImageRecord, Image, LayeredImage,
|
|
41
|
-
OciImage, VolumeImage, CompositeImage,
|
|
42
|
+
OciImage, LocalDirectoryImage, VolumeImage, CompositeImage,
|
|
42
43
|
)
|
|
43
44
|
from kento._instances import ( # noqa: F401 (public re-export)
|
|
44
45
|
Instance, SystemContainer, VirtualMachine,
|
|
45
46
|
)
|
|
47
|
+
from kento._result import ( # noqa: F401 (public re-export)
|
|
48
|
+
Result, Ok, Warning, Error, Condition, Severity, ConditionKind,
|
|
49
|
+
ResultError,
|
|
50
|
+
)
|
|
46
51
|
|
|
47
52
|
# Curated public surface. The source-reference value types are re-exported
|
|
48
53
|
# flat (canonical paths kento.OciReference etc.); the `_references` module is
|
|
@@ -55,7 +60,7 @@ __all__ = [
|
|
|
55
60
|
"StopTimeout", "SubprocessError",
|
|
56
61
|
# source-reference value types (Block 01 — kento._references)
|
|
57
62
|
"MalformedReference", "Endpoint", "Digest", "SourceReference",
|
|
58
|
-
"OciReference",
|
|
63
|
+
"OciReference", "UrlReference",
|
|
59
64
|
# network value types (Block 02 — kento._network)
|
|
60
65
|
"NetworkMode", "ForwardProtocol", "NetworkConnection",
|
|
61
66
|
"HostBinding", "GuestTarget", "ForwardAddressNotImplemented",
|
|
@@ -68,16 +73,19 @@ __all__ = [
|
|
|
68
73
|
# root-storage value type (Block 03 — kento._storage)
|
|
69
74
|
"StorageMode",
|
|
70
75
|
# image family value types (Block 05 / SD1 — kento._images)
|
|
71
|
-
"DiskFormat", "Layer", "Image", "LayeredImage", "OciImage",
|
|
72
|
-
"CompositeImage",
|
|
76
|
+
"DiskFormat", "Layer", "Image", "LayeredImage", "OciImage",
|
|
77
|
+
"LocalDirectoryImage", "VolumeImage", "CompositeImage",
|
|
73
78
|
# hold pin value type (storage-depth SD2 — kento._images)
|
|
74
79
|
"Hold",
|
|
75
80
|
# typed managed-image ledger (storage-depth SD3, JC1 — kento._images)
|
|
76
81
|
"ManagedStatus", "ImageRecord",
|
|
77
82
|
# instance family handles (Block 08 — kento._instances)
|
|
78
83
|
"Instance", "SystemContainer", "VirtualMachine",
|
|
84
|
+
# Result value family (Block R1 — kento._result)
|
|
85
|
+
"Result", "Ok", "Warning", "Error", "Condition", "Severity",
|
|
86
|
+
"ConditionKind", "ResultError",
|
|
79
87
|
# module-level helpers (defined in this module)
|
|
80
|
-
"validate_name", "detect_bridge", "
|
|
88
|
+
"validate_name", "detect_bridge", "read_mode",
|
|
81
89
|
"require_root", "detect_mode", "upper_base", "sanitize_image_name",
|
|
82
90
|
"next_instance_name", "pve_config_exists", "is_running",
|
|
83
91
|
"resolve_container", "resolve_in_namespace", "resolve_any",
|
|
@@ -143,8 +151,8 @@ def detect_bridge() -> str | None:
|
|
|
143
151
|
return None
|
|
144
152
|
|
|
145
153
|
|
|
146
|
-
def
|
|
147
|
-
|
|
154
|
+
def _resolve_network(net_type: str | None, bridge_name: str | None,
|
|
155
|
+
mode: str, port: str | None = None) -> dict:
|
|
148
156
|
"""Resolve network configuration for container/VM creation.
|
|
149
157
|
|
|
150
158
|
Returns dict with keys: type, bridge, port
|
|
@@ -564,7 +572,7 @@ def check_name_conflict(name: str, target_namespace: str) -> bool:
|
|
|
564
572
|
from kento import diagnose as _diagnose_submodule # noqa: E402,F401 (cache it FIRST)
|
|
565
573
|
|
|
566
574
|
|
|
567
|
-
def diagnose(name: str | None = None) -> "Diagnosis": # noqa: F821 (Diagnosis re-exported above)
|
|
575
|
+
def diagnose(name: str | None = None) -> Result["Diagnosis"]: # noqa: F821 (Diagnosis re-exported above)
|
|
568
576
|
"""Run the host-wide (or named) diagnostic scan (§11.8 D3 b).
|
|
569
577
|
|
|
570
578
|
Runs the existing ``kento.diagnose.run_diagnostics(name)`` and projects ALL
|
|
@@ -576,14 +584,13 @@ def diagnose(name: str | None = None) -> "Diagnosis": # noqa: F821 (Diagnosis
|
|
|
576
584
|
INSTANCE / IMAGE / HOST), read-only / silent (it REPORTS, never reaps).
|
|
577
585
|
This is what ``kento diagnose`` (no instance argument) maps to.
|
|
578
586
|
* ``name=<str>`` — the same scan narrowed by ``run_diagnostics`` to the HOST
|
|
579
|
-
checks plus the ONE resolved instance's checks
|
|
580
|
-
|
|
581
|
-
findings
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
narrowed per-instance view.
|
|
587
|
+
checks plus the ONE resolved instance's checks. The findings are projected
|
|
588
|
+
UNFILTERED, preserving today's named-``diagnose`` wire (host findings +
|
|
589
|
+
that instance's findings). This is DELIBERATELY different from
|
|
590
|
+
``instance.diagnose()`` (M11), which filters to the INSTANCE domain +
|
|
591
|
+
itself and drops the host findings; the module-level function is the
|
|
592
|
+
legacy named-wire preserver, the handle method is the narrowed
|
|
593
|
+
per-instance view.
|
|
587
594
|
|
|
588
595
|
The module-level companion to ``instance.diagnose()`` (one instance's
|
|
589
596
|
INSTANCE findings) and ``image.diagnose()`` (the IMAGE domain); it mirrors
|
|
@@ -591,11 +598,24 @@ def diagnose(name: str | None = None) -> "Diagnosis": # noqa: F821 (Diagnosis
|
|
|
591
598
|
|
|
592
599
|
Performs I/O (the scan) via an explicit module-level call (§2 principle 2);
|
|
593
600
|
the returned ``Diagnosis`` is an inert value type.
|
|
601
|
+
|
|
602
|
+
Public Result boundary (Result-propagation sweep, Block S6): the normal scan
|
|
603
|
+
returns ``Ok(Diagnosis)``. The DEGRADED findings are part of a SUCCESSFUL
|
|
604
|
+
scan — a no-root / unreadable check degrades to an ``info``/``error`` FINDING
|
|
605
|
+
*inside* the report, never an ``Error`` of the Result (the scan still
|
|
606
|
+
succeeded in producing a report). The ONE predictable failure is a named
|
|
607
|
+
scoped miss: ``run_diagnostics(name)`` raises ``InstanceNotFoundError`` for
|
|
608
|
+
an unknown ``name``, caught here -> ``Error(INSTANCE_NOT_FOUND)``. A
|
|
609
|
+
non-``KentoError`` is a panic and propagates.
|
|
594
610
|
"""
|
|
595
611
|
from kento._diagnosis import diagnosis_from_report
|
|
612
|
+
from kento._result import _error_from
|
|
596
613
|
|
|
597
|
-
|
|
598
|
-
|
|
614
|
+
try:
|
|
615
|
+
report = _diagnose_submodule.run_diagnostics(name)
|
|
616
|
+
return Ok(value=diagnosis_from_report(report))
|
|
617
|
+
except KentoError as exc:
|
|
618
|
+
return _error_from(exc)
|
|
599
619
|
|
|
600
620
|
|
|
601
621
|
def version() -> str:
|