Тип сервиса
Сервис Apache Airflow
Сервис оркестрации процессов Apache Airflow, собранный из вашего Git-репозитория: ваши DAG, плагины и Python-пакеты есть в каждом компоненте Airflow, метаданные хранятся в связанном PostgreSQL.
Этот сервис запускает ваш код: его образ собирается из Git-репозитория, а каждая сборка развёртывается в окружение.
В StackMaster
Как Apache Airflow работает в StackMaster
apache/airflow image built with the app's repository. Configuration is passed as AIRFLOW__<SECTION>__<KEY> environment variables, which take precedence over airflow.cfg.Processes
One pod runs four containers on the same volume: the API server (main container, port 8080, also the web interface), scheduler, dag-processor and triggerer. Before they start, an init container migrates the metadata database (_AIRFLOW_DB_MIGRATE) and creates the administrator (_AIRFLOW_WWW_USER_CREATE). The executor is LocalExecutor: tasks run inside the scheduler container, so their memory comes from that container's limit, which is set with the other containers' resources on the app service. Airflow itself doesn't cap a task's memory; AIRFLOW__CORE__PARALLELISM and DAG-level max_active_tasks limit how many tasks run at once. The service is not scalable.
Linked services
| Link | Variables |
|---|---|
| PostgreSQL (required) | AIRFLOW__DATABASE__SQL_ALCHEMY_CONN |
It is the metadata database of Airflow. Do not set the connection elsewhere.
Generated credentials
| Token | Variable | Use |
|---|---|---|
admin_username, admin_password | _AIRFLOW_WWW_USER_USERNAME, _AIRFLOW_WWW_USER_PASSWORD | administrator created by the init container; an existing user is left as it is |
fernet_key | AIRFLOW__CORE__FERNET_KEY | encrypts connection passwords stored in the database |
api_secret_key | AIRFLOW__API__SECRET_KEY | API server sessions |
api_auth_jwt_secret | AIRFLOW__API_AUTH__JWT_SECRET | tokens between Airflow components and for the API |
Users are managed by the FAB auth manager (AIRFLOW__CORE__AUTH_MANAGER). Example DAGs are off (AIRFLOW__CORE__LOAD_EXAMPLES).
Image and DAGs
The image is built from the app's Git repository on top of the apache/airflow image of the service's version, so the service's versions are Airflow versions. Start the repository from the Airflow boilerplate. The build:
- copies the repository to
/opt/airflow-app, outside the/opt/airflowdata volume, which would hide files baked into the image; - installs the packages in
requirements.txt, when the repository has one, with Airflow pinned to the image's version, so packages that need another Airflow fail the build; - sets
AIRFLOW__CORE__DAGS_FOLDERto/opt/airflow-app/dagsandAIRFLOW__CORE__PLUGINS_FOLDERto/opt/airflow-app/plugins.
Every Airflow component runs the built image: the API server, scheduler, DAG processor and triggerer are build containers of the workload, and the setup step gets the image through helm.image.references. DAG and package changes reach Airflow with the next deployment. Airflow's version comes from the service version and the image, not from the repository.
Put DAG files in dags/ and plugins in plugins/ of the repository; the dags and plugins directories on the data volume are not read. The data volume is mounted at /opt/airflow, the Airflow home, in every container and keeps Airflow's logs.
Changing configuration
Add or change AIRFLOW__* environment variables on the service and deploy it. The scheduler, DAG processor and triggerer get only the service's secret variables, from the environment Secret, plus the executor, examples and auth manager settings declared in the manifest; after a change, check that it reached the container that uses it.
Check the result
/api/v2/monitor/health on port 8080 reports the state of the metadata database, scheduler, DAG processor and triggerer.
Обзор
Технический профиль Apache Airflow
Версии
Репозиторий исходного кода
Публичный Helm-чарт
Постоянные тома
Стеки
Стеки, в которые входит Apache Airflow
CI/CD
Сборка Apache Airflow из Git-репозитория
Vanilla Airflow project
Используйте его как есть или клонируйте в свой Git-аккаунт.
wodby/airflow-boilerplateCI-провайдеры
StackMaster CI встроен в платформу: пайплайн описывается в файле .wodby/pipeline.yml в репозитории. Для подключённого репозитория те же шаги может выполнять внешний CI-провайдер с помощью StackMaster CLI.
Реестры контейнеров
Собранные образы по умолчанию попадают в StackMaster Registry или во внешний реестр, подключённый как интеграция.
Переменные окружения из интеграций
Интеграция с переменными один раз сохраняет учётные данные стороннего сервиса. Подключите её к Apache Airflow, и StackMaster передаст их в контейнер как переменные окружения во время работы, а не при сборке образа.
Конфигурация
Конфигурация сервиса Apache Airflow
Технические домены
Тома
Связи сервиса
Каждая связь — это подключение Apache Airflow к другому сервису. На какой сервис указывает связь, задаёт стек. На карточках перечислены публичные сервисы, которые подходят для каждой связи.
postgres
Сервисы, которые подходят для этой связи