datadouble 0.0.3__py3-none-any.whl
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.
- datadouble/__init__.py +10 -0
- datadouble/announce.py +380 -0
- datadouble/anonymize.py +165 -0
- datadouble/api.py +1159 -0
- datadouble/boundary.py +47 -0
- datadouble/catalog.py +677 -0
- datadouble/channels.py +62 -0
- datadouble/ci.py +1357 -0
- datadouble/cli.py +940 -0
- datadouble/closure.py +712 -0
- datadouble/engine.py +435 -0
- datadouble/files.py +78 -0
- datadouble/images.py +265 -0
- datadouble/jailer.py +403 -0
- datadouble/names.py +114 -0
- datadouble/notify.py +262 -0
- datadouble/objects.py +195 -0
- datadouble/outcome.py +27 -0
- datadouble/pii.py +109 -0
- datadouble/planner.py +1492 -0
- datadouble/programs.py +68 -0
- datadouble/promote.py +190 -0
- datadouble/prune.py +258 -0
- datadouble/py.typed +0 -0
- datadouble/redaction.py +131 -0
- datadouble/registry.py +128 -0
- datadouble/replicate.py +562 -0
- datadouble/resolve.py +201 -0
- datadouble/run.py +1075 -0
- datadouble/runtime.py +154 -0
- datadouble/secrets.py +57 -0
- datadouble/settings.py +81 -0
- datadouble/signing.py +98 -0
- datadouble/spec.py +1590 -0
- datadouble/staging.py +346 -0
- datadouble/storage.py +222 -0
- datadouble/strict.py +498 -0
- datadouble/subset.py +406 -0
- datadouble/verify.py +171 -0
- datadouble/versions.py +25 -0
- datadouble-0.0.3.dist-info/METADATA +36 -0
- datadouble-0.0.3.dist-info/RECORD +45 -0
- datadouble-0.0.3.dist-info/WHEEL +4 -0
- datadouble-0.0.3.dist-info/entry_points.txt +12 -0
- datadouble-0.0.3.dist-info/licenses/LICENSE +21 -0
datadouble/boundary.py
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Copyright (c) 2026- Tight Line LLC
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
"""The production boundary: the mark a machine needs to read production data.
|
|
5
|
+
|
|
6
|
+
Reading a spec's source and promoting an image happen only on machines whose
|
|
7
|
+
operators have marked them as inside the production boundary, by setting
|
|
8
|
+
``DATADOUBLE_BOUNDARY=inside`` in the runner's environment (decision 98). A
|
|
9
|
+
machine nobody marked, such as a CI vendor's hosted runner, is refused before
|
|
10
|
+
anything connects. A machine a CI/CD adapter recognizes as its vendor's
|
|
11
|
+
hosted runner is refused even when marked (decision 19).
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
import os
|
|
15
|
+
from typing import TYPE_CHECKING
|
|
16
|
+
|
|
17
|
+
if TYPE_CHECKING:
|
|
18
|
+
from datadouble.registry import Registry
|
|
19
|
+
|
|
20
|
+
VARIABLE = "DATADOUBLE_BOUNDARY"
|
|
21
|
+
INSIDE = "inside"
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class BoundaryError(Exception):
|
|
25
|
+
"""An operation that needs the production boundary, on a machine not marked inside it."""
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def require_inside(action: str, registry: "Registry") -> None:
|
|
29
|
+
"""Fail unless this machine is marked as inside the production boundary.
|
|
30
|
+
|
|
31
|
+
Every installed CI/CD adapter is asked whether the machine is its vendor's
|
|
32
|
+
hosted runner, whichever system the request names.
|
|
33
|
+
"""
|
|
34
|
+
if os.environ.get(VARIABLE) != INSIDE:
|
|
35
|
+
message = (
|
|
36
|
+
f"{action} runs only on machines marked as inside the production boundary; once"
|
|
37
|
+
f" this one is, set {VARIABLE}={INSIDE} in its environment (decision 98)"
|
|
38
|
+
)
|
|
39
|
+
raise BoundaryError(message)
|
|
40
|
+
for name in sorted(registry.ci):
|
|
41
|
+
hosted = registry.ci_system(name).vendor_hosted(os.environ)
|
|
42
|
+
if hosted is not None:
|
|
43
|
+
message = (
|
|
44
|
+
f"{action} never runs on a CI vendor's hosted runner, and this is {hosted};"
|
|
45
|
+
" run it on a runner inside the production boundary (decision 19)"
|
|
46
|
+
)
|
|
47
|
+
raise BoundaryError(message)
|