|
12 | 12 | from ai.backend.common.plugin.monitor import ErrorPluginContext |
13 | 13 | from ai.backend.manager.actions.monitors.monitor import ActionMonitor |
14 | 14 | from ai.backend.manager.actions.types import AbstractProcessorPackage, ActionSpec |
| 15 | +from ai.backend.manager.actions.validator.args import ValidatorArgs |
15 | 16 | from ai.backend.manager.agent_cache import AgentRPCCache |
16 | 17 | from ai.backend.manager.config.provider import ManagerConfigProvider |
17 | 18 | from ai.backend.manager.idle import IdleCheckerHost |
@@ -318,6 +319,8 @@ def create(cls, args: ServiceArgs) -> Self: |
318 | 319 | @dataclass |
319 | 320 | class ProcessorArgs: |
320 | 321 | service_args: ServiceArgs |
| 322 | + action_monitors: list[ActionMonitor] |
| 323 | + action_validator_args: ValidatorArgs |
321 | 324 |
|
322 | 325 |
|
323 | 326 | @dataclass |
@@ -349,61 +352,65 @@ class Processors(AbstractProcessorPackage): |
349 | 352 | storage_namespace: StorageNamespaceProcessors |
350 | 353 |
|
351 | 354 | @classmethod |
352 | | - def create(cls, args: ProcessorArgs, action_monitors: list[ActionMonitor]) -> Self: |
| 355 | + def create(cls, args: ProcessorArgs) -> Self: |
353 | 356 | services = Services.create(args.service_args) |
354 | | - agent_processors = AgentProcessors(services.agent, action_monitors) |
355 | | - domain_processors = DomainProcessors(services.domain, action_monitors) |
356 | | - group_processors = GroupProcessors(services.group, action_monitors) |
357 | | - user_processors = UserProcessors(services.user, action_monitors) |
358 | | - image_processors = ImageProcessors(services.image, action_monitors) |
| 357 | + agent_processors = AgentProcessors(services.agent, args.action_monitors) |
| 358 | + domain_processors = DomainProcessors(services.domain, args.action_monitors) |
| 359 | + group_processors = GroupProcessors(services.group, args.action_monitors) |
| 360 | + user_processors = UserProcessors(services.user, args.action_monitors) |
| 361 | + image_processors = ImageProcessors(services.image, args.action_monitors) |
359 | 362 | container_registry_processors = ContainerRegistryProcessors( |
360 | | - services.container_registry, action_monitors |
| 363 | + services.container_registry, args.action_monitors |
361 | 364 | ) |
362 | | - vfolder_processors = VFolderProcessors(services.vfolder, action_monitors) |
363 | | - vfolder_file_processors = VFolderFileProcessors(services.vfolder_file, action_monitors) |
| 365 | + vfolder_processors = VFolderProcessors( |
| 366 | + services.vfolder, args.action_monitors, args.action_validator_args |
| 367 | + ) |
| 368 | + vfolder_file_processors = VFolderFileProcessors(services.vfolder_file, args.action_monitors) |
364 | 369 | vfolder_invite_processors = VFolderInviteProcessors( |
365 | | - services.vfolder_invite, action_monitors |
| 370 | + services.vfolder_invite, args.action_monitors |
366 | 371 | ) |
367 | | - session_processors = SessionProcessors(services.session, action_monitors) |
| 372 | + session_processors = SessionProcessors(services.session, args.action_monitors) |
368 | 373 | keypair_resource_policy_processors = KeypairResourcePolicyProcessors( |
369 | | - services.keypair_resource_policy, action_monitors |
| 374 | + services.keypair_resource_policy, args.action_monitors |
370 | 375 | ) |
371 | 376 | user_resource_policy_processors = UserResourcePolicyProcessors( |
372 | | - services.user_resource_policy, action_monitors |
| 377 | + services.user_resource_policy, args.action_monitors |
373 | 378 | ) |
374 | 379 | project_resource_policy_processors = ProjectResourcePolicyProcessors( |
375 | | - services.project_resource_policy, action_monitors |
| 380 | + services.project_resource_policy, args.action_monitors |
376 | 381 | ) |
377 | 382 | resource_preset_processors = ResourcePresetProcessors( |
378 | | - services.resource_preset, action_monitors |
| 383 | + services.resource_preset, args.action_monitors |
| 384 | + ) |
| 385 | + model_serving_processors = ModelServingProcessors( |
| 386 | + services.model_serving, args.action_monitors |
379 | 387 | ) |
380 | | - model_serving_processors = ModelServingProcessors(services.model_serving, action_monitors) |
381 | 388 | model_serving_auto_scaling_processors = ModelServingAutoScalingProcessors( |
382 | | - services.model_serving_auto_scaling, action_monitors |
| 389 | + services.model_serving_auto_scaling, args.action_monitors |
383 | 390 | ) |
384 | 391 | utilization_metric_processors = UtilizationMetricProcessors( |
385 | | - services.utilization_metric, action_monitors |
| 392 | + services.utilization_metric, args.action_monitors |
386 | 393 | ) |
387 | | - auth = AuthProcessors(services.auth, action_monitors) |
| 394 | + auth = AuthProcessors(services.auth, args.action_monitors) |
388 | 395 | object_storage_processors = ObjectStorageProcessors( |
389 | | - services.object_storage, action_monitors |
| 396 | + services.object_storage, args.action_monitors |
390 | 397 | ) |
391 | | - vfs_storage_processors = VFSStorageProcessors(services.vfs_storage, action_monitors) |
392 | | - artifact_processors = ArtifactProcessors(services.artifact, action_monitors) |
| 398 | + vfs_storage_processors = VFSStorageProcessors(services.vfs_storage, args.action_monitors) |
| 399 | + artifact_processors = ArtifactProcessors(services.artifact, args.action_monitors) |
393 | 400 | artifact_registry_processors = ArtifactRegistryProcessors( |
394 | | - services.artifact_registry, action_monitors |
| 401 | + services.artifact_registry, args.action_monitors |
395 | 402 | ) |
396 | 403 | artifact_revision_processors = ArtifactRevisionProcessors( |
397 | | - services.artifact_revision, action_monitors |
| 404 | + services.artifact_revision, args.action_monitors |
398 | 405 | ) |
399 | 406 |
|
400 | 407 | # Initialize deployment processors if service is available |
401 | 408 | deployment_processors = None |
402 | 409 | if services.deployment is not None: |
403 | | - deployment_processors = DeploymentProcessors(services.deployment, action_monitors) |
| 410 | + deployment_processors = DeploymentProcessors(services.deployment, args.action_monitors) |
404 | 411 |
|
405 | 412 | storage_namespace_processors = StorageNamespaceProcessors( |
406 | | - services.storage_namespace, action_monitors |
| 413 | + services.storage_namespace, args.action_monitors |
407 | 414 | ) |
408 | 415 |
|
409 | 416 | return cls( |
|
0 commit comments