digitalkin 0.3.0__py3-none-any.whl → 0.3.0.dev1__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.
- digitalkin/__version__.py +1 -1
- digitalkin/modules/job_manager/single_job_manager.py +1 -1
- digitalkin/modules/job_manager/surrealdb_repository.py +4 -1
- digitalkin/modules/job_manager/task_manager.py +1 -3
- digitalkin/modules/job_manager/task_session.py +3 -4
- digitalkin/services/filesystem/default_filesystem.py +0 -2
- {digitalkin-0.3.0.dist-info → digitalkin-0.3.0.dev1.dist-info}/METADATA +5 -4
- {digitalkin-0.3.0.dist-info → digitalkin-0.3.0.dev1.dist-info}/RECORD +11 -11
- {digitalkin-0.3.0.dist-info → digitalkin-0.3.0.dev1.dist-info}/WHEEL +0 -0
- {digitalkin-0.3.0.dist-info → digitalkin-0.3.0.dev1.dist-info}/licenses/LICENSE +0 -0
- {digitalkin-0.3.0.dist-info → digitalkin-0.3.0.dev1.dist-info}/top_level.txt +0 -0
digitalkin/__version__.py
CHANGED
|
@@ -242,7 +242,7 @@ class SingleJobManager(BaseJobManager, TaskManager, Generic[InputModelT, OutputM
|
|
|
242
242
|
Raises:
|
|
243
243
|
Exception: If an error occurs while stopping the module.
|
|
244
244
|
"""
|
|
245
|
-
logger.
|
|
245
|
+
logger.info(f"STOP required for {job_id=}")
|
|
246
246
|
|
|
247
247
|
async with self._lock:
|
|
248
248
|
session = self.tasks_sessions.get(job_id)
|
|
@@ -75,7 +75,10 @@ class SurrealDBConnection(Generic[TSurreal]):
|
|
|
75
75
|
timeout: Timeout for database operations
|
|
76
76
|
"""
|
|
77
77
|
self.timeout = timeout
|
|
78
|
-
|
|
78
|
+
base_url = os.getenv("SURREALDB_URL", "ws://localhost").strip()
|
|
79
|
+
port = (os.getenv("SURREALDB_PORT") or "").strip()
|
|
80
|
+
self.url = f"{base_url}{f':{port}' if port else ''}/rpc"
|
|
81
|
+
|
|
79
82
|
self.username = os.getenv("SURREALDB_USERNAME", "root")
|
|
80
83
|
self.password = os.getenv("SURREALDB_PASSWORD", "root")
|
|
81
84
|
self.namespace = os.getenv("SURREALDB_NAMESPACE", "test")
|
|
@@ -123,12 +123,10 @@ class TaskManager:
|
|
|
123
123
|
completed = next(iter(done))
|
|
124
124
|
await completed
|
|
125
125
|
|
|
126
|
-
logger.critical(f"{completed=} | {main_task=} | {hb_task=} | {sig_task=}")
|
|
127
|
-
|
|
128
126
|
if completed is main_task:
|
|
129
127
|
session.status = TaskStatus.COMPLETED
|
|
130
128
|
elif completed is sig_task or (completed is hb_task and sig_task.done()):
|
|
131
|
-
logger.
|
|
129
|
+
logger.debug(f"Task cancelled due to signal {sig_task=}")
|
|
132
130
|
session.status = TaskStatus.CANCELLED
|
|
133
131
|
elif completed is hb_task:
|
|
134
132
|
session.status = TaskStatus.FAILED
|
|
@@ -90,7 +90,6 @@ class TaskSession:
|
|
|
90
90
|
if self.heartbeat_record_id is None:
|
|
91
91
|
try:
|
|
92
92
|
success = await self.db.create("heartbeats", heartbeat.model_dump())
|
|
93
|
-
logger.critical(f"{success=} | {'code' not in success}")
|
|
94
93
|
if "code" not in success:
|
|
95
94
|
self.heartbeat_record_id = success.get("id") # type: ignore
|
|
96
95
|
self._last_heartbeat = heartbeat.timestamp
|
|
@@ -138,7 +137,7 @@ class TaskSession:
|
|
|
138
137
|
|
|
139
138
|
async def generate_heartbeats(self) -> None:
|
|
140
139
|
"""Periodic heartbeat generator with cancellation support."""
|
|
141
|
-
logger.
|
|
140
|
+
logger.debug("Heartbeat started")
|
|
142
141
|
while not self.cancelled:
|
|
143
142
|
logger.debug(f"Heartbeat tick for task: '{self.task_id}' | {self.cancelled=}")
|
|
144
143
|
success = await self.send_heartbeat()
|
|
@@ -167,7 +166,7 @@ class TaskSession:
|
|
|
167
166
|
live_id, live_signals = await self.db.start_live("tasks")
|
|
168
167
|
try:
|
|
169
168
|
async for signal in live_signals:
|
|
170
|
-
logger.
|
|
169
|
+
logger.debug("Signal received for task '%s': %s", self.task_id, signal)
|
|
171
170
|
if self.cancelled:
|
|
172
171
|
break
|
|
173
172
|
|
|
@@ -199,7 +198,7 @@ class TaskSession:
|
|
|
199
198
|
|
|
200
199
|
async def _handle_cancel(self) -> None:
|
|
201
200
|
"""Idempotent cancellation with acknowledgment."""
|
|
202
|
-
logger.
|
|
201
|
+
logger.debug("Handle cancel called")
|
|
203
202
|
if self.is_cancelled.is_set():
|
|
204
203
|
logger.debug(
|
|
205
204
|
"Cancel signal ignored - task already cancelled: '%s'", self.task_id, extra={"task_id": self.task_id}
|
|
@@ -198,8 +198,6 @@ class DefaultFilesystem(FilesystemStrategy):
|
|
|
198
198
|
end_idx = start_idx + list_size
|
|
199
199
|
paginated_files = filtered_files[start_idx:end_idx]
|
|
200
200
|
|
|
201
|
-
logger.critical(f"{filters=} | {paginated_files=}")
|
|
202
|
-
|
|
203
201
|
if include_content:
|
|
204
202
|
for file in paginated_files:
|
|
205
203
|
file.content = Path(file.storage_uri).read_bytes()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: digitalkin
|
|
3
|
-
Version: 0.3.0
|
|
3
|
+
Version: 0.3.0.dev1
|
|
4
4
|
Summary: SDK to build kin used in DigitalKin
|
|
5
5
|
Author-email: "DigitalKin.ai" <contact@digitalkin.ai>
|
|
6
6
|
License: Attribution-NonCommercial-ShareAlike 4.0 International
|
|
@@ -456,7 +456,7 @@ Requires-Dist: digitalkin-proto>=0.1.16
|
|
|
456
456
|
Requires-Dist: grpcio-health-checking>=1.71.0
|
|
457
457
|
Requires-Dist: grpcio-reflection>=1.71.0
|
|
458
458
|
Requires-Dist: grpcio-status>=1.71.0
|
|
459
|
-
Requires-Dist: pydantic>=2.
|
|
459
|
+
Requires-Dist: pydantic>=2.12.1
|
|
460
460
|
Requires-Dist: surrealdb>=1.0.6
|
|
461
461
|
Provides-Extra: taskiq
|
|
462
462
|
Requires-Dist: rstream>=0.31.0; extra == "taskiq"
|
|
@@ -469,7 +469,7 @@ Requires-Dist: ruff>=0.13.3; extra == "dev"
|
|
|
469
469
|
Requires-Dist: mypy>=1.18.2; extra == "dev"
|
|
470
470
|
Requires-Dist: pyright>=1.1.406; extra == "dev"
|
|
471
471
|
Requires-Dist: pre-commit>=4.3.0; extra == "dev"
|
|
472
|
-
Requires-Dist:
|
|
472
|
+
Requires-Dist: bump-my-version>=1.2.4; extra == "dev"
|
|
473
473
|
Requires-Dist: build>=1.3.0; extra == "dev"
|
|
474
474
|
Requires-Dist: twine>=6.2.0; extra == "dev"
|
|
475
475
|
Requires-Dist: cryptography>=46.0.2; extra == "dev"
|
|
@@ -481,7 +481,8 @@ Requires-Dist: psutil>=7.0.0; extra == "tests"
|
|
|
481
481
|
Requires-Dist: pytest>=8.4.2; extra == "tests"
|
|
482
482
|
Requires-Dist: pytest-asyncio>=1.2.0; extra == "tests"
|
|
483
483
|
Requires-Dist: pytest-cov>=7.0.0; extra == "tests"
|
|
484
|
-
Requires-Dist:
|
|
484
|
+
Requires-Dist: pytest-html==4.1.1; extra == "tests"
|
|
485
|
+
Requires-Dist: pytest-json-report==1.5.0; extra == "tests"
|
|
485
486
|
Dynamic: license-file
|
|
486
487
|
|
|
487
488
|
# DigitalKin Python SDK
|
|
@@ -7,7 +7,7 @@ base_server/mock/__init__.py,sha256=YZFT-F1l_TpvJYuIPX-7kTeE1CfOjhx9YmNRXVoi-jQ,
|
|
|
7
7
|
base_server/mock/mock_pb2.py,sha256=sETakcS3PAAm4E-hTCV1jIVaQTPEAIoVVHupB8Z_k7Y,1843
|
|
8
8
|
base_server/mock/mock_pb2_grpc.py,sha256=BbOT70H6q3laKgkHfOx1QdfmCS_HxCY4wCOX84YAdG4,3180
|
|
9
9
|
digitalkin/__init__.py,sha256=7LLBAba0th-3SGqcpqFO-lopWdUkVLKzLZiMtB-mW3M,162
|
|
10
|
-
digitalkin/__version__.py,sha256=
|
|
10
|
+
digitalkin/__version__.py,sha256=TouYEd0hGF2qSimjErQ5O3uouXtxL5suh2P6BxRWN2c,195
|
|
11
11
|
digitalkin/logger.py,sha256=8ze_tjt2G6mDTuQcsf7-UTXWP3UHZ7LZVSs_iqF4rX4,4685
|
|
12
12
|
digitalkin/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
13
|
digitalkin/grpc_servers/__init__.py,sha256=0cJBlwipSmFdXkyH3T0i6OJ1WpAtNsZgYX7JaSnkbtg,804
|
|
@@ -46,10 +46,10 @@ digitalkin/modules/tool_module.py,sha256=rLJfdYMWddiUgPLBDGG_UcHnRCHEeaqX6Fdp4DO
|
|
|
46
46
|
digitalkin/modules/trigger_handler.py,sha256=qPNMi-8NHqscOxciHeaXtpwjXApT3YzjMF23zQAjaZY,1770
|
|
47
47
|
digitalkin/modules/job_manager/base_job_manager.py,sha256=iDv9caispLmM7mqPgG_g7oaACMvNW7i7MTzBeSlmNp0,6355
|
|
48
48
|
digitalkin/modules/job_manager/job_manager_models.py,sha256=onHy-DfInLZQveniMIWIKwTKSQjojz500JvHB54x93c,1129
|
|
49
|
-
digitalkin/modules/job_manager/single_job_manager.py,sha256=
|
|
50
|
-
digitalkin/modules/job_manager/surrealdb_repository.py,sha256=
|
|
51
|
-
digitalkin/modules/job_manager/task_manager.py,sha256=
|
|
52
|
-
digitalkin/modules/job_manager/task_session.py,sha256=
|
|
49
|
+
digitalkin/modules/job_manager/single_job_manager.py,sha256=rJ6ppgXQkLu2X4NF2oicWf3rutYN4Qtfey3EM7ONfKM,11155
|
|
50
|
+
digitalkin/modules/job_manager/surrealdb_repository.py,sha256=qGDDEEV80vKVUe4r2yvTqTNfKrQoiZjeFok01rn_eaE,7798
|
|
51
|
+
digitalkin/modules/job_manager/task_manager.py,sha256=Z_luiGdHg6jnNSslf9Dl8m9w6PIBtgrOHZXfyikBVwY,14336
|
|
52
|
+
digitalkin/modules/job_manager/task_session.py,sha256=KpBoOH2ND7UQauRok7pGsNfybH-rQDIwvdtg07ZFz40,9573
|
|
53
53
|
digitalkin/modules/job_manager/taskiq_broker.py,sha256=4q3U03SNlb1ypup0VOa73KHLKJ9peuZUPCR5eFLMNAk,7498
|
|
54
54
|
digitalkin/modules/job_manager/taskiq_job_manager.py,sha256=NHSGsqqKCWQQqx0FqM3c4tf011vFlqX1npHkcv0kEOU,10249
|
|
55
55
|
digitalkin/services/__init__.py,sha256=LqGk_5DJy8Bzz62ajIq9jCeYNKQUIgtSCpafZk15FLc,910
|
|
@@ -64,7 +64,7 @@ digitalkin/services/cost/cost_strategy.py,sha256=MpPX33P_S5b2by6F4zT-rcyeRuh2V4N
|
|
|
64
64
|
digitalkin/services/cost/default_cost.py,sha256=XE7kNFde8NmbulU9m1lc3mi-vHFkbaJf0XHUc0D4UHE,3945
|
|
65
65
|
digitalkin/services/cost/grpc_cost.py,sha256=cGtb0atPXSEEOrNIWee-o3ScfNRSAFXJGDu0vcWT6zg,6295
|
|
66
66
|
digitalkin/services/filesystem/__init__.py,sha256=BhwMl_BUvM0d65fmglkp0SVwn3RfYiUOKJgIMnOCaGM,381
|
|
67
|
-
digitalkin/services/filesystem/default_filesystem.py,sha256=
|
|
67
|
+
digitalkin/services/filesystem/default_filesystem.py,sha256=WQbU-Bsi9r-28VqhKbrplce3otzjSKS-5iqKEpGWdQU,15117
|
|
68
68
|
digitalkin/services/filesystem/filesystem_strategy.py,sha256=zibVLvX_IBQ-kgh-KYzHdszDeiHFPEAZszu_k99x1GQ,9487
|
|
69
69
|
digitalkin/services/filesystem/grpc_filesystem.py,sha256=ilxTFjelmf8_bVSs3xLlsyWFHVlSJf27c4j8H7R1Rkw,12987
|
|
70
70
|
digitalkin/services/identity/__init__.py,sha256=InkeyLgFYYwItx8mePA8HpfacOMWZwwuc0G4pWtKq9s,270
|
|
@@ -89,14 +89,14 @@ digitalkin/utils/arg_parser.py,sha256=nvjI1pKDY1HfS0oGcMQPtdTQcggXLtpxXMbnMxNEKR
|
|
|
89
89
|
digitalkin/utils/development_mode_action.py,sha256=TqRuAF_A7bDD4twRB4PnZcRoNeaiAnEdxM5kvy4aoaA,1511
|
|
90
90
|
digitalkin/utils/llm_ready_schema.py,sha256=JjMug_lrQllqFoanaC091VgOqwAd-_YzcpqFlS7p778,2375
|
|
91
91
|
digitalkin/utils/package_discover.py,sha256=3e9-6Vf3yAAv2VkHHVK4QVqHJBxQqg3d8uuDTsXph24,13471
|
|
92
|
-
digitalkin-0.3.0.dist-info/licenses/LICENSE,sha256=Ies4HFv2r2hzDRakJYxk3Y60uDFLiG-orIgeTpstnIo,20327
|
|
92
|
+
digitalkin-0.3.0.dev1.dist-info/licenses/LICENSE,sha256=Ies4HFv2r2hzDRakJYxk3Y60uDFLiG-orIgeTpstnIo,20327
|
|
93
93
|
modules/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
94
94
|
modules/cpu_intensive_module.py,sha256=ejB9XPnFfA0uCuFUQbM3fy5UYfqqAlF36rv_P5Ri8ho,8363
|
|
95
95
|
modules/minimal_llm_module.py,sha256=Ijld__ZnhzfLwpXD1XVkLZ7jyKZKyOFZczOpiPttJZc,11216
|
|
96
96
|
modules/text_transform_module.py,sha256=bwPSnEUthZQyfLwcTLo52iAxItAoknkLh8Y3m5aywaY,7251
|
|
97
97
|
services/filesystem_module.py,sha256=71Mcja8jCQqiqFHPdsIXplFIHTvgkxRhp0TRXuCfgkk,7430
|
|
98
98
|
services/storage_module.py,sha256=ybTMqmvGaTrR8PqJ4FU0cwxaDjT36TskVrGoetTGmno,6955
|
|
99
|
-
digitalkin-0.3.0.dist-info/METADATA,sha256=
|
|
100
|
-
digitalkin-0.3.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
101
|
-
digitalkin-0.3.0.dist-info/top_level.txt,sha256=gcjqlyrZuLjIyxrOIavCQM_olpr6ND5kPKkZd2j0xGo,40
|
|
102
|
-
digitalkin-0.3.0.dist-info/RECORD,,
|
|
99
|
+
digitalkin-0.3.0.dev1.dist-info/METADATA,sha256=1slDz-MhzogLJEErQ7zxlqIo5IneECx-NxLzGOJdXUg,30653
|
|
100
|
+
digitalkin-0.3.0.dev1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
101
|
+
digitalkin-0.3.0.dev1.dist-info/top_level.txt,sha256=gcjqlyrZuLjIyxrOIavCQM_olpr6ND5kPKkZd2j0xGo,40
|
|
102
|
+
digitalkin-0.3.0.dev1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|