avtomatika 1.0b8__py3-none-any.whl → 1.0b9__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.
- avtomatika/api/handlers.py +3 -255
- avtomatika/api/routes.py +42 -63
- avtomatika/app_keys.py +1 -0
- avtomatika/config.py +8 -0
- avtomatika/constants.py +2 -26
- avtomatika/data_types.py +2 -22
- avtomatika/dispatcher.py +1 -0
- avtomatika/engine.py +109 -6
- avtomatika/executor.py +19 -19
- avtomatika/s3.py +96 -40
- avtomatika/security.py +56 -74
- avtomatika/services/__init__.py +0 -0
- avtomatika/services/worker_service.py +266 -0
- avtomatika/storage/base.py +10 -0
- avtomatika/storage/memory.py +12 -1
- avtomatika/storage/redis.py +33 -3
- avtomatika/watcher.py +4 -2
- avtomatika/ws_manager.py +3 -3
- {avtomatika-1.0b8.dist-info → avtomatika-1.0b9.dist-info}/METADATA +39 -13
- {avtomatika-1.0b8.dist-info → avtomatika-1.0b9.dist-info}/RECORD +23 -21
- {avtomatika-1.0b8.dist-info → avtomatika-1.0b9.dist-info}/WHEEL +1 -1
- {avtomatika-1.0b8.dist-info → avtomatika-1.0b9.dist-info}/licenses/LICENSE +0 -0
- {avtomatika-1.0b8.dist-info → avtomatika-1.0b9.dist-info}/top_level.txt +0 -0
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: avtomatika
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.0b9
|
|
4
4
|
Summary: A state-machine based orchestrator for long-running AI and other jobs.
|
|
5
|
+
Author-email: Dmitrii Gagarin <madgagarin@gmail.com>
|
|
5
6
|
Project-URL: Homepage, https://github.com/avtomatika-ai/avtomatika
|
|
6
7
|
Project-URL: Bug Tracker, https://github.com/avtomatika-ai/avtomatika/issues
|
|
8
|
+
Keywords: orchestrator,state-machine,workflow,distributed,ai,llm,rxon,hln
|
|
7
9
|
Classifier: Development Status :: 4 - Beta
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
8
11
|
Classifier: Programming Language :: Python :: 3
|
|
9
12
|
Classifier: License :: OSI Approved :: MIT License
|
|
10
13
|
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Typing :: Typed
|
|
11
15
|
Requires-Python: >=3.11
|
|
12
16
|
Description-Content-Type: text/markdown
|
|
13
17
|
License-File: LICENSE
|
|
18
|
+
Requires-Dist: rxon
|
|
14
19
|
Requires-Dist: aiohttp~=3.12
|
|
15
20
|
Requires-Dist: python-json-logger~=4.0
|
|
16
21
|
Requires-Dist: graphviz~=0.21
|
|
@@ -22,7 +27,7 @@ Provides-Extra: redis
|
|
|
22
27
|
Requires-Dist: redis~=7.1; extra == "redis"
|
|
23
28
|
Provides-Extra: s3
|
|
24
29
|
Requires-Dist: obstore>=0.2; extra == "s3"
|
|
25
|
-
Requires-Dist: aiofiles~=
|
|
30
|
+
Requires-Dist: aiofiles~=25.1; extra == "s3"
|
|
26
31
|
Provides-Extra: history
|
|
27
32
|
Requires-Dist: aiosqlite~=0.22; extra == "history"
|
|
28
33
|
Requires-Dist: asyncpg~=0.30; extra == "history"
|
|
@@ -41,7 +46,7 @@ Requires-Dist: aioresponses~=0.7; extra == "test"
|
|
|
41
46
|
Requires-Dist: backports.zstd~=1.2; extra == "test"
|
|
42
47
|
Requires-Dist: opentelemetry-instrumentation-aiohttp-client; extra == "test"
|
|
43
48
|
Requires-Dist: obstore>=0.2; extra == "test"
|
|
44
|
-
Requires-Dist: aiofiles~=
|
|
49
|
+
Requires-Dist: aiofiles~=25.1; extra == "test"
|
|
45
50
|
Provides-Extra: all
|
|
46
51
|
Requires-Dist: avtomatika[redis]; extra == "all"
|
|
47
52
|
Requires-Dist: avtomatika[history]; extra == "all"
|
|
@@ -51,6 +56,11 @@ Dynamic: license-file
|
|
|
51
56
|
|
|
52
57
|
# Avtomatika Orchestrator
|
|
53
58
|
|
|
59
|
+
[](https://opensource.org/licenses/MIT)
|
|
60
|
+
[](https://www.python.org/downloads/release/python-3110/)
|
|
61
|
+
[](https://github.com/avtomatika-ai/avtomatika/actions/workflows/ci.yml)
|
|
62
|
+
[](https://github.com/astral-sh/ruff)
|
|
63
|
+
|
|
54
64
|
Avtomatika is a powerful, state-driven engine for managing complex asynchronous workflows in Python. It provides a robust framework for building scalable and resilient applications by separating process logic from execution logic.
|
|
55
65
|
|
|
56
66
|
This document serves as a comprehensive guide for developers looking to build pipelines (blueprints) and embed the Orchestrator into their applications.
|
|
@@ -88,8 +98,9 @@ The project is based on a simple yet powerful architectural pattern that separat
|
|
|
88
98
|
|
|
89
99
|
Avtomatika is part of a larger ecosystem:
|
|
90
100
|
|
|
101
|
+
* **[Avtomatika Protocol](https://github.com/avtomatika-ai/rxon)**: Shared package containing protocol definitions, data models, and utilities ensuring consistency across all components.
|
|
91
102
|
* **[Avtomatika Worker SDK](https://github.com/avtomatika-ai/avtomatika-worker)**: The official Python SDK for building workers that connect to this engine.
|
|
92
|
-
* **[
|
|
103
|
+
* **[HLN Protocol](https://github.com/avtomatika-ai/hln)**: The architectural specification and manifesto behind the system (Hierarchical Logic Network).
|
|
93
104
|
* **[Full Example](https://github.com/avtomatika-ai/avtomatika-full-example)**: A complete reference project demonstrating the engine and workers in action.
|
|
94
105
|
|
|
95
106
|
## Installation
|
|
@@ -140,7 +151,7 @@ storage = MemoryStorage()
|
|
|
140
151
|
config = Config() # Loads configuration from environment variables
|
|
141
152
|
|
|
142
153
|
# Explicitly set tokens for this example
|
|
143
|
-
# Client token must be sent in the 'X-
|
|
154
|
+
# Client token must be sent in the 'X-Client-Token' header.
|
|
144
155
|
config.CLIENT_TOKEN = "my-secret-client-token"
|
|
145
156
|
# Worker token must be sent in the 'X-Worker-Token' header.
|
|
146
157
|
config.GLOBAL_WORKER_TOKEN = "my-secret-worker-token"
|
|
@@ -268,12 +279,18 @@ async def publish_handler_old_style(context):
|
|
|
268
279
|
|
|
269
280
|
Avtomatika is engineered for high-load environments with thousands of concurrent workers.
|
|
270
281
|
|
|
271
|
-
* **O(1) Dispatcher**: Uses advanced Redis Set intersections to find suitable workers instantly
|
|
282
|
+
* **O(1) Dispatcher**: Uses advanced Redis Set intersections to find suitable workers instantly.
|
|
283
|
+
* **Zero Trust Security**:
|
|
284
|
+
* **mTLS (Mutual TLS)**: Mutual authentication between Orchestrator and Workers using certificates.
|
|
285
|
+
* **STS (Security Token Service)**: Token rotation mechanism with short-lived access tokens.
|
|
286
|
+
* **Identity Extraction**: Automatically maps Certificate Common Name (CN) to Worker ID.
|
|
287
|
+
* **Data Integrity**:
|
|
288
|
+
* **End-to-End Validation**: Automatic verification of file size and ETag (hash) during S3 transfers.
|
|
289
|
+
* **Audit Trail**: File metadata is logged in history for full traceability.
|
|
290
|
+
* **Protocol Layer**: Built on top of `rxon`, a strict contract defining interactions, ensuring forward compatibility and allowing transport evolution (e.g., to gRPC).
|
|
272
291
|
* **Non-Blocking I/O**:
|
|
273
|
-
* **Webhooks**: Sent via a bounded background queue
|
|
274
|
-
* **
|
|
275
|
-
* **Redis Streams**: Uses blocking reads to eliminate busy-waiting and reduce CPU usage.
|
|
276
|
-
* **Memory Safety**: S3 file transfers use streaming to handle multi-gigabyte files with constant, low RAM usage.
|
|
292
|
+
* **Webhooks**: Sent via a bounded background queue.
|
|
293
|
+
* **S3 Streaming**: Constant memory usage regardless of file size.
|
|
277
294
|
|
|
278
295
|
## Blueprint Cookbook: Key Features
|
|
279
296
|
|
|
@@ -525,13 +542,18 @@ By default, the engine uses in-memory storage. For production, you must configur
|
|
|
525
542
|
|
|
526
543
|
The orchestrator uses tokens to authenticate API requests.
|
|
527
544
|
|
|
528
|
-
* **Client Authentication**: All API clients must provide a token in the `X-
|
|
545
|
+
* **Client Authentication**: All API clients must provide a token in the `X-Client-Token` header. The orchestrator validates this token against client configurations.
|
|
529
546
|
* **Worker Authentication**: Workers must provide a token in the `X-Worker-Token` header.
|
|
530
547
|
* `GLOBAL_WORKER_TOKEN`: You can set a global token for all workers using this environment variable. For development and testing, it defaults to `"secure-worker-token"`.
|
|
531
548
|
* **Individual Tokens**: For production, it is recommended to define individual tokens for each worker in a separate configuration file and provide its path via the `WORKERS_CONFIG_PATH` environment variable. Tokens from this file are stored in a hashed format for security.
|
|
532
549
|
|
|
533
550
|
> **Note on Dynamic Reloading:** The worker configuration file can be reloaded without restarting the orchestrator by sending an authenticated `POST` request to the `/api/v1/admin/reload-workers` endpoint. This allows for dynamic updates of worker tokens.
|
|
534
551
|
|
|
552
|
+
### Pure Holon Mode
|
|
553
|
+
For high-security environments or when operating as a Compound Holon within an HLN, you can disable the public client API.
|
|
554
|
+
* **Enable/Disable**: Set `ENABLE_CLIENT_API="false"` (default: `true`).
|
|
555
|
+
* **Effect**: The Orchestrator will stop listening on `/api/v1/jobs/...`. It will only accept tasks via the Worker Protocol (RXON) from its parent.
|
|
556
|
+
|
|
535
557
|
### Observability
|
|
536
558
|
|
|
537
559
|
When installed with the telemetry dependency, the system automatically provides:
|
|
@@ -543,7 +565,11 @@ When installed with the telemetry dependency, the system automatically provides:
|
|
|
543
565
|
### Setup Environment
|
|
544
566
|
|
|
545
567
|
* Clone the repository.
|
|
546
|
-
*
|
|
568
|
+
* **For local development**, install the protocol package first:
|
|
569
|
+
```bash
|
|
570
|
+
pip install -e ../rxon
|
|
571
|
+
```
|
|
572
|
+
* Then install the engine in editable mode with all dependencies:
|
|
547
573
|
```bash
|
|
548
574
|
pip install -e ".[all,test]"
|
|
549
575
|
```
|
|
@@ -561,7 +587,7 @@ When installed with the telemetry dependency, the system automatically provides:
|
|
|
561
587
|
|
|
562
588
|
To run the `avtomatika` test suite:
|
|
563
589
|
```bash
|
|
564
|
-
pytest
|
|
590
|
+
pytest tests/
|
|
565
591
|
```
|
|
566
592
|
|
|
567
593
|
### Interactive API Documentation
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
avtomatika/__init__.py,sha256=D5r3L-H06uxsY_wgfh7u9YR29QvZMer1BlvzjW9Umfo,701
|
|
2
2
|
avtomatika/api.html,sha256=RLx-D1uFCSAXIf_2WgFlSTWrWPcmonNYM-9oNanKXBg,32835
|
|
3
|
-
avtomatika/app_keys.py,sha256=
|
|
3
|
+
avtomatika/app_keys.py,sha256=Zd2TaGPduzyEFJgdPvgSH1skdBx2mX-Prj1ma9fAXRo,1275
|
|
4
4
|
avtomatika/blueprint.py,sha256=AJ8hZkzvqkdu9aPmlJeFzuSj57L6Xm41KS9kBMGB4Vg,11827
|
|
5
5
|
avtomatika/client_config_loader.py,sha256=zVVHZlxSqZUaNpZ4zoU0T1CFYXdxy-3vKSmPcaFuHSY,2772
|
|
6
6
|
avtomatika/compression.py,sha256=bhA1kw4YrCR3I3kdquZSY0fAzCrRrjtz55uepzLUDKI,2498
|
|
7
|
-
avtomatika/config.py,sha256=
|
|
8
|
-
avtomatika/constants.py,sha256=
|
|
7
|
+
avtomatika/config.py,sha256=27ov8BNbiUpkZ1sjtx3pifRavwcxJ_zUgIdkL_pgqv8,3595
|
|
8
|
+
avtomatika/constants.py,sha256=ohZ34TdM07fD0kJLgoKGkReWSCgBWQ_yOitJpwxtDTk,169
|
|
9
9
|
avtomatika/context.py,sha256=T6Ux4Fb1DwWRGTpMNeukM51MQDQbGk2HS6Cwpc0dc1s,4248
|
|
10
|
-
avtomatika/data_types.py,sha256=
|
|
10
|
+
avtomatika/data_types.py,sha256=D_IUzMW8zMz-_MaqVp9MG53rG37Cb3McyRZuIXxvdlE,1108
|
|
11
11
|
avtomatika/datastore.py,sha256=gJjhZ5kxjF8pmbbPQb_qu3HPUpfy2c6T75KZ-smb_zg,545
|
|
12
|
-
avtomatika/dispatcher.py,sha256=
|
|
13
|
-
avtomatika/engine.py,sha256=
|
|
14
|
-
avtomatika/executor.py,sha256=
|
|
12
|
+
avtomatika/dispatcher.py,sha256=eWuGTBxUpWddpdJkij-UZn0I7BJgqCNg_5Y33ohG2NM,8666
|
|
13
|
+
avtomatika/engine.py,sha256=Nhm-Pni-riPGyPM4SAig6PzyvPHe-VtYD1p4qcE0h4U,20487
|
|
14
|
+
avtomatika/executor.py,sha256=X5AU7hWflH8rSYKxl_wh2RhdYhpyktynmK8mcfJgT-8,24218
|
|
15
15
|
avtomatika/health_checker.py,sha256=jXYSH4BPeZ4LCxSZV4uXM4BZhGJYgpoAOWQXE8yojLo,2078
|
|
16
16
|
avtomatika/logging_config.py,sha256=Zb6f9Nri9WVWhlpuBg6Lpi5SWRLGIUmS8Dc3xD1Gg0g,2993
|
|
17
17
|
avtomatika/metrics.py,sha256=tiksK1fFSOMlz8zFu6GT19JTduvxMTNlLu0QFrTHoQI,1866
|
|
@@ -19,28 +19,30 @@ avtomatika/py.typed,sha256=CT_L7gw2MLcQY-X0vs-xB5Vr0wzvGo7GuQYPI_qwJE8,65
|
|
|
19
19
|
avtomatika/quota.py,sha256=DNcaL6k0J1REeP8sVqbY9FprY_3BSr2SxM2Vf4mEqdw,1612
|
|
20
20
|
avtomatika/ratelimit.py,sha256=hFGW5oN9G6_W_jnHmopXW8bRjjzlvanY19MLghsNLE8,1306
|
|
21
21
|
avtomatika/reputation.py,sha256=pK-x9FrPN2Oc2gtPa1AZJHlhvkd7xlRe4orxM2auJJc,3979
|
|
22
|
-
avtomatika/s3.py,sha256=
|
|
22
|
+
avtomatika/s3.py,sha256=I0fDw5I44RJAqSv4tREvwHp2cxB0mGY_l2cVZWpe3As,14110
|
|
23
23
|
avtomatika/scheduler.py,sha256=F5Kv5Rx34nDd0mE5jxjwpjRg8duDZBEr91N5Y6CNR24,4231
|
|
24
24
|
avtomatika/scheduler_config_loader.py,sha256=F6mLM8yPRgG4bMHV_WnXX7UOrXD8fCXJT30bbEuQ2mk,1311
|
|
25
|
-
avtomatika/security.py,sha256=
|
|
25
|
+
avtomatika/security.py,sha256=eENEUc0OsHm6wN2H-ckGmiaV9qrZSbYsHFCWyYb3aLs,3271
|
|
26
26
|
avtomatika/telemetry.py,sha256=ZBt1_xJ36PzDSz-zdCXeNp58NiezUgbqvMctTG25PT0,2352
|
|
27
|
-
avtomatika/watcher.py,sha256
|
|
27
|
+
avtomatika/watcher.py,sha256=IKBqJ_r52ya0wiH8Gb0qFRMC8DFsusdRzPHjruWvFh4,3558
|
|
28
28
|
avtomatika/worker_config_loader.py,sha256=n0j8gfuJDacWONr8744RsHTCWpc_1ZTRMC-rJZh6P6A,2249
|
|
29
|
-
avtomatika/ws_manager.py,sha256=
|
|
30
|
-
avtomatika/api/handlers.py,sha256=
|
|
31
|
-
avtomatika/api/routes.py,sha256=
|
|
29
|
+
avtomatika/ws_manager.py,sha256=Qw0buPba5wCJKLP6jZ3QDyYPyG-EEEfL36ytzLqX0LA,3048
|
|
30
|
+
avtomatika/api/handlers.py,sha256=1t4qG-Mw6yf4UMViFkLMwO5Dfuk3VVxq1is77wBkzAc,11686
|
|
31
|
+
avtomatika/api/routes.py,sha256=MrtcRNjybxODmKhab0FCzgZGPRcfznwpFtDCdgh8RT4,3937
|
|
32
32
|
avtomatika/history/base.py,sha256=RsCvCkHK1teHjXSk9ZHVEtpQlIjz8kWsfKYHVnapf6c,3848
|
|
33
33
|
avtomatika/history/noop.py,sha256=hLzt0RblsrKUtoyQNauOni6jCi-IYCWEPsiR0vh7tho,1226
|
|
34
34
|
avtomatika/history/postgres.py,sha256=T0XpDurnh48pPI-2JhB285GdNIexNkCSu8ExhLJzcxc,9538
|
|
35
35
|
avtomatika/history/sqlite.py,sha256=txWax9RVzBQzIZuU-SjHnEXEzBmGzIjqzoVsK2oyiAQ,9252
|
|
36
|
+
avtomatika/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
37
|
+
avtomatika/services/worker_service.py,sha256=Xei_5DPqWO8wl_X7koFoAMnkxRgRs9ADC-H4-fVGteI,11406
|
|
36
38
|
avtomatika/storage/__init__.py,sha256=mGRj_40dWZ7R7uYbqC6gCsUWCKHAbZz4ZVIhYg5dT_E,262
|
|
37
|
-
avtomatika/storage/base.py,sha256=
|
|
38
|
-
avtomatika/storage/memory.py,sha256=
|
|
39
|
-
avtomatika/storage/redis.py,sha256=
|
|
39
|
+
avtomatika/storage/base.py,sha256=Tb_4fF0Vr10cgoXepA-1YUSgi27qYKQ7Qz1Y87XiRII,13375
|
|
40
|
+
avtomatika/storage/memory.py,sha256=amXIur3FU1H37s2Xs1IqIXxqPlrERxVH8obXnu3Ojvo,14535
|
|
41
|
+
avtomatika/storage/redis.py,sha256=nqqE4-r3tTLvQkObnDONONVX1TUxdy6nyq8RAt-qIT4,20138
|
|
40
42
|
avtomatika/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
41
43
|
avtomatika/utils/webhook_sender.py,sha256=4Ud2Tz18yV4kzfGQyDO2by8s2EIEwHkv1vtIUis9kVQ,3606
|
|
42
|
-
avtomatika-1.
|
|
43
|
-
avtomatika-1.
|
|
44
|
-
avtomatika-1.
|
|
45
|
-
avtomatika-1.
|
|
46
|
-
avtomatika-1.
|
|
44
|
+
avtomatika-1.0b9.dist-info/licenses/LICENSE,sha256=tqCjw9Y1vbU-hLcWi__7wQstLbt2T1XWPdbQYqCxuWY,1072
|
|
45
|
+
avtomatika-1.0b9.dist-info/METADATA,sha256=_yNyRuwGvnUKM7BrVKTxvA9RbSWy6s0_jowc1tF9ykY,28169
|
|
46
|
+
avtomatika-1.0b9.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
47
|
+
avtomatika-1.0b9.dist-info/top_level.txt,sha256=gLDWhA_wxHj0I6fG5X8vw9fE0HSN4hTE2dEJzeVS2x8,11
|
|
48
|
+
avtomatika-1.0b9.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|