Spaces:
Runtime error
Runtime error
File size: 663 Bytes
105b369 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
from typing import Optional, Union, List, Dict
from phi.k8s.app.airflow.base import AirflowBase, ContainerContext
class AirflowWorker(AirflowBase):
# -*- App Name
name: str = "airflow-worker"
# Command for the container
command: Optional[Union[str, List[str]]] = "worker"
# Queue name for the worker
queue_name: str = "default"
def get_container_env(self, container_context: ContainerContext) -> Dict[str, str]:
container_env: Dict[str, str] = super().get_container_env(container_context=container_context)
# Set the queue name
container_env["QUEUE_NAME"] = self.queue_name
return container_env
|