avtomatika 1.0b3__tar.gz → 1.0b4__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-1.0b3/src/avtomatika.egg-info → avtomatika-1.0b4}/PKG-INFO +34 -6
- {avtomatika-1.0b3 → avtomatika-1.0b4}/README.md +33 -5
- {avtomatika-1.0b3 → avtomatika-1.0b4}/pyproject.toml +1 -1
- {avtomatika-1.0b3 → avtomatika-1.0b4}/src/avtomatika/api.html +0 -11
- {avtomatika-1.0b3 → avtomatika-1.0b4}/src/avtomatika/engine.py +39 -3
- {avtomatika-1.0b3 → avtomatika-1.0b4/src/avtomatika.egg-info}/PKG-INFO +34 -6
- {avtomatika-1.0b3 → avtomatika-1.0b4}/tests/test_engine.py +22 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/LICENSE +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/setup.cfg +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/src/avtomatika/__init__.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/src/avtomatika/blueprint.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/src/avtomatika/client_config_loader.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/src/avtomatika/compression.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/src/avtomatika/config.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/src/avtomatika/context.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/src/avtomatika/data_types.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/src/avtomatika/datastore.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/src/avtomatika/dispatcher.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/src/avtomatika/executor.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/src/avtomatika/health_checker.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/src/avtomatika/history/base.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/src/avtomatika/history/noop.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/src/avtomatika/history/postgres.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/src/avtomatika/history/sqlite.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/src/avtomatika/logging_config.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/src/avtomatika/metrics.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/src/avtomatika/py.typed +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/src/avtomatika/quota.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/src/avtomatika/ratelimit.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/src/avtomatika/reputation.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/src/avtomatika/security.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/src/avtomatika/storage/__init__.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/src/avtomatika/storage/base.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/src/avtomatika/storage/memory.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/src/avtomatika/storage/redis.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/src/avtomatika/telemetry.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/src/avtomatika/watcher.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/src/avtomatika/worker_config_loader.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/src/avtomatika/ws_manager.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/src/avtomatika.egg-info/SOURCES.txt +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/src/avtomatika.egg-info/dependency_links.txt +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/src/avtomatika.egg-info/requires.txt +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/src/avtomatika.egg-info/top_level.txt +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/tests/test_blueprint_conditions.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/tests/test_blueprints.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/tests/test_client_config_loader.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/tests/test_compression.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/tests/test_config_validation.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/tests/test_context.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/tests/test_dispatcher.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/tests/test_dispatcher_extended.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/tests/test_error_handling.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/tests/test_executor.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/tests/test_health_checker.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/tests/test_history.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/tests/test_integration.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/tests/test_logging_config.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/tests/test_memory_locking.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/tests/test_memory_storage.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/tests/test_metrics.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/tests/test_noop_history.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/tests/test_postgres_history.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/tests/test_ratelimit.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/tests/test_redis_locking.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/tests/test_redis_storage.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/tests/test_reputation.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/tests/test_telemetry.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/tests/test_watcher.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/tests/test_worker_config_loader.py +0 -0
- {avtomatika-1.0b3 → avtomatika-1.0b4}/tests/test_ws_manager.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: avtomatika
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.0b4
|
|
4
4
|
Summary: A state-machine based orchestrator for long-running AI and other jobs.
|
|
5
5
|
Project-URL: Homepage, https://github.com/avtomatika-ai/avtomatika
|
|
6
6
|
Project-URL: Bug Tracker, https://github.com/avtomatika-ai/avtomatika/issues
|
|
@@ -334,6 +334,24 @@ The orchestrator's behavior can be configured through environment variables. Add
|
|
|
334
334
|
|
|
335
335
|
**Important:** The system employs **strict validation** for configuration files (`clients.toml`, `workers.toml`) at startup. If a configuration file is invalid (e.g., malformed TOML, missing required fields), the application will **fail fast** and exit with an error, rather than starting in a partially broken state. This ensures the security and integrity of the deployment.
|
|
336
336
|
|
|
337
|
+
### Configuration Files
|
|
338
|
+
|
|
339
|
+
To manage access and worker settings securely, Avtomatika uses TOML configuration files.
|
|
340
|
+
|
|
341
|
+
- **`clients.toml`**: Defines API clients, their tokens, plans, and quotas.
|
|
342
|
+
```toml
|
|
343
|
+
[client_premium]
|
|
344
|
+
token = "secret-token-123"
|
|
345
|
+
plan = "premium"
|
|
346
|
+
```
|
|
347
|
+
- **`workers.toml`**: Defines individual tokens for workers to enhance security.
|
|
348
|
+
```toml
|
|
349
|
+
[gpu-worker-01]
|
|
350
|
+
token = "worker-secret-456"
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
For detailed specifications and examples, please refer to the [**Configuration Guide**](docs/configuration.md).
|
|
354
|
+
|
|
337
355
|
### Fault Tolerance
|
|
338
356
|
|
|
339
357
|
The orchestrator has built-in mechanisms for handling failures based on the `error.code` field in a worker's response.
|
|
@@ -418,11 +436,21 @@ To run the `avtomatika` test suite:
|
|
|
418
436
|
pytest avtomatika/tests/
|
|
419
437
|
```
|
|
420
438
|
|
|
439
|
+
### Interactive API Documentation
|
|
440
|
+
|
|
441
|
+
Avtomatika provides a built-in interactive API documentation page (similar to Swagger UI) that is automatically generated based on your registered blueprints.
|
|
442
|
+
|
|
443
|
+
* **Endpoint:** `/_public/docs`
|
|
444
|
+
* **Features:**
|
|
445
|
+
* **List of all system endpoints:** Detailed documentation for Public, Protected, and Worker API groups.
|
|
446
|
+
* **Dynamic Blueprint Documentation:** Automatically generates and lists documentation for all blueprints registered in the engine, including their specific API endpoints.
|
|
447
|
+
* **Interactive Testing:** Allows you to test API calls directly from the browser. You can provide authentication tokens, parameters, and request bodies to see real server responses.
|
|
448
|
+
|
|
421
449
|
## Detailed Documentation
|
|
422
450
|
|
|
423
|
-
For a deeper dive into the system, please refer to the following documents
|
|
451
|
+
For a deeper dive into the system, please refer to the following documents:
|
|
424
452
|
|
|
425
|
-
- [**Architecture Guide**](docs/architecture.md): A detailed overview of the system components and their interactions.
|
|
426
|
-
- [**API Reference**](docs/api_reference.md): Full specification of the HTTP API.
|
|
427
|
-
- [**Deployment Guide**](docs/deployment.md): Instructions for deploying with Gunicorn/Uvicorn and NGINX.
|
|
428
|
-
- [**Cookbook**](docs/cookbook/README.md): Examples and best practices for creating blueprints.
|
|
453
|
+
- [**Architecture Guide**](https://github.com/avtomatika-ai/avtomatika/blob/main/docs/architecture.md): A detailed overview of the system components and their interactions.
|
|
454
|
+
- [**API Reference**](https://github.com/avtomatika-ai/avtomatika/blob/main/docs/api_reference.md): Full specification of the HTTP API.
|
|
455
|
+
- [**Deployment Guide**](https://github.com/avtomatika-ai/avtomatika/blob/main/docs/deployment.md): Instructions for deploying with Gunicorn/Uvicorn and NGINX.
|
|
456
|
+
- [**Cookbook**](https://github.com/avtomatika-ai/avtomatika/blob/main/docs/cookbook/README.md): Examples and best practices for creating blueprints.
|
|
@@ -288,6 +288,24 @@ The orchestrator's behavior can be configured through environment variables. Add
|
|
|
288
288
|
|
|
289
289
|
**Important:** The system employs **strict validation** for configuration files (`clients.toml`, `workers.toml`) at startup. If a configuration file is invalid (e.g., malformed TOML, missing required fields), the application will **fail fast** and exit with an error, rather than starting in a partially broken state. This ensures the security and integrity of the deployment.
|
|
290
290
|
|
|
291
|
+
### Configuration Files
|
|
292
|
+
|
|
293
|
+
To manage access and worker settings securely, Avtomatika uses TOML configuration files.
|
|
294
|
+
|
|
295
|
+
- **`clients.toml`**: Defines API clients, their tokens, plans, and quotas.
|
|
296
|
+
```toml
|
|
297
|
+
[client_premium]
|
|
298
|
+
token = "secret-token-123"
|
|
299
|
+
plan = "premium"
|
|
300
|
+
```
|
|
301
|
+
- **`workers.toml`**: Defines individual tokens for workers to enhance security.
|
|
302
|
+
```toml
|
|
303
|
+
[gpu-worker-01]
|
|
304
|
+
token = "worker-secret-456"
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
For detailed specifications and examples, please refer to the [**Configuration Guide**](docs/configuration.md).
|
|
308
|
+
|
|
291
309
|
### Fault Tolerance
|
|
292
310
|
|
|
293
311
|
The orchestrator has built-in mechanisms for handling failures based on the `error.code` field in a worker's response.
|
|
@@ -372,11 +390,21 @@ To run the `avtomatika` test suite:
|
|
|
372
390
|
pytest avtomatika/tests/
|
|
373
391
|
```
|
|
374
392
|
|
|
393
|
+
### Interactive API Documentation
|
|
394
|
+
|
|
395
|
+
Avtomatika provides a built-in interactive API documentation page (similar to Swagger UI) that is automatically generated based on your registered blueprints.
|
|
396
|
+
|
|
397
|
+
* **Endpoint:** `/_public/docs`
|
|
398
|
+
* **Features:**
|
|
399
|
+
* **List of all system endpoints:** Detailed documentation for Public, Protected, and Worker API groups.
|
|
400
|
+
* **Dynamic Blueprint Documentation:** Automatically generates and lists documentation for all blueprints registered in the engine, including their specific API endpoints.
|
|
401
|
+
* **Interactive Testing:** Allows you to test API calls directly from the browser. You can provide authentication tokens, parameters, and request bodies to see real server responses.
|
|
402
|
+
|
|
375
403
|
## Detailed Documentation
|
|
376
404
|
|
|
377
|
-
For a deeper dive into the system, please refer to the following documents
|
|
405
|
+
For a deeper dive into the system, please refer to the following documents:
|
|
378
406
|
|
|
379
|
-
- [**Architecture Guide**](docs/architecture.md): A detailed overview of the system components and their interactions.
|
|
380
|
-
- [**API Reference**](docs/api_reference.md): Full specification of the HTTP API.
|
|
381
|
-
- [**Deployment Guide**](docs/deployment.md): Instructions for deploying with Gunicorn/Uvicorn and NGINX.
|
|
382
|
-
- [**Cookbook**](docs/cookbook/README.md): Examples and best practices for creating blueprints.
|
|
407
|
+
- [**Architecture Guide**](https://github.com/avtomatika-ai/avtomatika/blob/main/docs/architecture.md): A detailed overview of the system components and their interactions.
|
|
408
|
+
- [**API Reference**](https://github.com/avtomatika-ai/avtomatika/blob/main/docs/api_reference.md): Full specification of the HTTP API.
|
|
409
|
+
- [**Deployment Guide**](https://github.com/avtomatika-ai/avtomatika/blob/main/docs/deployment.md): Instructions for deploying with Gunicorn/Uvicorn and NGINX.
|
|
410
|
+
- [**Cookbook**](https://github.com/avtomatika-ai/avtomatika/blob/main/docs/cookbook/README.md): Examples and best practices for creating blueprints.
|
|
@@ -199,17 +199,6 @@
|
|
|
199
199
|
{ code: '202 Accepted', description: 'Job successfully accepted for processing.', body: { "status": "accepted", "job_id": "..." } }
|
|
200
200
|
]
|
|
201
201
|
},
|
|
202
|
-
{
|
|
203
|
-
id: 'post-create-showcase-job',
|
|
204
|
-
name: 'Create a Full Showcase Job',
|
|
205
|
-
method: 'POST',
|
|
206
|
-
path: '/api/v1/jobs/full_showcase',
|
|
207
|
-
description: 'Creates and starts a new instance (Job) of the `full_showcase` blueprint. This blueprint demonstrates most of the features of the Avtomatika library.',
|
|
208
|
-
request: { body: { "path": "/path/to/video.mp4", "user_id": "user-123", "quality": "high" } },
|
|
209
|
-
responses: [
|
|
210
|
-
{ code: '202 Accepted', description: 'Job successfully accepted for processing.', body: { "status": "accepted", "job_id": "..." } }
|
|
211
|
-
]
|
|
212
|
-
},
|
|
213
202
|
{
|
|
214
203
|
id: 'get-job-status',
|
|
215
204
|
name: 'Get Job Status',
|
|
@@ -599,17 +599,53 @@ class OrchestratorEngine:
|
|
|
599
599
|
await load_client_configs_to_redis(self.storage)
|
|
600
600
|
return web.json_response({"status": "db_flushed"}, status=200)
|
|
601
601
|
|
|
602
|
-
|
|
603
|
-
|
|
602
|
+
async def _docs_handler(self, request: web.Request) -> web.Response:
|
|
603
|
+
import json
|
|
604
604
|
from importlib import resources
|
|
605
605
|
|
|
606
606
|
try:
|
|
607
607
|
content = resources.read_text("avtomatika", "api.html")
|
|
608
|
-
return web.Response(text=content, content_type="text/html")
|
|
609
608
|
except FileNotFoundError:
|
|
610
609
|
logger.error("api.html not found within the avtomatika package.")
|
|
611
610
|
return web.json_response({"error": "Documentation file not found on server."}, status=500)
|
|
612
611
|
|
|
612
|
+
# Generate dynamic documentation for registered blueprints
|
|
613
|
+
blueprint_endpoints = []
|
|
614
|
+
for bp in self.blueprints.values():
|
|
615
|
+
if not bp.api_endpoint:
|
|
616
|
+
continue
|
|
617
|
+
|
|
618
|
+
version_prefix = f"/{bp.api_version}" if bp.api_version else ""
|
|
619
|
+
endpoint_path = bp.api_endpoint if bp.api_endpoint.startswith("/") else f"/{bp.api_endpoint}"
|
|
620
|
+
full_path = f"/api{version_prefix}{endpoint_path}"
|
|
621
|
+
|
|
622
|
+
blueprint_endpoints.append(
|
|
623
|
+
{
|
|
624
|
+
"id": f"post-create-{bp.name.replace('_', '-')}",
|
|
625
|
+
"name": f"Create {bp.name.replace('_', ' ').title()} Job",
|
|
626
|
+
"method": "POST",
|
|
627
|
+
"path": full_path,
|
|
628
|
+
"description": f"Creates and starts a new instance (Job) of the `{bp.name}` blueprint.",
|
|
629
|
+
"request": {"body": {"initial_data": {}}},
|
|
630
|
+
"responses": [
|
|
631
|
+
{
|
|
632
|
+
"code": "202 Accepted",
|
|
633
|
+
"description": "Job successfully accepted for processing.",
|
|
634
|
+
"body": {"status": "accepted", "job_id": "..."},
|
|
635
|
+
}
|
|
636
|
+
],
|
|
637
|
+
}
|
|
638
|
+
)
|
|
639
|
+
|
|
640
|
+
# Inject dynamic endpoints into the apiData structure in the HTML
|
|
641
|
+
if blueprint_endpoints:
|
|
642
|
+
endpoints_json = json.dumps(blueprint_endpoints, indent=2)
|
|
643
|
+
# We insert the new endpoints at the beginning of the 'Protected API' group
|
|
644
|
+
marker = "group: 'Protected API',\n endpoints: ["
|
|
645
|
+
content = content.replace(marker, f"{marker}\n{endpoints_json.strip('[]')},")
|
|
646
|
+
|
|
647
|
+
return web.Response(text=content, content_type="text/html")
|
|
648
|
+
|
|
613
649
|
def _setup_routes(self):
|
|
614
650
|
public_app = web.Application()
|
|
615
651
|
public_app.router.add_get("/status", status_handler)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: avtomatika
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.0b4
|
|
4
4
|
Summary: A state-machine based orchestrator for long-running AI and other jobs.
|
|
5
5
|
Project-URL: Homepage, https://github.com/avtomatika-ai/avtomatika
|
|
6
6
|
Project-URL: Bug Tracker, https://github.com/avtomatika-ai/avtomatika/issues
|
|
@@ -334,6 +334,24 @@ The orchestrator's behavior can be configured through environment variables. Add
|
|
|
334
334
|
|
|
335
335
|
**Important:** The system employs **strict validation** for configuration files (`clients.toml`, `workers.toml`) at startup. If a configuration file is invalid (e.g., malformed TOML, missing required fields), the application will **fail fast** and exit with an error, rather than starting in a partially broken state. This ensures the security and integrity of the deployment.
|
|
336
336
|
|
|
337
|
+
### Configuration Files
|
|
338
|
+
|
|
339
|
+
To manage access and worker settings securely, Avtomatika uses TOML configuration files.
|
|
340
|
+
|
|
341
|
+
- **`clients.toml`**: Defines API clients, their tokens, plans, and quotas.
|
|
342
|
+
```toml
|
|
343
|
+
[client_premium]
|
|
344
|
+
token = "secret-token-123"
|
|
345
|
+
plan = "premium"
|
|
346
|
+
```
|
|
347
|
+
- **`workers.toml`**: Defines individual tokens for workers to enhance security.
|
|
348
|
+
```toml
|
|
349
|
+
[gpu-worker-01]
|
|
350
|
+
token = "worker-secret-456"
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
For detailed specifications and examples, please refer to the [**Configuration Guide**](docs/configuration.md).
|
|
354
|
+
|
|
337
355
|
### Fault Tolerance
|
|
338
356
|
|
|
339
357
|
The orchestrator has built-in mechanisms for handling failures based on the `error.code` field in a worker's response.
|
|
@@ -418,11 +436,21 @@ To run the `avtomatika` test suite:
|
|
|
418
436
|
pytest avtomatika/tests/
|
|
419
437
|
```
|
|
420
438
|
|
|
439
|
+
### Interactive API Documentation
|
|
440
|
+
|
|
441
|
+
Avtomatika provides a built-in interactive API documentation page (similar to Swagger UI) that is automatically generated based on your registered blueprints.
|
|
442
|
+
|
|
443
|
+
* **Endpoint:** `/_public/docs`
|
|
444
|
+
* **Features:**
|
|
445
|
+
* **List of all system endpoints:** Detailed documentation for Public, Protected, and Worker API groups.
|
|
446
|
+
* **Dynamic Blueprint Documentation:** Automatically generates and lists documentation for all blueprints registered in the engine, including their specific API endpoints.
|
|
447
|
+
* **Interactive Testing:** Allows you to test API calls directly from the browser. You can provide authentication tokens, parameters, and request bodies to see real server responses.
|
|
448
|
+
|
|
421
449
|
## Detailed Documentation
|
|
422
450
|
|
|
423
|
-
For a deeper dive into the system, please refer to the following documents
|
|
451
|
+
For a deeper dive into the system, please refer to the following documents:
|
|
424
452
|
|
|
425
|
-
- [**Architecture Guide**](docs/architecture.md): A detailed overview of the system components and their interactions.
|
|
426
|
-
- [**API Reference**](docs/api_reference.md): Full specification of the HTTP API.
|
|
427
|
-
- [**Deployment Guide**](docs/deployment.md): Instructions for deploying with Gunicorn/Uvicorn and NGINX.
|
|
428
|
-
- [**Cookbook**](docs/cookbook/README.md): Examples and best practices for creating blueprints.
|
|
453
|
+
- [**Architecture Guide**](https://github.com/avtomatika-ai/avtomatika/blob/main/docs/architecture.md): A detailed overview of the system components and their interactions.
|
|
454
|
+
- [**API Reference**](https://github.com/avtomatika-ai/avtomatika/blob/main/docs/api_reference.md): Full specification of the HTTP API.
|
|
455
|
+
- [**Deployment Guide**](https://github.com/avtomatika-ai/avtomatika/blob/main/docs/deployment.md): Instructions for deploying with Gunicorn/Uvicorn and NGINX.
|
|
456
|
+
- [**Cookbook**](https://github.com/avtomatika-ai/avtomatika/blob/main/docs/cookbook/README.md): Examples and best practices for creating blueprints.
|
|
@@ -592,6 +592,28 @@ async def test_get_jobs_invalid_params(engine):
|
|
|
592
592
|
assert response.status == 400
|
|
593
593
|
|
|
594
594
|
|
|
595
|
+
@pytest.mark.asyncio
|
|
596
|
+
async def test_docs_handler_injection(engine):
|
|
597
|
+
from src.avtomatika.blueprint import StateMachineBlueprint
|
|
598
|
+
|
|
599
|
+
bp = StateMachineBlueprint(name="test_bp", api_endpoint="/jobs/test", api_version="v1")
|
|
600
|
+
|
|
601
|
+
@bp.handler_for("start", is_start=True)
|
|
602
|
+
async def start(context, actions):
|
|
603
|
+
pass
|
|
604
|
+
|
|
605
|
+
engine.register_blueprint(bp)
|
|
606
|
+
|
|
607
|
+
# Mock request
|
|
608
|
+
request = MagicMock()
|
|
609
|
+
|
|
610
|
+
response = await engine._docs_handler(request)
|
|
611
|
+
assert response.status == 200
|
|
612
|
+
text = response.text
|
|
613
|
+
assert "Create Test Bp Job" in text
|
|
614
|
+
assert "/api/v1/jobs/test" in text
|
|
615
|
+
|
|
616
|
+
|
|
595
617
|
@pytest.mark.asyncio
|
|
596
618
|
async def test_docs_handler_not_found(engine):
|
|
597
619
|
with patch("importlib.resources.read_text", side_effect=FileNotFoundError):
|
|
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
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|