supervaizer 0.10.4__tar.gz → 0.10.5__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.
Files changed (76) hide show
  1. {supervaizer-0.10.4 → supervaizer-0.10.5}/PKG-INFO +1 -1
  2. {supervaizer-0.10.4 → supervaizer-0.10.5}/pyproject.toml +1 -1
  3. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/__version__.py +1 -1
  4. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/cli.py +10 -1
  5. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/deploy/cli.py +9 -0
  6. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/storage.py +39 -13
  7. {supervaizer-0.10.4 → supervaizer-0.10.5}/.gitignore +0 -0
  8. {supervaizer-0.10.4 → supervaizer-0.10.5}/LICENSE.md +0 -0
  9. {supervaizer-0.10.4 → supervaizer-0.10.5}/README.md +0 -0
  10. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/__init__.py +0 -0
  11. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/account.py +0 -0
  12. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/account_service.py +0 -0
  13. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/admin/routes.py +0 -0
  14. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/admin/static/js/job-start-form.js +0 -0
  15. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/admin/templates/agent_detail.html +0 -0
  16. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/admin/templates/agents.html +0 -0
  17. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/admin/templates/agents_grid.html +0 -0
  18. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/admin/templates/base.html +0 -0
  19. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/admin/templates/case_detail.html +0 -0
  20. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/admin/templates/cases_list.html +0 -0
  21. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/admin/templates/cases_table.html +0 -0
  22. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/admin/templates/console.html +0 -0
  23. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/admin/templates/dashboard.html +0 -0
  24. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/admin/templates/job_detail.html +0 -0
  25. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/admin/templates/job_start_test.html +0 -0
  26. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/admin/templates/jobs_list.html +0 -0
  27. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/admin/templates/jobs_table.html +0 -0
  28. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/admin/templates/navigation.html +0 -0
  29. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/admin/templates/recent_activity.html +0 -0
  30. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/admin/templates/server.html +0 -0
  31. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/admin/templates/server_status_cards.html +0 -0
  32. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/admin/templates/supervaize_instructions.html +0 -0
  33. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/agent.py +0 -0
  34. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/case.py +0 -0
  35. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/common.py +0 -0
  36. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/deploy/__init__.py +0 -0
  37. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/deploy/commands/__init__.py +0 -0
  38. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/deploy/commands/clean.py +0 -0
  39. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/deploy/commands/down.py +0 -0
  40. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/deploy/commands/local.py +0 -0
  41. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/deploy/commands/plan.py +0 -0
  42. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/deploy/commands/status.py +0 -0
  43. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/deploy/commands/up.py +0 -0
  44. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/deploy/docker.py +0 -0
  45. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/deploy/driver_factory.py +0 -0
  46. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/deploy/drivers/__init__.py +0 -0
  47. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/deploy/drivers/aws_app_runner.py +0 -0
  48. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/deploy/drivers/base.py +0 -0
  49. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/deploy/drivers/cloud_run.py +0 -0
  50. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/deploy/drivers/do_app_platform.py +0 -0
  51. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/deploy/health.py +0 -0
  52. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/deploy/state.py +0 -0
  53. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/deploy/templates/Dockerfile.template +0 -0
  54. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/deploy/templates/debug_env.py +0 -0
  55. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/deploy/templates/docker-compose.yml.template +0 -0
  56. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/deploy/templates/dockerignore.template +0 -0
  57. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/deploy/templates/entrypoint.sh +0 -0
  58. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/deploy/utils.py +0 -0
  59. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/event.py +0 -0
  60. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/examples/controller_template.py +0 -0
  61. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/instructions.py +0 -0
  62. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/job.py +0 -0
  63. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/job_service.py +0 -0
  64. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/lifecycle.py +0 -0
  65. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/parameter.py +0 -0
  66. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/protocol/__init__.py +0 -0
  67. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/protocol/a2a/__init__.py +0 -0
  68. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/protocol/a2a/model.py +0 -0
  69. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/protocol/a2a/routes.py +0 -0
  70. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/py.typed +0 -0
  71. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/routes.py +0 -0
  72. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/server.py +0 -0
  73. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/server_utils.py +0 -0
  74. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/telemetry.py +0 -0
  75. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/utils/__init__.py +0 -0
  76. {supervaizer-0.10.4 → supervaizer-0.10.5}/src/supervaizer/utils/version_check.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: supervaizer
