Skip to content

Commit f30b96e

Browse files
committed
[v2-10-test] Backport pull_requttest_target removal
This is a bulk change that synchronizes dev/ci scripts for v2-10-test branch with main #45266 - including follow-ups. Rather than cherry-picking relevant PRs, this one gets the latest version of the scripts from main and updates the branch with some changes to adapt them to v2-10-test (such as bringing back python 3.8 support, removing some providers checks after the bulk move of providers and making sure all tests are passing. This is far easier than cherry-picking the changes, because for the v2-10-test we stopped cherry-picking CI changes which was deemed unnecessary (we used to do it for all previous branches) but this made it far more difficult (if not impossible) to cherry-pick individual changes. Fortunately, the CI scripts are maintained in the way that their latest version **should** in principle work for a v2-* branch and hopefully after just a few adjustments we should be able to synchronize the changes from main by updating all relevant CI/DEV scripts, dockerfile images, workflows, pre-commits etc. Add actions in codeql workflows to scan github workflow actions (#45534) * add actions in codeql workflows to scan github workflow actions * add actions in codeql workflows to scan github workflow actions CodeQL scanning can run always on all code (#45541) The CodeQL scannig is fast and having custom configuration to select which scanning to run should be run makes it unnecessarily complex We can just run all CodeQL scans always. This has been suggested by actions codeql scan itself. Add explicit permissions for all workflow-run workflows (#45548) Those workflows inherit permissions from the calling workflows but it's good to add explicit permissions to indicate what is needed and in case we will also use the workflows for other purposes in the future - default permissions for older repos might be write so it's best to be explicit about the permissions. Found by CodeQL scanning Remove contents: write permission from generate-constraints (#45558) The write permission cannot be set for PRs from forks in the call workflow - so we have to come back to implicit permissions and make explicit permissions passing a bit differently. (cherry picked from commit ae32ebc) Bump trove-classifiers from 2025.1.7.14 to 2025.1.10.15 (#45561) Bumps [trove-classifiers](https://github.com/pypa/trove-classifiers) from 2025.1.7.14 to 2025.1.10.15. - [Release notes](https://github.com/pypa/trove-classifiers/releases) - [Commits](pypa/trove-classifiers@2025.1.7.14...2025.1.10.15) --- updated-dependencies: - dependency-name: trove-classifiers dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> (cherry picked from commit f3fd262) Add optional --image-file-dir to store loaded files elsewhere (#45564) While backorting the "pull_request_target" removal to v2-10-test branches it turned out that there is not enough disk space on Public runner to load all 5 images and keep the file dump at the same time in the same filesystem. This PR allows to choose where the load/save files will be stored and in the github runner environment we store the files in "/mnt" wnich is a separate folder with 40GB free. (cherry picked from commit 6628049) Fix --from-pr feature for image load and stabilize help This is a follow-up after #45564 - it fixes the `--from-pr` and `--from-run` to work (it was failing with file does not exist). Also found out that gettempdir might return different directory depending on which is your designated tmp directory (for example in MacOS this is is a longer path in /var/.....) - so we have to force the default during help generation to always return "/tmp" so that the --help images do not change depending on which system you are and what your tmp directory is.
1 parent 586f1ea commit f30b96e

File tree

363 files changed

+14703
-11062
lines changed

Some content is hidden

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

363 files changed

+14703
-11062
lines changed

.dockerignore

+7
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,15 @@
3434
!chart
3535
!docs
3636
!licenses
37+
!providers/
38+
!task_sdk/
3739

3840
# Add those folders to the context so that they are available in the CI container
3941
!scripts
4042

4143
# Add tests and kubernetes_tests to context.
4244
!tests
45+
!tests_common
4346
!kubernetes_tests
4447
!helm_tests
4548
!docker_tests
@@ -79,6 +82,7 @@
7982
airflow/git_version
8083
# Exclude mode_modules pulled by "yarn" for compilation of www files generated by NPM
8184
airflow/www/node_modules
85+
airflow/ui/node_modules
8286

