Avionix Airflow Options¶
avionix_airflow
’s configuration can be changed by using option objects. For
the local implementation most settings will not need to be changed, but for cloud
implementations many will likely need to be set, in particular the AwsOptions
and AirflowOptions
.
-
class
avionix_airflow.
AirflowOptions
(dag_sync_image, dag_sync_command, dag_sync_schedule, dag_storage='50Mi', log_storage='50Mi', external_storage='50Mi', default_executor_cpu=5, default_executor_memory=2, access_modes=None, default_timezone='utc', core_executor='CeleryExecutor', namespace='airflow', domain_name='www.avionix-airflow.com', additional_vars=None, fernet_key='', dags_paused_at_creation=True, worker_image='', worker_image_tag='', open_node_ports=False, local_mode=False, smtp_notification_options=None, git_ssh_key=None, image_pull_policy='IfNotPresent', master_image='', master_image_tag='', delete_pods_on_failure=False) Class for storing airflow options. Note that for storage specification the default unit is bytes, and you can use Mi or Gi to specify larger units.
- Parameters
dag_sync_image (
str
) – The image to use for syncing dagsdag_sync_command (
List
[str
]) – The commands to use for syncing dagsdag_sync_schedule (
str
) – Cron format schedule for how often to sync dagsdag_storage (
str
) – How much persistent storage to allocate for dagslogs_storage – How much persistent storage to allocate for dags
external_storage (
str
) – How much external storage to allocate for dagsdefault_executor_cpu (
int
) – Default CPU to allocate to the executor This is specified in number of vCPUs. You can fractions of CPUs as well or milliCPUs (eg. “500m” for 500 milliCPUs)default_executor_memory (
int
) – Default memory to allocate to the executor This can be specified in bytes (default) or using standard prefix (eg. “20Mi”)access_modes (
Optional
[InitVar
]) – Used to set access modes on the dag and logs volumesdefault_timezone (
str
) – The default timezonecore_executor (
str
) – The core executor to use, supported executors are “KubernetesExecutor” and “CeleryExecutor”namespace (
str
) – The kubernetes namespace to use for the installationdomain_name (
Optional
[str
]) – The domain name to place on the ingress controlleradditional_vars (
Optional
[InitVar
]) – Any additional environment variables to place on the airflow nodes. Note that you can add additional airflow configuration using this setting. For more info on this see the airflow config documentationfernet_key (
InitVar
) – The fernet key to use for airflow, this is autogenerated by default, so unless you need to use an old fernet key, just leave thisdags_paused_at_creation (
bool
) – Whether or not dags should be paused on creationworker_image (
str
) – The docker image to use as the airflow workerworker_image_tag (
str
) – The docker tag of the airflow worker imageopen_node_ports (
bool
) – Whether to expose the node portslocal_mode (
bool
) – Whether or not to run in local modeimage_pull_policy (
str
) – Policy for pulling docker image. Can be one of “Never”, “Always”, “IfNotPresent”master_image_tag (
str
) – The docker tag to use for the master imagedelete_pods_on_failure (
bool
) – Whether or not to terminate pods if KubernetesExecutor task fails
-
class
avionix_airflow.
AwsOptions
(efs_id, cluster_name, elastic_search_access_role_arn, default_role_arn, alb_role_arn, external_dns_role_arn, autoscaling_role_arn, dag_sync_role_arn, domain, domain_filters=None, use_ssl=False) Settings for the AWS Managed Node Group setup
- Parameters
efs_id (
str
) – The id of the EFS file system to use as the storage providercluster_name (
str
) – The name of the EKS clusterelastic_search_access_role_arn (
str
) – The IAM role arn for accessing elastic searchdefault_role_arn (
str
) – The default IAM role arn for pods in the clusteralb_role_arn (
str
) – The IAM role setting up application load balancingexternal_dns_role_arn (
str
) – The IAM role for setting the domain nameautoscaling_role_arn (
str
) – The IAM role for controlling the cluster scalingdomain (
str
) – The AWS domain name to usedag_sync_role_arn (
str
) – The IAM role use for controlling retrieval of dagsdomain_filters (
Optional
[List
[str
]]) – A list used to filter out route53 domain namesuse_ssl (
bool
) – Whether or not to use SSL encryption, (Recommended to be True)
-
class
avionix_airflow.
MonitoringOptions
(enabled=True, elastic_search_uri='http://elasticsearch-master:9200', grafana_role='Viewer', elastic_search_proxy_uri='elasticsearch-master') Configurations for monitoring airflow
- Parameters
enabled (
bool
) – Whether or not monitoring should be enabledelastic_search_uri (
str
) – The uri to use for elastic searchgrafana_role (
str
) – The role to use for grafana can be one of [“Viewer”, “Editor”, “Admin”]elastic_search_proxy_uri (
str
) – The uri to use as the elastic search proxy, this shouldn’t be changed unless using an external elastic search provider
-
class
avionix_airflow.
RedisOptions
(port=6379, host='redis-svc', proto='redis://', password='', db_num=1) Configuration for redis if using “CeleryExecutor” option in AirflowOptions
- Parameters
port (
int
) – The port to use for redishost (
str
) – Name of the redis host, defaults to the internal service nameproto (
str
) – Redis protocolpassword (
str
) – Redis passworddb_num (
int
) – Redis db number
-
class
avionix_airflow.
SqlOptions
(user='airflow', password='airflow', host='airflow-database-connection', port=5432, db='airflow', create_database_in_cluster=True, extras='') Provides configuration for the airflow backend database. Currently only postgres is supported. Note that all connection related strings will be stored in kubernetes secrets on the cluster.
- Parameters
user (
str
) – The username for databasepassword (
str
) – The pass for the databasehost (
str
) – The hostname for the databaseport (
int
) – The port to keep open for the databasedb (
str
) – The database namecreate_database_in_cluster (
bool
) – Whether airflow should create the databaseextras – Any extra params to be appended to the end of the db connection string