kubiya-control-plane-api 0.1.0__py3-none-any.whl → 0.3.4__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.
Potentially problematic release.
This version of kubiya-control-plane-api might be problematic. Click here for more details.
- control_plane_api/README.md +266 -0
- control_plane_api/__init__.py +0 -0
- control_plane_api/__version__.py +1 -0
- control_plane_api/alembic/README +1 -0
- control_plane_api/alembic/env.py +98 -0
- control_plane_api/alembic/script.py.mako +28 -0
- control_plane_api/alembic/versions/1382bec74309_initial_migration_with_all_models.py +251 -0
- control_plane_api/alembic/versions/1f54bc2a37e3_add_analytics_tables.py +162 -0
- control_plane_api/alembic/versions/2e4cb136dc10_rename_toolset_ids_to_skill_ids_in_teams.py +30 -0
- control_plane_api/alembic/versions/31cd69a644ce_add_skill_templates_table.py +28 -0
- control_plane_api/alembic/versions/89e127caa47d_add_jobs_and_job_executions_tables.py +161 -0
- control_plane_api/alembic/versions/add_llm_models_table.py +51 -0
- control_plane_api/alembic/versions/b0e10697f212_add_runtime_column_to_teams_simple.py +42 -0
- control_plane_api/alembic/versions/ce43b24b63bf_add_execution_trigger_source_and_fix_.py +155 -0
- control_plane_api/alembic/versions/d4eaf16e3f8d_rename_toolsets_to_skills.py +84 -0
- control_plane_api/alembic/versions/efa2dc427da1_rename_metadata_to_custom_metadata.py +32 -0
- control_plane_api/alembic/versions/f973b431d1ce_add_workflow_executor_to_skill_types.py +44 -0
- control_plane_api/alembic.ini +148 -0
- control_plane_api/api/index.py +12 -0
- control_plane_api/app/__init__.py +11 -0
- control_plane_api/app/activities/__init__.py +20 -0
- control_plane_api/app/activities/agent_activities.py +379 -0
- control_plane_api/app/activities/team_activities.py +410 -0
- control_plane_api/app/activities/temporal_cloud_activities.py +577 -0
- control_plane_api/app/config/__init__.py +35 -0
- control_plane_api/app/config/api_config.py +354 -0
- control_plane_api/app/config/model_pricing.py +318 -0
- control_plane_api/app/config.py +95 -0
- control_plane_api/app/database.py +135 -0
- control_plane_api/app/exceptions.py +408 -0
- control_plane_api/app/lib/__init__.py +11 -0
- control_plane_api/app/lib/job_executor.py +312 -0
- control_plane_api/app/lib/kubiya_client.py +235 -0
- control_plane_api/app/lib/litellm_pricing.py +166 -0
- control_plane_api/app/lib/planning_tools/__init__.py +22 -0
- control_plane_api/app/lib/planning_tools/agents.py +155 -0
- control_plane_api/app/lib/planning_tools/base.py +189 -0
- control_plane_api/app/lib/planning_tools/environments.py +214 -0
- control_plane_api/app/lib/planning_tools/resources.py +240 -0
- control_plane_api/app/lib/planning_tools/teams.py +198 -0
- control_plane_api/app/lib/policy_enforcer_client.py +939 -0
- control_plane_api/app/lib/redis_client.py +436 -0
- control_plane_api/app/lib/supabase.py +71 -0
- control_plane_api/app/lib/temporal_client.py +138 -0
- control_plane_api/app/lib/validation/__init__.py +20 -0
- control_plane_api/app/lib/validation/runtime_validation.py +287 -0
- control_plane_api/app/main.py +128 -0
- control_plane_api/app/middleware/__init__.py +8 -0
- control_plane_api/app/middleware/auth.py +513 -0
- control_plane_api/app/middleware/exception_handler.py +267 -0
- control_plane_api/app/middleware/rate_limiting.py +384 -0
- control_plane_api/app/middleware/request_id.py +202 -0
- control_plane_api/app/models/__init__.py +27 -0
- control_plane_api/app/models/agent.py +79 -0
- control_plane_api/app/models/analytics.py +206 -0
- control_plane_api/app/models/associations.py +81 -0
- control_plane_api/app/models/environment.py +63 -0
- control_plane_api/app/models/execution.py +93 -0
- control_plane_api/app/models/job.py +179 -0
- control_plane_api/app/models/llm_model.py +75 -0
- control_plane_api/app/models/presence.py +49 -0
- control_plane_api/app/models/project.py +47 -0
- control_plane_api/app/models/session.py +38 -0
- control_plane_api/app/models/team.py +66 -0
- control_plane_api/app/models/workflow.py +55 -0
- control_plane_api/app/policies/README.md +121 -0
- control_plane_api/app/policies/approved_users.rego +62 -0
- control_plane_api/app/policies/business_hours.rego +51 -0
- control_plane_api/app/policies/rate_limiting.rego +100 -0
- control_plane_api/app/policies/tool_restrictions.rego +86 -0
- control_plane_api/app/routers/__init__.py +4 -0
- control_plane_api/app/routers/agents.py +364 -0
- control_plane_api/app/routers/agents_v2.py +1260 -0
- control_plane_api/app/routers/analytics.py +1014 -0
- control_plane_api/app/routers/context_manager.py +562 -0
- control_plane_api/app/routers/environment_context.py +270 -0
- control_plane_api/app/routers/environments.py +715 -0
- control_plane_api/app/routers/execution_environment.py +517 -0
- control_plane_api/app/routers/executions.py +1911 -0
- control_plane_api/app/routers/health.py +92 -0
- control_plane_api/app/routers/health_v2.py +326 -0
- control_plane_api/app/routers/integrations.py +274 -0
- control_plane_api/app/routers/jobs.py +1344 -0
- control_plane_api/app/routers/models.py +82 -0
- control_plane_api/app/routers/models_v2.py +361 -0
- control_plane_api/app/routers/policies.py +639 -0
- control_plane_api/app/routers/presence.py +234 -0
- control_plane_api/app/routers/projects.py +902 -0
- control_plane_api/app/routers/runners.py +379 -0
- control_plane_api/app/routers/runtimes.py +172 -0
- control_plane_api/app/routers/secrets.py +155 -0
- control_plane_api/app/routers/skills.py +1001 -0
- control_plane_api/app/routers/skills_definitions.py +140 -0
- control_plane_api/app/routers/task_planning.py +1256 -0
- control_plane_api/app/routers/task_queues.py +654 -0
- control_plane_api/app/routers/team_context.py +270 -0
- control_plane_api/app/routers/teams.py +1400 -0
- control_plane_api/app/routers/worker_queues.py +1545 -0
- control_plane_api/app/routers/workers.py +935 -0
- control_plane_api/app/routers/workflows.py +204 -0
- control_plane_api/app/runtimes/__init__.py +6 -0
- control_plane_api/app/runtimes/validation.py +344 -0
- control_plane_api/app/schemas/job_schemas.py +295 -0
- control_plane_api/app/services/__init__.py +1 -0
- control_plane_api/app/services/agno_service.py +619 -0
- control_plane_api/app/services/litellm_service.py +190 -0
- control_plane_api/app/services/policy_service.py +525 -0
- control_plane_api/app/services/temporal_cloud_provisioning.py +150 -0
- control_plane_api/app/skills/__init__.py +44 -0
- control_plane_api/app/skills/base.py +229 -0
- control_plane_api/app/skills/business_intelligence.py +189 -0
- control_plane_api/app/skills/data_visualization.py +154 -0
- control_plane_api/app/skills/docker.py +104 -0
- control_plane_api/app/skills/file_generation.py +94 -0
- control_plane_api/app/skills/file_system.py +110 -0
- control_plane_api/app/skills/python.py +92 -0
- control_plane_api/app/skills/registry.py +65 -0
- control_plane_api/app/skills/shell.py +102 -0
- control_plane_api/app/skills/workflow_executor.py +469 -0
- control_plane_api/app/utils/workflow_executor.py +354 -0
- control_plane_api/app/workflows/__init__.py +11 -0
- control_plane_api/app/workflows/agent_execution.py +507 -0
- control_plane_api/app/workflows/agent_execution_with_skills.py +222 -0
- control_plane_api/app/workflows/namespace_provisioning.py +326 -0
- control_plane_api/app/workflows/team_execution.py +399 -0
- control_plane_api/scripts/seed_models.py +239 -0
- control_plane_api/worker/__init__.py +0 -0
- control_plane_api/worker/activities/__init__.py +0 -0
- control_plane_api/worker/activities/agent_activities.py +1241 -0
- control_plane_api/worker/activities/approval_activities.py +234 -0
- control_plane_api/worker/activities/runtime_activities.py +388 -0
- control_plane_api/worker/activities/skill_activities.py +267 -0
- control_plane_api/worker/activities/team_activities.py +1217 -0
- control_plane_api/worker/config/__init__.py +31 -0
- control_plane_api/worker/config/worker_config.py +275 -0
- control_plane_api/worker/control_plane_client.py +529 -0
- control_plane_api/worker/examples/analytics_integration_example.py +362 -0
- control_plane_api/worker/models/__init__.py +1 -0
- control_plane_api/worker/models/inputs.py +89 -0
- control_plane_api/worker/runtimes/__init__.py +31 -0
- control_plane_api/worker/runtimes/base.py +789 -0
- control_plane_api/worker/runtimes/claude_code_runtime.py +1443 -0
- control_plane_api/worker/runtimes/default_runtime.py +617 -0
- control_plane_api/worker/runtimes/factory.py +173 -0
- control_plane_api/worker/runtimes/validation.py +93 -0
- control_plane_api/worker/services/__init__.py +1 -0
- control_plane_api/worker/services/agent_executor.py +422 -0
- control_plane_api/worker/services/agent_executor_v2.py +383 -0
- control_plane_api/worker/services/analytics_collector.py +457 -0
- control_plane_api/worker/services/analytics_service.py +464 -0
- control_plane_api/worker/services/approval_tools.py +310 -0
- control_plane_api/worker/services/approval_tools_agno.py +207 -0
- control_plane_api/worker/services/cancellation_manager.py +177 -0
- control_plane_api/worker/services/data_visualization.py +827 -0
- control_plane_api/worker/services/jira_tools.py +257 -0
- control_plane_api/worker/services/runtime_analytics.py +328 -0
- control_plane_api/worker/services/session_service.py +194 -0
- control_plane_api/worker/services/skill_factory.py +175 -0
- control_plane_api/worker/services/team_executor.py +574 -0
- control_plane_api/worker/services/team_executor_v2.py +465 -0
- control_plane_api/worker/services/workflow_executor_tools.py +1418 -0
- control_plane_api/worker/tests/__init__.py +1 -0
- control_plane_api/worker/tests/e2e/__init__.py +0 -0
- control_plane_api/worker/tests/e2e/test_execution_flow.py +571 -0
- control_plane_api/worker/tests/integration/__init__.py +0 -0
- control_plane_api/worker/tests/integration/test_control_plane_integration.py +308 -0
- control_plane_api/worker/tests/unit/__init__.py +0 -0
- control_plane_api/worker/tests/unit/test_control_plane_client.py +401 -0
- control_plane_api/worker/utils/__init__.py +1 -0
- control_plane_api/worker/utils/chunk_batcher.py +305 -0
- control_plane_api/worker/utils/retry_utils.py +60 -0
- control_plane_api/worker/utils/streaming_utils.py +373 -0
- control_plane_api/worker/worker.py +753 -0
- control_plane_api/worker/workflows/__init__.py +0 -0
- control_plane_api/worker/workflows/agent_execution.py +589 -0
- control_plane_api/worker/workflows/team_execution.py +429 -0
- kubiya_control_plane_api-0.3.4.dist-info/METADATA +229 -0
- kubiya_control_plane_api-0.3.4.dist-info/RECORD +182 -0
- kubiya_control_plane_api-0.3.4.dist-info/entry_points.txt +2 -0
- kubiya_control_plane_api-0.3.4.dist-info/top_level.txt +1 -0
- kubiya_control_plane_api-0.1.0.dist-info/METADATA +0 -66
- kubiya_control_plane_api-0.1.0.dist-info/RECORD +0 -5
- kubiya_control_plane_api-0.1.0.dist-info/top_level.txt +0 -1
- {kubiya_control_plane_api-0.1.0.dist-info/licenses → control_plane_api}/LICENSE +0 -0
- {kubiya_control_plane_api-0.1.0.dist-info → kubiya_control_plane_api-0.3.4.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Configuration module for Temporal workers.
|
|
3
|
+
|
|
4
|
+
This module provides configuration management for workers.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from .worker_config import WorkerConfig
|
|
8
|
+
|
|
9
|
+
# Create singleton instance
|
|
10
|
+
_worker_config = None
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def get_worker_config() -> WorkerConfig:
|
|
14
|
+
"""
|
|
15
|
+
Get or create the worker configuration singleton.
|
|
16
|
+
|
|
17
|
+
Returns:
|
|
18
|
+
WorkerConfig instance
|
|
19
|
+
"""
|
|
20
|
+
global _worker_config
|
|
21
|
+
|
|
22
|
+
if _worker_config is None:
|
|
23
|
+
_worker_config = WorkerConfig()
|
|
24
|
+
|
|
25
|
+
return _worker_config
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
__all__ = [
|
|
29
|
+
"WorkerConfig",
|
|
30
|
+
"get_worker_config",
|
|
31
|
+
]
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Worker-specific configuration.
|
|
3
|
+
|
|
4
|
+
This module contains settings specific to Temporal workers.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from pydantic_settings import BaseSettings
|
|
8
|
+
from pydantic import Field, validator
|
|
9
|
+
from typing import Optional
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class WorkerConfig(BaseSettings):
|
|
13
|
+
"""Configuration for Temporal workers."""
|
|
14
|
+
|
|
15
|
+
# ==================== Control Plane Connection ====================
|
|
16
|
+
|
|
17
|
+
control_plane_url: str = Field(
|
|
18
|
+
...,
|
|
19
|
+
description="Control Plane API URL (required)",
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
kubiya_api_key: str = Field(
|
|
23
|
+
...,
|
|
24
|
+
description="Kubiya API key for authentication (required)",
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
# ==================== Worker Identity ====================
|
|
28
|
+
|
|
29
|
+
queue_id: str = Field(
|
|
30
|
+
...,
|
|
31
|
+
description="Worker queue ID (required)",
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
worker_id: Optional[str] = Field(
|
|
35
|
+
default=None,
|
|
36
|
+
description="Worker ID (auto-generated if not provided)",
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
worker_hostname: Optional[str] = Field(
|
|
40
|
+
default=None,
|
|
41
|
+
description="Worker hostname (auto-detected if not provided)",
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
# ==================== Worker Settings ====================
|
|
45
|
+
|
|
46
|
+
heartbeat_interval: int = Field(
|
|
47
|
+
default=30,
|
|
48
|
+
description="Heartbeat interval in seconds",
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
max_concurrent_activities: int = Field(
|
|
52
|
+
default=10,
|
|
53
|
+
description="Maximum concurrent activities",
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
max_concurrent_workflows: int = Field(
|
|
57
|
+
default=10,
|
|
58
|
+
description="Maximum concurrent workflow tasks",
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
graceful_shutdown_timeout: int = Field(
|
|
62
|
+
default=30,
|
|
63
|
+
description="Graceful shutdown timeout in seconds",
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
# ==================== Temporal Settings (from Control Plane) ====================
|
|
67
|
+
|
|
68
|
+
temporal_host: Optional[str] = Field(
|
|
69
|
+
default=None,
|
|
70
|
+
description="Temporal server host:port (provided by Control Plane)",
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
temporal_namespace: Optional[str] = Field(
|
|
74
|
+
default=None,
|
|
75
|
+
description="Temporal namespace (provided by Control Plane)",
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
temporal_api_key: Optional[str] = Field(
|
|
79
|
+
default=None,
|
|
80
|
+
description="Temporal API key (provided by Control Plane)",
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
temporal_tls_enabled: bool = Field(
|
|
84
|
+
default=True,
|
|
85
|
+
description="Enable TLS for Temporal connection",
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
# ==================== LiteLLM Settings (from Control Plane) ====================
|
|
89
|
+
|
|
90
|
+
litellm_api_base: Optional[str] = Field(
|
|
91
|
+
default=None,
|
|
92
|
+
description="LiteLLM proxy base URL (provided by Control Plane)",
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
litellm_api_key: Optional[str] = Field(
|
|
96
|
+
default=None,
|
|
97
|
+
description="LiteLLM API key (provided by Control Plane)",
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
litellm_timeout: int = Field(
|
|
101
|
+
default=300,
|
|
102
|
+
description="LiteLLM request timeout in seconds",
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
litellm_max_retries: int = Field(
|
|
106
|
+
default=3,
|
|
107
|
+
description="Maximum retries for LiteLLM requests",
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
# ==================== Runtime Settings ====================
|
|
111
|
+
|
|
112
|
+
default_runtime: str = Field(
|
|
113
|
+
default="agno",
|
|
114
|
+
description="Default agent runtime (agno, claude_code, openai)",
|
|
115
|
+
)
|
|
116
|
+
|
|
117
|
+
enable_streaming: bool = Field(
|
|
118
|
+
default=True,
|
|
119
|
+
description="Enable streaming responses",
|
|
120
|
+
)
|
|
121
|
+
|
|
122
|
+
# ==================== Resource Limits ====================
|
|
123
|
+
|
|
124
|
+
max_memory_mb: Optional[int] = Field(
|
|
125
|
+
default=None,
|
|
126
|
+
description="Maximum memory usage in MB (if set)",
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
max_cpu_percent: Optional[float] = Field(
|
|
130
|
+
default=None,
|
|
131
|
+
description="Maximum CPU usage percentage (if set)",
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
# ==================== Logging Settings ====================
|
|
135
|
+
|
|
136
|
+
log_level: str = Field(
|
|
137
|
+
default="INFO",
|
|
138
|
+
description="Logging level",
|
|
139
|
+
)
|
|
140
|
+
|
|
141
|
+
log_format: str = Field(
|
|
142
|
+
default="json",
|
|
143
|
+
description="Log format (json or text)",
|
|
144
|
+
)
|
|
145
|
+
|
|
146
|
+
log_to_file: bool = Field(
|
|
147
|
+
default=False,
|
|
148
|
+
description="Enable logging to file",
|
|
149
|
+
)
|
|
150
|
+
|
|
151
|
+
log_file_path: str = Field(
|
|
152
|
+
default="worker.log",
|
|
153
|
+
description="Log file path",
|
|
154
|
+
)
|
|
155
|
+
|
|
156
|
+
# ==================== Development Settings ====================
|
|
157
|
+
|
|
158
|
+
debug: bool = Field(
|
|
159
|
+
default=False,
|
|
160
|
+
description="Enable debug mode",
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
reload: bool = Field(
|
|
164
|
+
default=False,
|
|
165
|
+
description="Enable auto-reload on code changes",
|
|
166
|
+
)
|
|
167
|
+
|
|
168
|
+
# ==================== Docker Settings ====================
|
|
169
|
+
|
|
170
|
+
docker_enabled: bool = Field(
|
|
171
|
+
default=True,
|
|
172
|
+
description="Enable Docker tool execution",
|
|
173
|
+
)
|
|
174
|
+
|
|
175
|
+
docker_socket_path: str = Field(
|
|
176
|
+
default="/var/run/docker.sock",
|
|
177
|
+
description="Docker socket path",
|
|
178
|
+
)
|
|
179
|
+
|
|
180
|
+
docker_network: Optional[str] = Field(
|
|
181
|
+
default=None,
|
|
182
|
+
description="Docker network for tool containers",
|
|
183
|
+
)
|
|
184
|
+
|
|
185
|
+
# ==================== Monitoring Settings ====================
|
|
186
|
+
|
|
187
|
+
metrics_enabled: bool = Field(
|
|
188
|
+
default=False,
|
|
189
|
+
description="Enable Prometheus metrics",
|
|
190
|
+
)
|
|
191
|
+
|
|
192
|
+
metrics_port: int = Field(
|
|
193
|
+
default=9091,
|
|
194
|
+
description="Prometheus metrics port",
|
|
195
|
+
)
|
|
196
|
+
|
|
197
|
+
tracing_enabled: bool = Field(
|
|
198
|
+
default=False,
|
|
199
|
+
description="Enable OpenTelemetry tracing",
|
|
200
|
+
)
|
|
201
|
+
|
|
202
|
+
otlp_endpoint: Optional[str] = Field(
|
|
203
|
+
default=None,
|
|
204
|
+
description="OpenTelemetry collector endpoint",
|
|
205
|
+
)
|
|
206
|
+
|
|
207
|
+
# ==================== Security Settings ====================
|
|
208
|
+
|
|
209
|
+
enable_sandbox: bool = Field(
|
|
210
|
+
default=True,
|
|
211
|
+
description="Enable execution sandboxing",
|
|
212
|
+
)
|
|
213
|
+
|
|
214
|
+
allowed_commands: Optional[str] = Field(
|
|
215
|
+
default=None,
|
|
216
|
+
description="Comma-separated list of allowed shell commands",
|
|
217
|
+
)
|
|
218
|
+
|
|
219
|
+
blocked_commands: str = Field(
|
|
220
|
+
default="rm -rf,sudo,su,chmod,chown,mount,umount,iptables",
|
|
221
|
+
description="Comma-separated list of blocked shell commands",
|
|
222
|
+
)
|
|
223
|
+
|
|
224
|
+
@validator("blocked_commands", "allowed_commands")
|
|
225
|
+
def parse_command_list(cls, v):
|
|
226
|
+
"""Parse comma-separated command list."""
|
|
227
|
+
if v:
|
|
228
|
+
return [cmd.strip() for cmd in v.split(",") if cmd.strip()]
|
|
229
|
+
return []
|
|
230
|
+
|
|
231
|
+
class Config:
|
|
232
|
+
"""Pydantic config."""
|
|
233
|
+
env_file = ".env.worker"
|
|
234
|
+
env_file_encoding = "utf-8"
|
|
235
|
+
case_sensitive = False
|
|
236
|
+
|
|
237
|
+
# Environment variable prefix
|
|
238
|
+
env_prefix = ""
|
|
239
|
+
|
|
240
|
+
# Allow these environment variables
|
|
241
|
+
fields = {
|
|
242
|
+
"control_plane_url": {"env": ["CONTROL_PLANE_URL", "control_plane_url"]},
|
|
243
|
+
"kubiya_api_key": {"env": ["KUBIYA_API_KEY", "kubiya_api_key"]},
|
|
244
|
+
"queue_id": {"env": ["QUEUE_ID", "queue_id"]},
|
|
245
|
+
"worker_id": {"env": ["WORKER_ID", "worker_id"]},
|
|
246
|
+
"heartbeat_interval": {"env": ["HEARTBEAT_INTERVAL", "heartbeat_interval"]},
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
def update_from_control_plane(self, control_plane_config: dict) -> None:
|
|
250
|
+
"""
|
|
251
|
+
Update configuration with values from Control Plane.
|
|
252
|
+
|
|
253
|
+
This is called after worker registration to update settings
|
|
254
|
+
with values provided by the Control Plane.
|
|
255
|
+
|
|
256
|
+
Args:
|
|
257
|
+
control_plane_config: Configuration from Control Plane /start endpoint
|
|
258
|
+
"""
|
|
259
|
+
if "temporal_host" in control_plane_config:
|
|
260
|
+
self.temporal_host = control_plane_config["temporal_host"]
|
|
261
|
+
|
|
262
|
+
if "temporal_namespace" in control_plane_config:
|
|
263
|
+
self.temporal_namespace = control_plane_config["temporal_namespace"]
|
|
264
|
+
|
|
265
|
+
if "temporal_api_key" in control_plane_config:
|
|
266
|
+
self.temporal_api_key = control_plane_config["temporal_api_key"]
|
|
267
|
+
|
|
268
|
+
if "litellm_api_url" in control_plane_config:
|
|
269
|
+
self.litellm_api_base = control_plane_config["litellm_api_url"]
|
|
270
|
+
|
|
271
|
+
if "litellm_api_key" in control_plane_config:
|
|
272
|
+
self.litellm_api_key = control_plane_config["litellm_api_key"]
|
|
273
|
+
|
|
274
|
+
if "worker_id" in control_plane_config:
|
|
275
|
+
self.worker_id = control_plane_config["worker_id"]
|