8387
# Exclude link to docs
8488
airflow/www/static/docs
@@ -121,6 +125,9 @@ docs/_build/
121125
docs/_api/
122126
docs/_doctrees/
123127

128+
# Exclude new providers docs generated files
129+
providers/**/docs/_api/
130+
124131
# files generated by memray
125132
*.py.*.html
126133
*.py.*.bin

.github/actions/breeze/action.yml

+5-7
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ description: 'Sets up Python and Breeze'
2121
inputs:
2222
python-version:
2323
description: 'Python version to use'
24-
# Version of Python used for reproducibility of the packages built
25-
# Python 3.8 tarfile produces different tarballs than Python 3.9+ tarfile that's why we are forcing
26-
# Python 3.9 for all release preparation commands to make sure that the tarballs are reproducible
2724
default: "3.9"
25+
use-uv:
26+
description: 'Whether to use uv tool'
27+
required: true
2828
outputs:
2929
host-python-version:
3030
description: Python version used in host
@@ -36,13 +36,11 @@ runs:
3636
uses: actions/setup-python@v5
3737
with:
3838
python-version: ${{ inputs.python-version }}
39-
cache: 'pip'
40-
cache-dependency-path: ./dev/breeze/pyproject.toml
39+
# NOTE! Installing Breeze without using cache is FASTER than when using cache - uv is so fast and has
40+
# so low overhead, that just running upload cache/restore cache is slower than installing it from scratch
4141
- name: "Install Breeze"
4242
shell: bash
4343
run: ./scripts/ci/install_breeze.sh
44-
env:
45-
PYTHON_VERSION: ${{ inputs.python-version }}
4644
- name: "Free space"
4745
shell: bash
4846
run: breeze ci free-space

.github/actions/checkout_target_commit/action.yml

-81
This file was deleted.

.github/actions/install-pre-commit/action.yml

+41-18
Original file line numberDiff line numberDiff line change
@@ -21,30 +21,53 @@ description: 'Installs pre-commit and related packages'
2121
inputs:
2222
python-version:
2323
description: 'Python version to use'
24-
default: 3.9
24+
default: "3.9"
2525
uv-version:
2626
description: 'uv version to use'
27-
default: 0.5.11
27+
default: "0.5.17" # Keep this comment to allow automatic replacement of uv version
2828
pre-commit-version:
2929
description: 'pre-commit version to use'
30-
default: 4.0.1
31-
pre-commit-uv-version:
32-
description: 'pre-commit-uv version to use'
33-
default: 4.1.4
30+
default: "3.5.0" # Keep this comment to allow automatic replacement of pre-commit version
3431
runs:
3532
using: "composite"
3633
steps:
37-
- name: Install pre-commit, uv, and pre-commit-uv
34+
- name: Install pre-commit, uv
3835
shell: bash
39-
run: >
40-
pip install
41-
pre-commit==${{inputs.pre-commit-version}}
42-
uv==${{inputs.uv-version}}
43-
pre-commit-uv==${{inputs.pre-commit-uv-version}}
44-
- name: Cache pre-commit envs
45-
uses: actions/cache@v4
36+
env:
37+
UV_VERSION: ${{inputs.uv-version}}
38+
PRE_COMMIT_VERSION: ${{inputs.pre-commit-version}}
39+
run: |
40+
pip install uv==${UV_VERSION} || true
41+
uv tool install pre-commit==${PRE_COMMIT_VERSION} --with uv==${UV_VERSION}
42+
working-directory: ${{ github.workspace }}
43+
# We need to use tar file with archive to restore all the permissions and symlinks
44+
- name: "Delete ~.cache"
45+
run: |
46+
du ~/ --max-depth=2
47+
echo
48+
echo Deleting ~/.cache
49+
echo
50+
rm -rf ~/.cache
51+
echo
52+
shell: bash
53+
- name: "Restore pre-commit cache"
54+
uses: apache/infrastructure-actions/stash/restore@c94b890bbedc2fc61466d28e6bd9966bc6c6643c
4655
with:
47-
path: ~/.cache/pre-commit
48-
key: "pre-commit-${{inputs.python-version}}-${{ hashFiles('.pre-commit-config.yaml') }}"
49-
restore-keys: |
50-
pre-commit-${{inputs.python-version}}-
56+
key: cache-pre-commit-v4-${{ inputs.python-version }}-${{ hashFiles('.pre-commit-config.yaml') }}
57+
path: /tmp/
58+
id: restore-pre-commit-cache
59+
- name: "Restore .cache from the tar file"
60+
run: tar -C ~ -xzf /tmp/cache-pre-commit.tar.gz
61+
shell: bash
62+
if: steps.restore-pre-commit-cache.outputs.stash-hit == 'true'
63+
- name: "Show restored files"
64+
run: |
65+
echo "Restored files"
66+
du ~/ --max-depth=2
67+
echo
68+
shell: bash
69+
if: steps.restore-pre-commit-cache.outputs.stash-hit == 'true'
70+
- name: Install pre-commit hooks
71+
shell: bash
72+
run: pre-commit install-hooks || (cat ~/.cache/pre-commit/pre-commit.log && exit 1)
73+
working-directory: ${{ github.workspace }}

