Skip to main content

Utilities for tracking hosts and ports and load balancing DAGs

Project description

airflow balancer

Utilities for tracking hosts and ports and load balancing DAGs

Build Status codecov License PyPI

Overview

airflow-balancer is a utility library for Apache Airflow to track host and port usage via yaml files. It is tightly integrated with airflow-laminar/airflow-config.

With airflow-balancer, you can register host and port usage in configuration:

_target_: airflow_balancer.BalancerConfiguration
default_username: timkpaine
hosts:
  - name: host1
    size: 16
    os: ubuntu
    queues: [primary]

  - name: host2
    os: ubuntu
    size: 16
    queues: [workers]

  - name: host3
    os: macos
    size: 8
    queues: [workers]

ports:
  - host: host1
    port: 8080

  - host_name: host2
    port: 8793

Either via airflow-config or directly, you can then select amongst available hosts for use in your DAGs.

from airflow_balaner import BalancerConfiguration, load

balancer_config: BalancerConfiguration = load("balancer.yaml")

host = balancer_config.select_host(queue="workers")
port = balancer_config.free_port(host=host)

...

operator = SSHOperator(ssh_hook=host.hook(), ...)

Visualization

Configuration, and Host and Port listing is built into the extension, available either from the topbar in Airflow or as a standalone viewer (via the airflow-balancer-viewer CLI).

Installation

You can install from pip:

pip install airflow-balancer

Or via conda:

conda install airflow-balancer -c conda-forge

License

This software is licensed under the Apache 2.0 license. See the LICENSE file for details.

[!NOTE] This library was generated using copier from the Base Python Project Template repository.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

airflow_balancer-0.7.7.tar.gz (271.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

airflow_balancer-0.7.7-py3-none-any.whl (245.1 kB view details)

Uploaded Python 3

File details

Details for the file airflow_balancer-0.7.7.tar.gz.

File metadata

  • Download URL: airflow_balancer-0.7.7.tar.gz
  • Upload date:
  • Size: 271.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.11

File hashes

Hashes for airflow_balancer-0.7.7.tar.gz
Algorithm Hash digest
SHA256 856bc7c0115bf26da3c70f55c5b0f55d5261892217e95ea576e95952f42ce984
MD5 dcf8cbc1dfe7ac9924b08cd6b44eaf3c
BLAKE2b-256 592a486e4131a5879470d0cd81fa953cddf3fe9a5602400c72d1c124d5dcc945

See more details on using hashes here.

File details

Details for the file airflow_balancer-0.7.7-py3-none-any.whl.

File metadata

File hashes

Hashes for airflow_balancer-0.7.7-py3-none-any.whl
Algorithm Hash digest
SHA256 72ac4834419c1c5b567e3e32e76923ee706ae689cbfb692be0325a8251d47d6c
MD5 3bb20af4aaad13c0a1873f1fbe4664f5
BLAKE2b-256 00ff82e0cb506b6b0e74d7a442bf68a9b25cc9578967a2f3eb4f891a9cc233d5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page