avtomatika-worker 1.0b4__tar.gz → 1.0b5__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.
- {avtomatika_worker-1.0b4/src/avtomatika_worker.egg-info → avtomatika_worker-1.0b5}/PKG-INFO +7 -13
- {avtomatika_worker-1.0b4 → avtomatika_worker-1.0b5}/README.md +6 -12
- {avtomatika_worker-1.0b4 → avtomatika_worker-1.0b5}/pyproject.toml +1 -1
- {avtomatika_worker-1.0b4 → avtomatika_worker-1.0b5}/src/avtomatika_worker/types.py +20 -0
- {avtomatika_worker-1.0b4 → avtomatika_worker-1.0b5/src/avtomatika_worker.egg-info}/PKG-INFO +7 -13
- {avtomatika_worker-1.0b4 → avtomatika_worker-1.0b5}/LICENSE +0 -0
- {avtomatika_worker-1.0b4 → avtomatika_worker-1.0b5}/setup.cfg +0 -0
- {avtomatika_worker-1.0b4 → avtomatika_worker-1.0b5}/src/avtomatika_worker/__init__.py +0 -0
- {avtomatika_worker-1.0b4 → avtomatika_worker-1.0b5}/src/avtomatika_worker/config.py +0 -0
- {avtomatika_worker-1.0b4 → avtomatika_worker-1.0b5}/src/avtomatika_worker/py.typed +0 -0
- {avtomatika_worker-1.0b4 → avtomatika_worker-1.0b5}/src/avtomatika_worker/s3.py +0 -0
- {avtomatika_worker-1.0b4 → avtomatika_worker-1.0b5}/src/avtomatika_worker/task_files.py +0 -0
- {avtomatika_worker-1.0b4 → avtomatika_worker-1.0b5}/src/avtomatika_worker/worker.py +0 -0
- {avtomatika_worker-1.0b4 → avtomatika_worker-1.0b5}/src/avtomatika_worker.egg-info/SOURCES.txt +0 -0
- {avtomatika_worker-1.0b4 → avtomatika_worker-1.0b5}/src/avtomatika_worker.egg-info/dependency_links.txt +0 -0
- {avtomatika_worker-1.0b4 → avtomatika_worker-1.0b5}/src/avtomatika_worker.egg-info/requires.txt +0 -0
- {avtomatika_worker-1.0b4 → avtomatika_worker-1.0b5}/src/avtomatika_worker.egg-info/top_level.txt +0 -0
- {avtomatika_worker-1.0b4 → avtomatika_worker-1.0b5}/tests/test_concurrency_limits.py +0 -0
- {avtomatika_worker-1.0b4 → avtomatika_worker-1.0b5}/tests/test_config.py +0 -0
- {avtomatika_worker-1.0b4 → avtomatika_worker-1.0b5}/tests/test_dependency_injection.py +0 -0
- {avtomatika_worker-1.0b4 → avtomatika_worker-1.0b5}/tests/test_init.py +0 -0
- {avtomatika_worker-1.0b4 → avtomatika_worker-1.0b5}/tests/test_parameter_typing.py +0 -0
- {avtomatika_worker-1.0b4 → avtomatika_worker-1.0b5}/tests/test_per_orchestrator_token.py +0 -0
- {avtomatika_worker-1.0b4 → avtomatika_worker-1.0b5}/tests/test_s3.py +0 -0
- {avtomatika_worker-1.0b4 → avtomatika_worker-1.0b5}/tests/test_task_files_extended.py +0 -0
- {avtomatika_worker-1.0b4 → avtomatika_worker-1.0b5}/tests/test_types.py +0 -0
- {avtomatika_worker-1.0b4 → avtomatika_worker-1.0b5}/tests/test_validation.py +0 -0
- {avtomatika_worker-1.0b4 → avtomatika_worker-1.0b5}/tests/test_worker_logic.py +0 -0
- {avtomatika_worker-1.0b4 → avtomatika_worker-1.0b5}/tests/test_worker_more_logic.py +0 -0
- {avtomatika_worker-1.0b4 → avtomatika_worker-1.0b5}/tests/test_worker_sdk.py +0 -0
- {avtomatika_worker-1.0b4 → avtomatika_worker-1.0b5}/tests/test_wrr_logic.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: avtomatika-worker
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.0b5
|
|
4
4
|
Summary: Worker SDK for the Avtomatika orchestrator.
|
|
5
5
|
Author-email: Dmitrii Gagarin <madgagarin@gmail.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/avtomatika-ai/avtomatika-worker
|
|
@@ -302,6 +302,7 @@ Each handler is a function (either `async def` or `def`) that accepts two argume
|
|
|
302
302
|
- `task_id` (`str`): The unique ID of the task itself.
|
|
303
303
|
- `job_id` (`str`): The ID of the parent `Job` to which the task belongs.
|
|
304
304
|
- `priority` (`int`): The execution priority of the task.
|
|
305
|
+
- `send_progress` (`callable`): An async function `await send_progress(progress_float, message_string)` to report task execution progress (0.0 to 1.0) to the orchestrator.
|
|
305
306
|
|
|
306
307
|
**Synchronous Handlers:**
|
|
307
308
|
If you define your handler as a standard synchronous function (`def handler(...)`), the SDK will automatically execute it in a separate thread using `asyncio.to_thread`. This ensures that CPU-intensive operations (like model inference) do not block the worker's main event loop, allowing heartbeats and other background tasks to continue running smoothly.
|
|
@@ -404,7 +405,7 @@ return {
|
|
|
404
405
|
|
|
405
406
|
#### Error Handling
|
|
406
407
|
|
|
407
|
-
To control the orchestrator's fault tolerance mechanism, you can return standardized error types.
|
|
408
|
+
To control the orchestrator's fault tolerance mechanism, you can return standardized error types. All error constants can be imported from `avtomatika_worker.typing`.
|
|
408
409
|
|
|
409
410
|
- **Transient Error (`TRANSIENT_ERROR`)**: For issues that might be resolved on a retry (e.g., a network failure).
|
|
410
411
|
```python
|
|
@@ -417,17 +418,10 @@ To control the orchestrator's fault tolerance mechanism, you can return standard
|
|
|
417
418
|
}
|
|
418
419
|
}
|
|
419
420
|
```
|
|
420
|
-
- **Permanent Error (`PERMANENT_ERROR`)**: For unresolvable problems (e.g., an invalid file format).
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
"status": "failure",
|
|
425
|
-
"error": {
|
|
426
|
-
"code": PERMANENT_ERROR,
|
|
427
|
-
"message": "Corrupted input file"
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
|
-
```
|
|
421
|
+
- **Permanent Error (`PERMANENT_ERROR`)**: For unresolvable problems (e.g., an invalid file format). Causes immediate quarantine.
|
|
422
|
+
- **Security Error (`SECURITY_ERROR`)**: For security violations. Causes immediate quarantine.
|
|
423
|
+
- **Dependency Error (`DEPENDENCY_ERROR`)**: For missing models or tools. Causes immediate quarantine.
|
|
424
|
+
- **Resource Exhausted (`RESOURCE_EXHAUSTED_ERROR`)**: When resources are temporarily unavailable. Treated as transient (retried).
|
|
431
425
|
|
|
432
426
|
### 4. Failover and Load Balancing
|
|
433
427
|
|
|
@@ -269,6 +269,7 @@ Each handler is a function (either `async def` or `def`) that accepts two argume
|
|
|
269
269
|
- `task_id` (`str`): The unique ID of the task itself.
|
|
270
270
|
- `job_id` (`str`): The ID of the parent `Job` to which the task belongs.
|
|
271
271
|
- `priority` (`int`): The execution priority of the task.
|
|
272
|
+
- `send_progress` (`callable`): An async function `await send_progress(progress_float, message_string)` to report task execution progress (0.0 to 1.0) to the orchestrator.
|
|
272
273
|
|
|
273
274
|
**Synchronous Handlers:**
|
|
274
275
|
If you define your handler as a standard synchronous function (`def handler(...)`), the SDK will automatically execute it in a separate thread using `asyncio.to_thread`. This ensures that CPU-intensive operations (like model inference) do not block the worker's main event loop, allowing heartbeats and other background tasks to continue running smoothly.
|
|
@@ -371,7 +372,7 @@ return {
|
|
|
371
372
|
|
|
372
373
|
#### Error Handling
|
|
373
374
|
|
|
374
|
-
To control the orchestrator's fault tolerance mechanism, you can return standardized error types.
|
|
375
|
+
To control the orchestrator's fault tolerance mechanism, you can return standardized error types. All error constants can be imported from `avtomatika_worker.typing`.
|
|
375
376
|
|
|
376
377
|
- **Transient Error (`TRANSIENT_ERROR`)**: For issues that might be resolved on a retry (e.g., a network failure).
|
|
377
378
|
```python
|
|
@@ -384,17 +385,10 @@ To control the orchestrator's fault tolerance mechanism, you can return standard
|
|
|
384
385
|
}
|
|
385
386
|
}
|
|
386
387
|
```
|
|
387
|
-
- **Permanent Error (`PERMANENT_ERROR`)**: For unresolvable problems (e.g., an invalid file format).
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
"status": "failure",
|
|
392
|
-
"error": {
|
|
393
|
-
"code": PERMANENT_ERROR,
|
|
394
|
-
"message": "Corrupted input file"
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
```
|
|
388
|
+
- **Permanent Error (`PERMANENT_ERROR`)**: For unresolvable problems (e.g., an invalid file format). Causes immediate quarantine.
|
|
389
|
+
- **Security Error (`SECURITY_ERROR`)**: For security violations. Causes immediate quarantine.
|
|
390
|
+
- **Dependency Error (`DEPENDENCY_ERROR`)**: For missing models or tools. Causes immediate quarantine.
|
|
391
|
+
- **Resource Exhausted (`RESOURCE_EXHAUSTED_ERROR`)**: When resources are temporarily unavailable. Treated as transient (retried).
|
|
398
392
|
|
|
399
393
|
### 4. Failover and Load Balancing
|
|
400
394
|
|
|
@@ -1,11 +1,26 @@
|
|
|
1
1
|
from typing import Any, Awaitable, Callable, Dict
|
|
2
2
|
|
|
3
|
+
from rxon.constants import (
|
|
4
|
+
ERROR_CODE_DEPENDENCY as DEPENDENCY_ERROR,
|
|
5
|
+
)
|
|
6
|
+
from rxon.constants import (
|
|
7
|
+
ERROR_CODE_INTERNAL as INTERNAL_ERROR,
|
|
8
|
+
)
|
|
3
9
|
from rxon.constants import (
|
|
4
10
|
ERROR_CODE_INVALID_INPUT as INVALID_INPUT_ERROR,
|
|
5
11
|
)
|
|
6
12
|
from rxon.constants import (
|
|
7
13
|
ERROR_CODE_PERMANENT as PERMANENT_ERROR,
|
|
8
14
|
)
|
|
15
|
+
from rxon.constants import (
|
|
16
|
+
ERROR_CODE_RESOURCE_EXHAUSTED as RESOURCE_EXHAUSTED_ERROR,
|
|
17
|
+
)
|
|
18
|
+
from rxon.constants import (
|
|
19
|
+
ERROR_CODE_SECURITY as SECURITY_ERROR,
|
|
20
|
+
)
|
|
21
|
+
from rxon.constants import (
|
|
22
|
+
ERROR_CODE_TIMEOUT as TIMEOUT_ERROR,
|
|
23
|
+
)
|
|
9
24
|
from rxon.constants import (
|
|
10
25
|
ERROR_CODE_TRANSIENT as TRANSIENT_ERROR,
|
|
11
26
|
)
|
|
@@ -22,5 +37,10 @@ __all__ = [
|
|
|
22
37
|
"INVALID_INPUT_ERROR",
|
|
23
38
|
"PERMANENT_ERROR",
|
|
24
39
|
"TRANSIENT_ERROR",
|
|
40
|
+
"RESOURCE_EXHAUSTED_ERROR",
|
|
41
|
+
"SECURITY_ERROR",
|
|
42
|
+
"DEPENDENCY_ERROR",
|
|
43
|
+
"TIMEOUT_ERROR",
|
|
44
|
+
"INTERNAL_ERROR",
|
|
25
45
|
"ParamValidationError",
|
|
26
46
|
]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: avtomatika-worker
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.0b5
|
|
4
4
|
Summary: Worker SDK for the Avtomatika orchestrator.
|
|
5
5
|
Author-email: Dmitrii Gagarin <madgagarin@gmail.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/avtomatika-ai/avtomatika-worker
|
|
@@ -302,6 +302,7 @@ Each handler is a function (either `async def` or `def`) that accepts two argume
|
|
|
302
302
|
- `task_id` (`str`): The unique ID of the task itself.
|
|
303
303
|
- `job_id` (`str`): The ID of the parent `Job` to which the task belongs.
|
|
304
304
|
- `priority` (`int`): The execution priority of the task.
|
|
305
|
+
- `send_progress` (`callable`): An async function `await send_progress(progress_float, message_string)` to report task execution progress (0.0 to 1.0) to the orchestrator.
|
|
305
306
|
|
|
306
307
|
**Synchronous Handlers:**
|
|
307
308
|
If you define your handler as a standard synchronous function (`def handler(...)`), the SDK will automatically execute it in a separate thread using `asyncio.to_thread`. This ensures that CPU-intensive operations (like model inference) do not block the worker's main event loop, allowing heartbeats and other background tasks to continue running smoothly.
|
|
@@ -404,7 +405,7 @@ return {
|
|
|
404
405
|
|
|
405
406
|
#### Error Handling
|
|
406
407
|
|
|
407
|
-
To control the orchestrator's fault tolerance mechanism, you can return standardized error types.
|
|
408
|
+
To control the orchestrator's fault tolerance mechanism, you can return standardized error types. All error constants can be imported from `avtomatika_worker.typing`.
|
|
408
409
|
|
|
409
410
|
- **Transient Error (`TRANSIENT_ERROR`)**: For issues that might be resolved on a retry (e.g., a network failure).
|
|
410
411
|
```python
|
|
@@ -417,17 +418,10 @@ To control the orchestrator's fault tolerance mechanism, you can return standard
|
|
|
417
418
|
}
|
|
418
419
|
}
|
|
419
420
|
```
|
|
420
|
-
- **Permanent Error (`PERMANENT_ERROR`)**: For unresolvable problems (e.g., an invalid file format).
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
"status": "failure",
|
|
425
|
-
"error": {
|
|
426
|
-
"code": PERMANENT_ERROR,
|
|
427
|
-
"message": "Corrupted input file"
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
|
-
```
|
|
421
|
+
- **Permanent Error (`PERMANENT_ERROR`)**: For unresolvable problems (e.g., an invalid file format). Causes immediate quarantine.
|
|
422
|
+
- **Security Error (`SECURITY_ERROR`)**: For security violations. Causes immediate quarantine.
|
|
423
|
+
- **Dependency Error (`DEPENDENCY_ERROR`)**: For missing models or tools. Causes immediate quarantine.
|
|
424
|
+
- **Resource Exhausted (`RESOURCE_EXHAUSTED_ERROR`)**: When resources are temporarily unavailable. Treated as transient (retried).
|
|
431
425
|
|
|
432
426
|
### 4. Failover and Load Balancing
|
|
433
427
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{avtomatika_worker-1.0b4 → avtomatika_worker-1.0b5}/src/avtomatika_worker.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{avtomatika_worker-1.0b4 → avtomatika_worker-1.0b5}/src/avtomatika_worker.egg-info/requires.txt
RENAMED
|
File without changes
|
{avtomatika_worker-1.0b4 → avtomatika_worker-1.0b5}/src/avtomatika_worker.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|