Skip to content

Commit 8f12363

Browse files
authored
feat(server): add global togle to disable managed provider downscaling (#1717)
Signed-off-by: Radek Ježek <[email protected]>
1 parent 850a714 commit 8f12363

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

apps/agentstack-server/src/agentstack_server/configuration.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ class DockerConfigJson(BaseModel):
231231

232232

233233
class ManagedProviderConfiguration(BaseModel):
234+
disable_downscaling: bool = False
234235
manifest_template_dir: Path | None = None
235236
self_registration_use_local_network: bool = Field(
236237
default=False,

apps/agentstack-server/src/agentstack_server/jobs/crons/provider.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@
3131
@blueprint.periodic(cron="*/1 * * * *")
3232
@blueprint.task(queueing_lock="scale_down_providers", queue=str(Queues.CRON_PROVIDER))
3333
@inject
34-
async def scale_down_providers(timestamp: int, service: ProviderService):
34+
async def scale_down_providers(timestamp: int, service: ProviderService, configuration: Configuration):
35+
if configuration.provider.disable_downscaling:
36+
return
3537
await service.scale_down_providers()
3638

3739

helm/templates/deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,8 @@ spec:
273273
- name: AUTH__DISABLE_AUTH
274274
value: "true"
275275
{{- end }}
276-
{{- if .Values.features.selfRegistration }}
277-
- name: PROVIDER__AUTO_REMOVE_ENABLED
276+
{{- if .Values.disableProviderDownscaling }}
277+
- name: PROVIDER__DISABLE_DOWNSCALING
278278
value: "true"
279279
{{- end }}
280280
- name: GENERATE_CONVERSATION_TITLE__ENABLED

helm/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ providers: []
8383
unmanagedProviders: [] # DEPRECATED: use providers instead
8484
variables: {} # DEPRECATED: use server API to manage variables instead
8585

86+
disableProviderDownscaling: false
87+
8688
# External registries in the format: [name: githubURL]
8789
# for example
8890
# github: "https://github.com/i-am-bee/[email protected]#path=agent-registry.yaml"

0 commit comments

Comments
 (0)