.github/actions/post_tests_success/action.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ runs:
3333
- name: "Upload artifact for warnings"
3434
uses: actions/upload-artifact@v4
3535
with:
36-
name: test-warnings-${{env.JOB_ID}}
36+
name: test-warnings-${{ env.JOB_ID }}
3737
path: ./files/warnings-*.txt
3838
retention-days: 7
3939
if-no-files-found: ignore
@@ -50,5 +50,5 @@ runs:
5050
if: env.ENABLE_COVERAGE == 'true' && env.TEST_TYPES != 'Helm' && inputs.python-version != '3.12'
5151
with:
5252
name: coverage-${{env.JOB_ID}}
53-
flags: python-${{env.PYTHON_MAJOR_MINOR_VERSION}},${{env.BACKEND}}-${{env.BACKEND_VERSION}}
53+
flags: python-${{ env.PYTHON_MAJOR_MINOR_VERSION }},${{ env.BACKEND }}-${{ env.BACKEND_VERSION }}
5454
directory: "./files/coverage-reports/"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
#
18+
---
19+
name: 'Prepare all CI images'
20+
description: 'Recreates current python CI images from artifacts for all python versions'
21+
inputs:
22+
python-versions-list-as-string:
23+
description: 'Stringified array of all Python versions to test - separated by spaces.'
24+
required: true
25+
platform:
26+
description: 'Platform for the build - linux/amd64 or linux/arm64'
27+
required: true
28+
runs:
29+
using: "composite"
30+
steps:
31+
- name: "Cleanup docker"
32+
run: ./scripts/ci/cleanup_docker.sh
33+
shell: bash
34+
# TODO: Currently we cannot loop through the list of python versions and have dynamic list of
35+
# tasks. Instead we hardcode all possible python versions and they - but
36+
# this should be implemented in stash action as list of keys to download.
37+
# That includes 3.8 - 3.12 as we are backporting it to v2-10-test branch
38+
# This is captured in https://github.com/apache/airflow/issues/45268
39+
- name: "Restore CI docker image ${{ inputs.platform }}:3.8"
40+
uses: ./.github/actions/prepare_single_ci_image
41+
with:
42+
platform: ${{ inputs.platform }}
43+
python: "3.8"
44+
python-versions-list-as-string: ${{ inputs.python-versions-list-as-string }}
45+
- name: "Restore CI docker image ${{ inputs.platform }}:3.9"
46+
uses: ./.github/actions/prepare_single_ci_image
47+
with:
48+
platform: ${{ inputs.platform }}
49+
python: "3.9"
50+
python-versions-list-as-string: ${{ inputs.python-versions-list-as-string }}
51+
- name: "Restore CI docker image ${{ inputs.platform }}:3.10"
52+
uses: ./.github/actions/prepare_single_ci_image
53+
with:
54+
platform: ${{ inputs.platform }}
55+
python: "3.10"
56+
python-versions-list-as-string: ${{ inputs.python-versions-list-as-string }}
57+
- name: "Restore CI docker image ${{ inputs.platform }}:3.11"
58+
uses: ./.github/actions/prepare_single_ci_image
59+
with:
60+
platform: ${{ inputs.platform }}
61+
python: "3.11"
62+
python-versions-list-as-string: ${{ inputs.python-versions-list-as-string }}
63+
- name: "Restore CI docker image ${{ inputs.platform }}:3.12"
64+
uses: ./.github/actions/prepare_single_ci_image
65+
with:
66+
platform: ${{ inputs.platform }}
67+
python: "3.12"
68+
python-versions-list-as-string: ${{ inputs.python-versions-list-as-string }}

