Skip to content

Commit 9de8372

Browse files
committed
[v3-0-test] Unify selecting constraints option when installing airflow (apache#52274)
Due to the way how it historically got added - we had two ways of selecting whether we are installing airlfow dyanmically in breeze with or without constraints: * --install-airflow-with-constraints - was used in a few places * --skip-airflow-constraints - was used in other places The logic to handle those were broken at places where they contradicted each other. This PR unifies it and only uses the --install-airflow-with-constraints flag in all the places where we need to determine whether constraints are used or not and it fixes the logic. The logic of installation had been reviewed, refactored into separate methods doing smaller tasks and more diagnostics was added. (cherry picked from commit 8846bef) Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
1 parent 2c68949 commit 9de8372

93 files changed

Lines changed: 2695 additions & 1175 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/test-providers.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ jobs:
138138
- name: "Install and verify wheel provider distributions"
139139
env:
140140
DISTRIBUTION_FORMAT: ${{ matrix.package-format }}
141-
AIRFLOW_SKIP_CONSTRAINTS: "${{ inputs.upgrade-to-newer-dependencies }}"
141+
# yamllint disable rule:line-length
142+
INSTALL_AIRFLOW_WITH_CONSTRAINTS: "${{ inputs.upgrade-to-newer-dependencies == 'true' && 'false' || 'true' }}"
142143
run: >
143144
breeze release-management verify-provider-distributions
144145
--use-distributions-from-dist

dev/breeze/doc/01_installation.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,17 @@ We highly recommend using ``uv`` to manage your Python environments, as it is ve
157157
easy to use, it is faster than any of the other tools availables (way faster!) and has a lot of features
158158
that make it easier to work with Python.
159159

160+
The ``gh`` cli needed for release managers
161+
------------------------------------------
162+
163+
The ``gh`` GitHub CLI is a command line tool that allows you to interact with GitHub repositories, issues, pull
164+
requests, and more. It is useful for release managers to automate tasks such as creating releases,
165+
managing issues, and starting workflows (for example during documentation building). Release
166+
managers should have ``gh`` installed (see `gh installation guide <https://github.com/cli/cli>`_) and they
167+
should follow configuration steps to authorize ``gh`` in their local airflow repository (basically
168+
running ``gh auth login`` command and following the instructions).
169+
170+
160171
Alternative: pipx tool
161172
----------------------
162173

dev/breeze/doc/02_customizing.rst

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,12 @@ that you may find helpful.
9393
bind -T root C-S-Up select-pane -U
9494
bind -T root C-S-Down select-pane -D
9595
96+
# quickly disable mouse + zoom pane (for easy copying)
97+
bind c run-shell "tmux setw mouse off" \; resize-pane -Z \; display-message "🚫 Mouse disabled & pane zoomed"
98+
99+
# quickly re-enable mouse + unzoom pane (restore normal behavior)
100+
bind v run-shell "tmux setw mouse on" \; resize-pane -Z \; display-message "🖱️ Mouse enabled & pane unzoomed"
101+
96102
Some helpful commands:
97103

98104
- ``ctrl-b + z``: zoom into selected pane
@@ -106,6 +112,10 @@ To copy an entire pane:
106112
- extend selection to end: ``G``
107113
- copy and clear selection: ``enter``
108114

115+
.. tip::
116+
117+
You can add the custom bindings (like ``bind c`` and ``bind v``) directly to ``files/airflow-breeze-config/.tmux.conf``.
118+
This way they will be automatically loaded when you start a Breeze tmux session.
109119

110120
Additional tools in Breeze container
111121
------------------------------------
@@ -143,12 +153,12 @@ When Breeze starts, it can start additional integrations. Those are additional d
143153
that are started in the same docker-compose command. Those are required by some of the tests
144154
as described in `</contributing-docs/testing/integration_tests.rst>`_.
145155

146-
By default Breeze starts only airflow container without any integration enabled. If you selected
156+
By default Breeze starts only Airflow container without any integration enabled. If you selected
147157
``postgres`` or ``mysql`` backend, the container for the selected backend is also started (but only the one
148158
that is selected). You can start the additional integrations by passing ``--integration`` flag
149159
with appropriate integration name when starting Breeze. You can specify several ``--integration`` flags
150160
to start more than one integration at a time.
151-
Finally you can specify ``--integration all-testable`` to start all testable integrations and
161+
Finally, you can specify ``--integration all-testable`` to start all testable integrations and
152162
``--integration all`` to enable all integrations.
153163

154164
Once integration is started, it will continue to run until the environment is stopped with

dev/breeze/doc/03_developer_tasks.rst

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ When you run Airflow Breeze, the following ports are automatically forwarded:
112112
.. code-block::
113113
114114
* 12322 -> forwarded to Airflow ssh server -> airflow:22
115-
* 28080 -> forwarded to Airflow API server or webserver -> airflow:8080
115+
* 28080 -> forwarded to Airflow API server -> airflow:8080
116116
* 25555 -> forwarded to Flower dashboard -> airflow:5555
117117
* 25433 -> forwarded to Postgres database -> postgres:5432
118118
* 23306 -> forwarded to MySQL database -> mysql:3306
@@ -124,20 +124,23 @@ You can connect to these ports/databases using:
124124
.. code-block::
125125
126126
* ssh connection for remote debugging: ssh -p 12322 airflow@localhost pw: airflow
127-
* API server or webserver: http://localhost:28080
127+
* API server: http://localhost:28080
128128
* Flower: http://localhost:25555
129129
* Postgres: jdbc:postgresql://localhost:25433/airflow?user=postgres&password=airflow
130130
* Mysql: jdbc:mysql://localhost:23306/airflow?user=root
131131
* Redis: redis://localhost:26379/0
132132
133133
If you do not use ``start-airflow`` command. You can use ``tmux`` to multiply terminals.
134-
You may need to create a user prior to running the webserver in order to log in.
134+
You may need to create a user prior to running the API server in order to log in.
135135
This can be done with the following command:
136136

137137
.. code-block:: bash
138138
139139
airflow users create --role Admin --username admin --password admin --email admin@example.com --firstname foo --lastname bar
140140
141+
.. note::
142+
``airflow users`` command is only available when `FAB auth manager <https://airflow.apache.org/docs/apache-airflow-providers-fab/stable/auth-manager/index.html>`_ is enabled.
143+
141144
For databases, you need to run ``airflow db reset`` at least once (or run some tests) after you started
142145
Airflow Breeze to get the database/tables created. You can connect to databases with IDE or any other
143146
database client:
@@ -152,7 +155,7 @@ database client:
152155
You can change the used host port numbers by setting appropriate environment variables:
153156

154157
* ``SSH_PORT``
155-
* ``WEB_HOST_PORT`` - API server for Airflow 3, or webserver port for Airflow 2 when --use-airflow-version is used
158+
* ``WEB_HOST_PORT`` - API server when --use-airflow-version is used
156159
* ``POSTGRES_HOST_PORT``
157160
* ``MYSQL_HOST_PORT``
158161
* ``MSSQL_HOST_PORT``
@@ -221,6 +224,10 @@ short ``provider id`` (might be multiple of them).
221224
222225
breeze build-docs <provider id> <provider id>
223226
227+
To build documentation for Task SDK package, use the below command
228+
.. code-block:: bash
229+
breeze build-docs task-sdk
230+
224231
or you can use package filter. The filters are glob pattern matching full
225232
package names and can be used to select more than one package with single filter.
226233

@@ -352,7 +359,7 @@ For testing Airflow you often want to start multiple components (in multiple ter
352359
built-in ``start-airflow`` command that start breeze container, launches multiple terminals using tmux
353360
and launches all Airflow necessary components in those terminals.
354361

355-
When you are starting airflow from local sources, www asset compilation is automatically executed before.
362+
When you are starting Airflow from local sources, www asset compilation is automatically executed before.
356363

357364
.. code-block:: bash
358365
@@ -391,8 +398,8 @@ These are all available flags of ``start-airflow`` command:
391398
Launching multiple terminals in the same environment
392399
----------------------------------------------------
393400

394-
Often if you want to run full airflow in the Breeze environment you need to launch multiple terminals and
395-
run ``airflow webserver``, ``airflow scheduler``, ``airflow worker`` in separate terminals.
401+
Often if you want to run full Airflow in the Breeze environment you need to launch multiple terminals and
402+
run ``airflow api-server``, ``airflow scheduler``, ``airflow worker`` in separate terminals.
396403

397404
This can be achieved either via ``tmux`` or via exec-ing into the running container from the host. Tmux
398405
is installed inside the container and you can launch it with ``tmux`` command. Tmux provides you with the
@@ -417,8 +424,8 @@ These are all available flags of ``exec`` command:
417424
Compiling ui assets
418425
--------------------
419426

420-
Airflow webserver needs to prepare www assets - compiled with node and yarn. The ``compile-ui-assets``
421-
command takes care about it. This is needed when you want to run webserver inside of the breeze.
427+
Airflow API server needs to prepare www assets - compiled with node and yarn. The ``compile-ui-assets``
428+
command takes care about it. This is needed when you want to run API server inside of the breeze.
422429

423430
.. image:: ./images/output_compile-ui-assets.svg
424431
:target: https://raw.githubusercontent.com/apache/airflow/main/dev/breeze/images/output_compile-ui-assets.svg
@@ -439,7 +446,7 @@ Breeze uses docker images heavily and those images are rebuild periodically and
439446
images in docker cache. This might cause extra disk usage. Also running various docker compose commands
440447
(for example running tests with ``breeze testing core-tests``) might create additional docker networks that might
441448
prevent new networks from being created. Those networks are not removed automatically by docker-compose.
442-
Also Breeze uses it's own cache to keep information about all images.
449+
Also Breeze uses its own cache to keep information about all images.
443450

444451
All those unused images, networks and cache can be removed by running ``breeze cleanup`` command. By default
445452
it will not remove the most recent images that you might need to run breeze commands, but you
@@ -458,7 +465,7 @@ These are all available flags of ``cleanup`` command:
458465
Database and config volumes in Breeze
459466
-------------------------------------
460467

461-
Breeze keeps data for all it's integration, database, configuration in named docker volumes.
468+
Breeze keeps data for all its integration, database, configuration in named docker volumes.
462469
Those volumes are persisted until ``breeze down`` command. You can also preserve the volumes by adding
463470
flag ``--preserve-volumes`` when you run the command. Then, next time when you start Breeze,
464471
it will have the data pre-populated.
@@ -494,7 +501,7 @@ Running Breeze with a StatsD Metrics Stack
494501
..........................................
495502

496503
You can launch an instance of Breeze pre-configured to emit StatsD metrics using
497-
``breeze start-airflow --integration statsd``. This will launch an Airflow webserver
504+
``breeze start-airflow --integration statsd``. This will launch an Airflow API server
498505
within the Breeze environment as well as containers running StatsD, Prometheus, and
499506
Grafana. The integration configures the "Targets" in Prometheus, the "Datasources" in
500507
Grafana, and includes a default dashboard in Grafana.
@@ -547,9 +554,9 @@ Running Breeze with OpenLineage
547554
...............................
548555

549556
You can launch an instance of Breeze pre-configured to emit OpenLineage metrics using
550-
``breeze start-airflow --integration openlineage``. This will launch an Airflow webserver
557+
``breeze start-airflow --integration openlineage``. This will launch an Airflow API server
551558
within the Breeze environment as well as containers running a [Marquez](https://marquezproject.ai/)
552-
webserver and API server.
559+
API server.
553560

554561
When you run Airflow Breeze with this integration, in addition to the standard ports
555562
(See "Port Forwarding" below), the following are also automatically forwarded:

dev/breeze/doc/05_test_commands.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ To run the whole test class:
6868
You can re-run the tests interactively, add extra parameters to pytest and modify the files before
6969
re-running the test to iterate over the tests. You can also add more flags when starting the
7070
``breeze shell`` command when you run integration tests or system tests. Read more details about it
71-
in the `testing doc </contributing-docs/testing.rst>`_ where all the test types and information on how to run them are explained.
71+
in the `testing doc </contributing-docs/09_testing.rst>`_ where all the test types and information on how to run them are explained.
7272

7373
This applies to all kind of tests - all our tests can be run using pytest.
7474

@@ -159,7 +159,7 @@ Here is the detailed set of options for the ``breeze testing providers-test`` co
159159
Using ``breeze testing task-sdk-tests`` command
160160
...............................................
161161

162-
The ``breeze testing task-sdk-tests`` command is allows you to run tests for Task SDK without
162+
The ``breeze testing task-sdk-tests`` command allows you to run tests for Task SDK without
163163
initializing database. The Task SDK should not need database to be started so this acts as a
164164
good check to see if the Task SDK tests are working properly.
165165

@@ -241,7 +241,7 @@ Here is the detailed set of options for the ``breeze testing providers-integrati
241241
Running Python API client tests
242242
...............................
243243

244-
To run Python API client tests, you need to have airflow python client packaged in dist folder.
244+
To run Python API client tests, you need to have Airflow python client packaged in dist folder.
245245
To package the client, clone the airflow-python-client repository and run the following command:
246246

247247
.. code-block:: bash
@@ -327,7 +327,7 @@ automatically to run the tests.
327327
You can:
328328

329329
* Setup environment for k8s tests with ``breeze k8s setup-env``
330-
* Build airflow k8S images with ``breeze k8s build-k8s-image``
330+
* Build Airflow k8S images with ``breeze k8s build-k8s-image``
331331
* Manage KinD Kubernetes cluster and upload image and deploy Airflow to KinD cluster via
332332
``breeze k8s create-cluster``, ``breeze k8s configure-cluster``, ``breeze k8s deploy-airflow``, ``breeze k8s status``,
333333
``breeze k8s upload-k8s-image``, ``breeze k8s delete-cluster`` commands
@@ -398,7 +398,7 @@ Building Airflow K8s images
398398
...........................
399399

400400
Before deploying Airflow Helm Chart, you need to make sure the appropriate Airflow image is build (it has
401-
embedded test dags, pod templates and webserver is configured to refresh immediately. This can
401+
embedded test dags, pod templates and api-server is configured to refresh immediately. This can
402402
be done via ``breeze k8s build-k8s-image`` command. It can also be done in parallel for all images via
403403
``--run-in-parallel`` flag.
404404

@@ -412,7 +412,7 @@ All parameters of the command are here:
412412
Uploading Airflow K8s images
413413
............................
414414

415-
The K8S airflow images need to be uploaded to the KinD cluster. This can be done via
415+
The K8S Airflow images need to be uploaded to the KinD cluster. This can be done via
416416
``breeze k8s upload-k8s-image`` command. It can also be done in parallel for all images via
417417
``--run-in-parallel`` flag.
418418

@@ -442,7 +442,7 @@ Deploying Airflow to the Cluster
442442

443443
Airflow can be deployed to the Cluster with ``breeze k8s deploy-airflow``. This step will automatically
444444
(unless disabled by switches) will rebuild the image to be deployed. It also uses the latest version
445-
of the Airflow Helm Chart to deploy it. You can also choose to upgrade existing airflow deployment
445+
of the Airflow Helm Chart to deploy it. You can also choose to upgrade existing Airflow deployment
446446
and pass extra arguments to ``helm install`` or ``helm upgrade`` commands that are used to
447447
deploy airflow. By passing ``--run-in-parallel`` the deployment can be run
448448
for all clusters in parallel.
@@ -457,7 +457,7 @@ All parameters of the command are here:
457457
Checking status of the K8S cluster
458458
..................................
459459

460-
You can delete kubernetes cluster and airflow deployed in the current cluster
460+
You can delete kubernetes cluster and Airflow deployed in the current cluster
461461
via ``breeze k8s status`` command. It can be also checked for all clusters created so far by passing
462462
``--all`` flag.
463463

@@ -517,7 +517,7 @@ Running k8s complete tests
517517
..........................
518518

519519
You can run ``breeze k8s run-complete-tests`` command to combine all previous steps in one command. That
520-
command will create cluster, deploy airflow and run tests and finally delete cluster. It is used in CI
520+
command will create cluster, deploy Airflow and run tests and finally delete cluster. It is used in CI
521521
to run the whole chains in parallel.
522522

523523
Run all tests:
@@ -575,7 +575,7 @@ as executor you use, similar to:
575575
576576
The shell automatically activates the virtual environment that has all appropriate dependencies
577577
installed and you can interactively run all k8s tests with pytest command (of course the cluster need to
578-
be created and airflow deployed to it before running the tests):
578+
be created and Airflow deployed to it before running the tests):
579579

580580
.. code-block:: bash
581581

dev/breeze/doc/06_managing_docker_images.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ but here typical examples are presented:
196196
197197
breeze prod-image build --additional-airflow-extras "jira"
198198
199-
This installs additional ``jira`` extra while installing airflow in the image.
199+
This installs additional ``jira`` extra while installing Airflow in the image.
200200

201201

202202
.. code-block:: bash

dev/breeze/doc/10_advanced_breeze_topics.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ which will be mapped to ``/files`` in your Docker container. You can pass there
117117
configure and run Docker. They will not be removed between Docker runs.
118118

119119
By default ``/files/dags`` folder is mounted from your local ``<AIRFLOW_ROOT_PATH>/files/dags`` and this is
120-
the directory used by airflow scheduler and webserver to scan dags for. You can use it to test your dags
120+
the directory used by Airflow scheduler and api-server to scan dags for. You can use it to test your dags
121121
from local sources in Airflow. If you wish to add local DAGs that can be run by Breeze.
122122

123123
The ``/files/airflow-breeze-config`` folder contains configuration files that might be used to
@@ -132,7 +132,7 @@ There are couple of things you might want to do when adding/changing dependencie
132132
Breeze. You can add dependencies temporarily (which will last until you exit Breeze shell), or you might
133133
want to add them permanently (which require you to rebuild the image). Also there are different things
134134
you need to do when you are adding system level (debian) level, Python (pip) dependencies or Node (yarn)
135-
dependencies for the webserver.
135+
dependencies for the api-server.
136136

137137
Python dependencies
138138
...................

dev/breeze/doc/ci/02_images.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ can be used for CI images:
443443
| `ADDITIONAL_DEV_APT_DEPS` | | Additional apt dev dependencies installed in the first part of the image |
444444
| `ADDITIONAL_DEV_APT_ENV` | | Additional env variables defined when installing dev deps |
445445
| `AIRFLOW_PIP_VERSION` | `25.1.1` | `pip` version used. |
446-
| `AIRFLOW_UV_VERSION` | `0.7.8` | `uv` version used. |
446+
| `AIRFLOW_UV_VERSION` | `0.7.14` | `uv` version used. |
447447
| `AIRFLOW_PRE_COMMIT_VERSION` | `4.2.0` | `pre-commit` version used. |
448448
| `AIRFLOW_PRE_COMMIT_UV_VERSION` | `4.1.4` | `pre-commit-uv` version used. |
449449
| `AIRFLOW_USE_UV` | `true` | Whether to use UV for installation. |

0 commit comments

Comments
 (0)