Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run separate CI job for latest boto/botocore version when needed #30144

Merged
merged 1 commit into from
Mar 16, 2023

Conversation

potiuk
Copy link
Member

@potiuk potiuk commented Mar 16, 2023

By using aiobotocore, we are pinning botocore and boto to a specific
version (in aiobotocore extra of amazon provider). This means that
the boto/botocore dependencies will be updated less frequent in main
(every 3-4 months instead of every few days). This has the danger,
that we will detect errors resulting from the upgrade much later,
so we should run our amazon tests and depending tests with
the latest boto/botocore (having aibotocore uninstalled).

All deferrable tests should skip when aiobotocore is missing so only
non-deferrable tests should run in this job.

Depends on #30127 (so only last commit should be checked).


^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

@potiuk potiuk requested review from ferruzzi and ephraimbuddy March 16, 2023 14:39
@potiuk potiuk changed the title Add amazon tests for latest boto version Run separate job for latest boto/botocore version when needed Mar 16, 2023
@@ -656,9 +657,10 @@ def update_expected_environment_variables(env: dict[str, str]) -> None:
"PYTHON_MAJOR_MINOR_VERSION": "python",
"SKIP_CONSTRAINTS": "skip_constraints",
"SKIP_ENVIRONMENT_INITIALIZATION": "skip_environment_initialization",
"SKIP_PROVIDER_TESS": "skip_provider_tests",
"SKIP_PROVIDER_TESTS": "skip_provider_tests",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unrelated - but I found it along the way. Separate PR follows.

@potiuk potiuk changed the title Run separate job for latest boto/botocore version when needed Run separate test job for latest boto/botocore version when needed Mar 16, 2023
@potiuk potiuk changed the title Run separate test job for latest boto/botocore version when needed Run separate CI test job for latest boto/botocore version when needed Mar 16, 2023
@potiuk potiuk changed the title Run separate CI test job for latest boto/botocore version when needed Run separate CI job for latest boto/botocore version when needed Mar 16, 2023
Copy link
Contributor

@o-nikolas o-nikolas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Not only will this help us catch issues early, but we'll also be able to solve them incrementally. Rather than receiving one large batch of issues after each version bump.

@potiuk
Copy link
Member Author

potiuk commented Mar 16, 2023

Nice! Not only will this help us catch issues early, but we'll also be able to solve them incrementally. Rather than receiving one large batch of issues after each version bump.

Precisely

@potiuk
Copy link
Member Author

potiuk commented Mar 16, 2023

This seemed to work from the first run (The failing tests were environmental issues) This is :suspect: ...

But yeah it seems to work indeed:

  Found existing installation: aiobotocore 2.5.0
  Uninstalling aiobotocore-2.5.0:
    Successfully uninstalled aiobotocore-2.5.0
  WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
  Requirement already satisfied: boto3 in /usr/local/lib/python3.7/site-packages (1.26.76)
  Collecting boto3
    Downloading boto3-1.26.92-py3-none-any.whl (134 kB)
       ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 134.7/134.7 kB 37.4 MB/s eta 0:00:00
  Requirement already satisfied: botocore in /usr/local/lib/python3.7/site-packages (1.29.76)
  Collecting botocore
    Downloading botocore-1.29.92-py3-none-any.whl (10.5 MB)
       ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 10.5/10.5 MB 148.1 MB/s eta 0:00:00
  Requirement already satisfied: jmespath<2.0.0,>=0.7.1 in /usr/local/lib/python3.7/site-packages (from boto3) (0.10.0)
  Requirement already satisfied: s3transfer<0.7.0,>=0.6.0 in /usr/local/lib/python3.7/site-packages (from boto3) (0.6.0)
  Requirement already satisfied: python-dateutil<3.0.0,>=2.1 in /usr/local/lib/python3.7/site-packages (from botocore) (2.8.2)
  Requirement already satisfied: urllib3<1.27,>=1.25.4 in /usr/local/lib/python3.7/site-packages (from botocore) (1.26.15)
  Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.7/site-packages (from python-dateutil<3.0.0,>=2.1->botocore) (1.16.0)
  Installing collected packages: botocore, boto3
    Attempting uninstall: botocore
      Found existing installation: botocore 1.29.76
      Uninstalling botocore-1.29.76:
        Successfully uninstalled botocore-1.29.76
    Attempting uninstall: boto3
      Found existing installation: boto3 1.26.76
      Uninstalling boto3-1.26.76:
        Successfully uninstalled boto3-1.26.76
  Successfully installed boto3-1.26.92 botocore-1.29.92
  WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

