Skip to content

Commit 6205582

Browse files
committed
feat(server): add global togle to disable managed provider downscaling
Signed-off-by: Radek Ježek <[email protected]>
1 parent 0c161fa commit 6205582

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
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: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,13 @@
2727

2828
blueprint = Blueprint()
2929

30+
if not get_configuration().provider.disable_downscaling:
3031

31-
@blueprint.periodic(cron="*/1 * * * *")
32-
@blueprint.task(queueing_lock="scale_down_providers", queue=str(Queues.CRON_PROVIDER))
33-
@inject
34-
async def scale_down_providers(timestamp: int, service: ProviderService):
35-
await service.scale_down_providers()
32+
@blueprint.periodic(cron="*/1 * * * *")
33+
@blueprint.task(queueing_lock="scale_down_providers", queue=str(Queues.CRON_PROVIDER))
34+
@inject
35+
async def scale_down_providers(timestamp: int, service: ProviderService):
36+
await service.scale_down_providers()
3637

3738

3839
# TODO: Can't use DI here because it's not initialized yet

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)