dory-sdk 2.1.0__py3-none-any.whl → 2.1.4__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.
dory/__init__.py CHANGED
@@ -28,7 +28,7 @@ Quick Start (Function-based API):
28
28
  counter.value += 1
29
29
  """
30
30
 
31
- __version__ = "1.0.0"
31
+ __version__ = "2.1.2"
32
32
 
33
33
  # Core API
34
34
  from dory.core.processor import BaseProcessor
@@ -50,6 +50,23 @@ from dory.utils.errors import (
50
50
  DoryConfigError,
51
51
  )
52
52
 
53
+ # Edge node support (fencing, split-brain prevention, heartbeat)
54
+ from dory.edge import (
55
+ FencingManager,
56
+ FencingConfig,
57
+ FencingToken,
58
+ FencingError,
59
+ FenceViolation,
60
+ StaleEpochError,
61
+ ProcessorRole,
62
+ RoleManager,
63
+ RoleTransition,
64
+ HeartbeatManager,
65
+ HeartbeatConfig,
66
+ ConnectivityStatus,
67
+ EdgeHealthReporter,
68
+ )
69
+
53
70
  __all__ = [
54
71
  # Core API
55
72
  "BaseProcessor",
@@ -65,6 +82,20 @@ __all__ = [
65
82
  "DoryShutdownError",
66
83
  "DoryStateError",
67
84
  "DoryConfigError",
85
+ # Edge node support
86
+ "FencingManager",
87
+ "FencingConfig",
88
+ "FencingToken",
89
+ "FencingError",
90
+ "FenceViolation",
91
+ "StaleEpochError",
92
+ "ProcessorRole",
93
+ "RoleManager",
94
+ "RoleTransition",
95
+ "HeartbeatManager",
96
+ "HeartbeatConfig",
97
+ "ConnectivityStatus",
98
+ "EdgeHealthReporter",
68
99
  # Version
69
100
  "__version__",
70
101
  ]
dory/config/defaults.py CHANGED
@@ -21,6 +21,12 @@ DEFAULT_CONFIG = {
21
21
  "state_s3_bucket": None,
22
22
  "state_s3_prefix": "dory-state",
23
23
 
24
+ # State transfer timeouts (aligned with Orchestrator's 30s default)
25
+ "state_capture_timeout_sec": 25, # Must be < Orchestrator's 30s timeout
26
+ "state_restore_timeout_sec": 25, # Must be < Orchestrator's 30s timeout
27
+ "state_max_size_bytes": 8 * 1024 * 1024, # 8MB (Orchestrator limit is 10MB)
28
+ "state_size_warn_threshold": 0.75, # Warn at 75% of max size
29
+
24
30
  # Recovery
25
31
  "max_restart_attempts": 3,
26
32
  "restart_backoff_sec": 10,
dory/config/schema.py CHANGED
@@ -79,6 +79,32 @@ class DoryConfig(BaseModel):
79
79
  description="S3 key prefix for state objects",
80
80
  )
81
81
 
82
+ # State transfer timeouts (must be < Orchestrator's 30s timeout)
83
+ state_capture_timeout_sec: int = Field(
84
+ default=DEFAULT_CONFIG["state_capture_timeout_sec"],
85
+ ge=1,
86
+ le=60,
87
+ description="Timeout for state capture operations (must be < Orchestrator timeout)",
88
+ )
89
+ state_restore_timeout_sec: int = Field(
90
+ default=DEFAULT_CONFIG["state_restore_timeout_sec"],
91
+ ge=1,
92
+ le=60,
93
+ description="Timeout for state restore operations (must be < Orchestrator timeout)",
94
+ )
95
+ state_max_size_bytes: int = Field(
96
+ default=DEFAULT_CONFIG["state_max_size_bytes"],
97
+ ge=1024,
98
+ le=10 * 1024 * 1024, # Max 10MB (Orchestrator limit)
99
+ description="Maximum state size in bytes (Orchestrator limit is 10MB)",
100
+ )
101
+ state_size_warn_threshold: float = Field(
102
+ default=DEFAULT_CONFIG["state_size_warn_threshold"],
103
+ ge=0.1,
104
+ le=1.0,
105
+ description="Warn when state size exceeds this fraction of max (0.0-1.0)",
106
+ )
107
+
82
108
  # Recovery
83
109
  max_restart_attempts: int = Field(
84
110
  default=DEFAULT_CONFIG["max_restart_attempts"],
dory/edge/__init__.py ADDED
@@ -0,0 +1,88 @@
1
+ """Edge node support for Dory SDK.
2
+
3
+ Provides fencing, failover coordination, and split-brain prevention
4
+ for edge nodes with intermittent connectivity.
5
+ """
6
+
7
+ from dory.edge.fencing import (
8
+ FencingManager,
9
+ FencingConfig,
10
+ FencingToken,
11
+ FencingError,
12
+ FenceViolation,
13
+ StaleEpochError,
14
+ )
15
+ from dory.edge.role import (
16
+ ProcessorRole,
17
+ RoleManager,
18
+ RoleTransition,
19
+ )
20
+ from dory.edge.heartbeat import (
21
+ HeartbeatManager,
22
+ HeartbeatConfig,
23
+ HeartbeatPayload,
24
+ HeartbeatResponse,
25
+ ConnectivityStatus,
26
+ ConnectivityMetrics,
27
+ EdgeHealthReporter,
28
+ )
29
+ from dory.edge.detector import (
30
+ WorkloadDetector,
31
+ WorkloadContext,
32
+ NodeType,
33
+ is_edge_node,
34
+ is_cloud_node,
35
+ is_migrated_workload,
36
+ get_workload_context,
37
+ get_node_type,
38
+ get_recommended_env_vars,
39
+ get_pod_spec_yaml_snippet,
40
+ )
41
+ from dory.edge.adaptive import (
42
+ AdaptiveProcessor,
43
+ AdaptiveConfig,
44
+ EdgeConfig,
45
+ OperationMode,
46
+ create_adaptive_processor,
47
+ get_location_aware_settings,
48
+ )
49
+
50
+ __all__ = [
51
+ # Fencing
52
+ "FencingManager",
53
+ "FencingConfig",
54
+ "FencingToken",
55
+ "FencingError",
56
+ "FenceViolation",
57
+ "StaleEpochError",
58
+ # Role management
59
+ "ProcessorRole",
60
+ "RoleManager",
61
+ "RoleTransition",
62
+ # Heartbeat and connectivity
63
+ "HeartbeatManager",
64
+ "HeartbeatConfig",
65
+ "HeartbeatPayload",
66
+ "HeartbeatResponse",
67
+ "ConnectivityStatus",
68
+ "ConnectivityMetrics",
69
+ "EdgeHealthReporter",
70
+ # Workload detection
71
+ "WorkloadDetector",
72
+ "WorkloadContext",
73
+ "NodeType",
74
+ "is_edge_node",
75
+ "is_cloud_node",
76
+ "is_migrated_workload",
77
+ "get_workload_context",
78
+ "get_node_type",
79
+ "get_recommended_env_vars",
80
+ "get_pod_spec_yaml_snippet",
81
+ # Adaptive processor
82
+ "AdaptiveProcessor",
83
+ "AdaptiveConfig",
84
+ "EdgeConfig",
85
+ "OperationMode",
86
+ "create_adaptive_processor",
87
+ "get_location_aware_settings",
88
+ ]