3
- Version: 0.10.4
3
+ Version: 0.10.5
4
4
  Summary: Controller system for Supervaize
5
5
  Project-URL: Homepage, https://supervaize.com
6
6
  Project-URL: Repository, https://github.com/supervaize/supervaizer
@@ -121,7 +121,7 @@ mypy_path = "src"
121
121
  disallow_any_expr = false
122
122
 
123
123
  [tool.bumpversion]
124
- current_version = "0.10.4"
124
+ current_version = "0.10.5"
125
125
  commit = true
126
126
  tag = true
127
127
  tag_name = "v{new_version}"
@@ -5,6 +5,6 @@
5
5
  # https://mozilla.org/MPL/2.0/.
6
6
 
7
7
 
8
- VERSION = "0.10.4"
8
+ VERSION = "0.10.5"
9
9
  API_VERSION = "v1"
10
10
  TELEMETRY_VERSION = "v1"
@@ -95,7 +95,9 @@ def main_callback(
95
95
 
96
96
  # Add deploy subcommand
97
97
  app.add_typer(
98
- deploy_app, name="deploy", help="Deploy Supervaizer agents to cloud platforms"
98
+ deploy_app,
99
+ name="deploy",
100
+ help="Deploy Supervaizer agents to cloud platforms (requires deploy extras: pip install supervaizer[deploy])",
99
101
  )
100
102
 
101
103
  # Create scaffold subcommand group
@@ -131,6 +133,12 @@ def start(
131
133
  environment: str = typer.Option(
132
134
  os.environ.get("SUPERVAIZER_ENVIRONMENT", "dev"), help="Environment name"
133
135
  ),
136
+ persist: bool = typer.Option(
137
+ (os.environ.get("SUPERVAIZER_PERSISTENCE") or "false").lower()
138
+ in ("true", "1", "yes"),
139
+ "--persist/--no-persist",
140
+ help="Persist data to file (default: off; set for self-hosted, off for Vercel/serverless)",
141
+ ),
134
142
  script_path: Optional[str] = typer.Argument(
135
143
  None,
136
144
  help="Path to the supervaizer_control.py script",
@@ -152,6 +160,7 @@ def start(
152
160
  os.environ["SUPERVAIZER_HOST"] = host
153
161
  os.environ["SUPERVAIZER_PORT"] = str(port)
154
162
  os.environ["SUPERVAIZER_ENVIRONMENT"] = environment
163
+ os.environ["SUPERVAIZER_PERSISTENCE"] = str(persist).lower()
155
164
  os.environ["SUPERVAIZER_LOG_LEVEL"] = log_level
156
165
  os.environ["SUPERVAIZER_DEBUG"] = str(debug)
157
166
  os.environ["SUPERVAIZER_RELOAD"] = str(reload)
@@ -167,6 +167,15 @@ def plan(
167
167
  verbose: bool = verbose_option,
168
168
  ) -> None:
169
169
  """Plan deployment changes without applying them."""
170
+ # Check if deploy extras are installed (e.g., docker, cloud SDKs)
171
+ try:
172
+ import docker
173
+ except ImportError:
174
+ console.print(
175
+ "[bold red]Error:[/] 'deploy' extra requirements are not installed. "
176
+ "Install them with: [bold]pip install supervaizer[deploy][/]"
177
+ )
178
+ raise typer.Exit(1)
170
179
  _check_platform_required(platform, "plan")
171
180
  source_dir = _check_pyproject_toml()
172
181
  plan_deployment(platform, name, env, region, project_id, verbose, source_dir)
@@ -16,19 +16,37 @@ from pathlib import Path
16
16
  from typing import TYPE_CHECKING, Any, Dict, Generic, List, Optional, TypeVar
17
17
 
18
18
  from tinydb import Query, TinyDB
19
+ from tinydb.storages import MemoryStorage
19
20
 
20
21
  from supervaizer.common import log, singleton
21
22
  from supervaizer.lifecycle import WorkflowEntity
22
23
 
24
+
25
+ class _MemoryStorage(MemoryStorage):
26
+ """MemoryStorage that accepts TinyDB's sort_keys/indent kwargs (ignored)."""
27
+
28
+ def __init__(self, *args: Any, **kwargs: Any) -> None:
29
+ super().__init__(*args)
30
+
31
+
23
32
  if TYPE_CHECKING:
24
33
  from supervaizer.case import Case
25
34
  from supervaizer.job import Job
26
35
  from supervaizer.lifecycle import EntityEvents, EntityStatus
27
36
 
37
+
28
38
  T = TypeVar("T", bound=WorkflowEntity)
29
39
 
30
40
  DATA_STORAGE_PATH = os.getenv("DATA_STORAGE_PATH", "./data")
31
41
 
42
+ # When False (default), use in-memory storage only (e.g. Vercel, serverless).
43
+ # Set SUPERVAIZER_PERSISTENCE=true to persist to file.
44
+ PERSISTENCE_ENABLED = os.getenv("SUPERVAIZER_PERSISTENCE", "false").lower() in (
45
+ "true",
46
+ "1",
47
+ "yes",
48
+ )
49
+
32
50
 
33
51
  @singleton
34
52
  class StorageManager:
@@ -37,28 +55,36 @@ class StorageManager:
37
55
 
38
56
  Stores entities in separate tables by type, with foreign key relationships
39
57
  represented as ID references (Job.case_ids, Case.job_id).
58
+
59
+ When SUPERVAIZER_PERSISTENCE is false (default), uses in-memory storage only.
40
60
  """
41
61
 
42
- def __init__(self, db_path: str = f"{DATA_STORAGE_PATH}/entities.json"):
62
+ def __init__(self, db_path: Optional[str] = None):
43
63
  """
44
64
  Initialize the storage manager.
45
65
 
46
66
  Args:
47
- db_path: Path to the TinyDB JSON file
67
+ db_path: Path to the TinyDB JSON file, or None to use env-based
68
+ persistence (file if SUPERVAIZER_PERSISTENCE=true, else memory).
48
69
  """
49
- self.db_path: Path = Path(db_path)
50
70
  self._lock = threading.Lock()
51
-
52
- # Ensure data directory exists
53
- Path(db_path).parent.mkdir(parents=True, exist_ok=True)
54
-
55
- # Initialize TinyDB without caching middleware for immediate persistence
56
- # Note: Thread safety is handled by our own threading lock
57
- self._db = TinyDB(
58
- db_path,
59
- sort_keys=True,
60
- indent=2,
71
+ # Explicit file path (e.g. tests) uses file; else file only if persistence enabled
72
+ use_file = (db_path is not None and db_path != ":memory:") or (
73
+ db_path is None and PERSISTENCE_ENABLED
61
74
  )
75
+ if use_file:
76
+ path = (
77
+ db_path
78
+ if (db_path and db_path != ":memory:")
79
+ else f"{DATA_STORAGE_PATH}/entities.json"
80
+ )
81
+ self.db_path = Path(path)
82
+ Path(path).parent.mkdir(parents=True, exist_ok=True)
83
+ self._db = TinyDB(path, sort_keys=True, indent=2)
84
+ else:
85
+ # In-memory only (default for Vercel/serverless)
86
+ self.db_path = Path(":memory:")
87
+ self._db = TinyDB(storage=_MemoryStorage, sort_keys=True, indent=2)
62
88
 
63
89
  # log.debug(
64
90
  # f"[StorageManager] 🗃️ Local DB initialized at {self.db_path.absolute()}"
File without changes
File without changes
File without changes