and:

  All Warning errors can be found in the /files/warnings-Providers-postgres.txt file.
  =========== 1694 passed, 3 skipped, 16 warnings in 367.28s (0:06:07) ===========

The 3 skipped were the deferrable tests.

@potiuk potiuk force-pushed the add-amazon-tests-for-latest-boto-version branch from ebf5428 to 50c026d Compare March 16, 2023 18:57
@potiuk potiuk requested a review from dstandish as a code owner March 16, 2023 19:20
@potiuk potiuk force-pushed the add-amazon-tests-for-latest-boto-version branch from 8f4df3d to 50c026d Compare March 16, 2023 19:21
Copy link
Contributor

@eladkal eladkal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is very nice improvement!

By using aiobotocore, we are pinning botocore and boto to a specific
version (in aiobotocore extra of amazon provider). This means that
the boto/botocore dependencies will be updated less frequent in main
(every 3-4 months instead of every few days). This has the danger,
that we will detect errors resulting from the upgrade much later,
so we should run our amazon tests and depending tests with
the latest boto/botocore (having aibotocore uninstalled).

All deferrable tests should skip when aiobotocore is missing so only
non-deferrable tests should run in this job.
@potiuk potiuk force-pushed the add-amazon-tests-for-latest-boto-version branch from 50c026d to 5ca4c10 Compare March 16, 2023 20:31
@ferruzzi
Copy link
Contributor

Clever solution. 👍

@potiuk potiuk merged commit 851fde0 into apache:main Mar 16, 2023
@potiuk potiuk deleted the add-amazon-tests-for-latest-boto-version branch March 16, 2023 21:50
potiuk added a commit to potiuk/airflow that referenced this pull request Mar 17, 2023
This is follow-up after apache#30127 and apache#30144 about handling async
(deferrable) operators for amazon provider.

Rather than making aiobotocre directly a devel extra dependency,
we create a separate "aiobotocore" extra that allows for greater
flexibility on how we handle the aiobotocore support. It allows
for two approach:

1) (current) if we decide that by default we keep boto/botocore
   compatible with aiobotocore in our constraints/image then
   aiobotocore should be added to devel and it should be included
   as preselected extra in Dockerfile. This will lead to
   having aibotocore and compatible boto/botocore in both constraints
   and the PROD image.

2) (possible) if we decide that we prefer to keep to the latest
   version of boto/botocore in constraints/image, then we could
   remove aiobotocore from both constraints and PROD image. We should
   also in this case swap the "LatestBoto" CI job introduced in
   apache#30144 to be "WithAiobotocore" job - by installing aiobotocore
   and downgrading boto/botocore in the job.
potiuk added a commit that referenced this pull request Mar 17, 2023
This is follow-up after #30127 and #30144 about handling async
(deferrable) operators for amazon provider.

Rather than making aiobotocre directly a devel extra dependency,
we create a separate "aiobotocore" extra that allows for greater
flexibility on how we handle the aiobotocore support. It allows
for two approach:

1) (current) if we decide that by default we keep boto/botocore
   compatible with aiobotocore in our constraints/image then
   aiobotocore should be added to devel and it should be included
   as preselected extra in Dockerfile. This will lead to
   having aibotocore and compatible boto/botocore in both constraints
   and the PROD image.

2) (possible) if we decide that we prefer to keep to the latest
   version of boto/botocore in constraints/image, then we could
   remove aiobotocore from both constraints and PROD image. We should
   also in this case swap the "LatestBoto" CI job introduced in
   #30144 to be "WithAiobotocore" job - by installing aiobotocore
   and downgrading boto/botocore in the job.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants