ProcessContext¶
- class controller.factory.ProcessContext(config, http_client, kubernetes_client, image_service, prepuller, lab_manager, _fileserver_manager, background)¶
Bases:
object
Per-process global application state.
This object holds all of the per-process singletons and is managed by
ContextDependency
. It is used by theFactory
class as a source of dependencies to inject into created service and storage objects, and by the context dependency as a source of singletons that should also be exposed to route handlers via the request context.- Parameters:
config (
Config
)http_client (
AsyncClient
)kubernetes_client (
ApiClient
)image_service (
ImageService
)prepuller (
Prepuller
)lab_manager (
LabManager
)_fileserver_manager (
FileserverManager
|None
)background (
BackgroundTaskManager
)
Attributes Summary
Manager for background tasks.
Lab controller configuration.
File server manager, if file servers are configured.
Shared HTTP client.
Image service.
Shared Kubernetes client.
State management for user lab pods.
Prepuller.
Methods Summary
aclose
()Free allocated resources.
from_config
(config)Create a new process context from the controller configuration.
start
()Start the background threads running.
stop
()Clean up a process context.
Attributes Documentation
-
background:
BackgroundTaskManager
¶ Manager for background tasks.
- fileserver_manager¶
File server manager, if file servers are configured.
-
http_client:
AsyncClient
¶ Shared HTTP client.
-
image_service:
ImageService
¶ Image service.
-
kubernetes_client:
ApiClient
¶ Shared Kubernetes client.
-
lab_manager:
LabManager
¶ State management for user lab pods.
Methods Documentation