.github/actions/prepare_breeze_and_image/action.yml

+35-13
Original file line numberDiff line numberDiff line change
@@ -16,30 +16,52 @@
1616
# under the License.
1717
#
1818
---
19-
name: 'Prepare breeze && current python image'
20-
description: 'Installs breeze and pulls current python image'
19+
name: 'Prepare breeze && current image (CI or PROD)'
20+
description: 'Installs breeze and recreates current python image from artifact'
2121
inputs:
22-
pull-image-type:
23-
description: 'Which image to pull'
24-
default: CI
22+
python:
23+
description: 'Python version for image to prepare'
24+
required: true
25+
image-type:
26+
description: 'Which image type to prepare (ci/prod)'
27+
default: "ci"
28+
platform:
29+
description: 'Platform for the build - linux/amd64 or linux/arm64'
30+
required: true
31+
use-uv:
32+
description: 'Whether to use uv'
33+
required: true
2534
outputs:
2635
host-python-version:
2736
description: Python version used in host
2837
value: ${{ steps.breeze.outputs.host-python-version }}
2938
runs:
3039
using: "composite"
3140
steps:
41+
- name: "Cleanup docker"
42+
run: ./scripts/ci/cleanup_docker.sh
43+
shell: bash
3244
- name: "Install Breeze"
3345
uses: ./.github/actions/breeze
46+
with:
47+
use-uv: ${{ inputs.use-uv }}
3448
id: breeze
35-
- name: Login to ghcr.io
49+
- name: Check free space
50+
run: df -H
3651
shell: bash
37-
run: echo "${{ env.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
38-
- name: Pull CI image ${{ env.PYTHON_MAJOR_MINOR_VERSION }}:${{ env.IMAGE_TAG }}
52+
- name: Make /mnt/ directory writeable
53+
run: sudo chown -R ${USER} /mnt
3954
shell: bash
40-
run: breeze ci-image pull --tag-as-latest
41-
if: inputs.pull-image-type == 'CI'
42-
- name: Pull PROD image ${{ env.PYTHON_MAJOR_MINOR_VERSION }}:${{ env.IMAGE_TAG }}
55+
- name: "Restore ${{ inputs.image-type }} docker image ${{ inputs.platform }}:${{ inputs.python }}"
56+
uses: apache/infrastructure-actions/stash/restore@c94b890bbedc2fc61466d28e6bd9966bc6c6643c
57+
with:
58+
key: ${{ inputs.image-type }}-image-save-${{ inputs.platform }}-${{ inputs.python }}
59+
path: "/mnt/"
60+
- name: "Load ${{ inputs.image-type }} image ${{ inputs.platform }}:${{ inputs.python }}"
61+
env:
62+
PLATFORM: ${{ inputs.platform }}
63+
PYTHON: ${{ inputs.python }}
64+
IMAGE_TYPE: ${{ inputs.image-type }}
65+
run: >
66+
breeze ${IMAGE_TYPE}-image load --platform "${PLATFORM}" --python "${PYTHON}" --image-file-dir "/mnt"
4367
shell: bash
44-
run: breeze prod-image pull --tag-as-latest
45-
if: inputs.pull-image-type == 'PROD'

0 commit comments

Comments
 (0)