actor.ActorEnvironment#
- class union.actor.ActorEnvironment(name, container_image=None, backlog_length=None, parallelism=1, replica_count=1, ttl_seconds=100, environment=None, requests=None, limits=None, accelerator=None, secret_requests=None)#
ActorEnvironment class.
- Parameters:
name (str) – The name of the actor. This is used in conjunction with the project, domain, and version to uniquely identify the actor.
container_image (str | ImageSpec | None) – The container image to use for the task. Set to default image if none provided.
backlog_length (int | None) – The number of tasks to keep in the worker queue on the backend. Setting backlog_length ensures that the worker executing actor tasks immediately executes the next task after completing the previous one instead of waiting for the scheduler to complete other operations before scheduling the next task.
parallelism (int) – The number of tasks that can execute in parallel, per worker.
replica_count (int) – The number of workers to provision that are able to accept tasks.
ttl_seconds (int) – How long to keep the Actor alive while no tasks are being run.
environment (Dict[str, str] | None) – Environment variables as key, value pairs in a Python dictionary.
requests (Resources | None) – Compute resource requests per task.
limits (Resources | None) – Compute resource limits.
accelerator (BaseAccelerator | None) – The accelerator device to use for the task.
secret_requests (List[Secret] | None) – Keys (ideally descriptive) that can identify the secrets supplied at runtime.