Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

Update CI workflows to use more Python and OpenSearch versions #92

Merged
merged 7 commits into from
Feb 15, 2023
Merged

Update CI workflows to use more Python and OpenSearch versions #92

merged 7 commits into from
Feb 15, 2023

Conversation

Yury-Fridlyand
Copy link
Collaborator

@Yury-Fridlyand Yury-Fridlyand commented Jan 19, 2023

Description

image

ubuntu-latest was recently updated from 20.04 to 22.04 (announcement). setup-python action doesn't support 3.5 and 3.6 on 22.04 (link).

Issues Resolved

Remove unsupported by GHA Python versions. Add newer versions instead.

Check List

  • New functionality includes testing.
    • All tests pass.
  • New functionality has been documented.
    • New functionality has comments added.
  • Commits are signed per the DCO using --signoff.
  • CHANGELOG has been updated.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following the Developer Certificate of Origin and signing off your commits, please check here.

@Yury-Fridlyand Yury-Fridlyand requested a review from a team as a code owner January 19, 2023 19:38
@VachaShah
Copy link
Collaborator

@Yury-Fridlyand This is fixed in #84 by updating the ubuntu version.

Signed-off-by: Yury-Fridlyand <[email protected]>
@Yury-Fridlyand
Copy link
Collaborator Author

@VachaShah, that was downgrade actually...

@VachaShah
Copy link
Collaborator

@VachaShah, that was downgrade actually...

Yup sorry 🤦🏼‍♀️ by restricting the ubuntu version

@Yury-Fridlyand
Copy link
Collaborator Author

@VachaShah, I can update CI to do extra run on python 3.5 and 3.6 on ubuntu 20.04 if you think it is important.

@Yury-Fridlyand Yury-Fridlyand mentioned this pull request Jan 20, 2023
6 tasks
@VachaShah
Copy link
Collaborator

@VachaShah, I can update CI to do extra run on python 3.5 and 3.6 on ubuntu 20.04 if you think it is important.

Sorry @Yury-Fridlyand, I missed this. I think it would be good to have python 3.5 and 3.6 in the CI as well since we support those client versions. It will help us know if something fails for those python versions.

@Yury-Fridlyand
Copy link
Collaborator Author

I'm trying to extend CI for all opensearch and python versions. It seems pretty simple, but I have two troubles I'd like you to help me, @VachaShah:

  1. Integration on unreleased version workflow every time does full build of OpenSearch, it takes significant time. It builds every OpenSearch version few times - per python version. I need to use GHA cache, but I don't understand how docker image is generated to cache it. Could you please help me with that?
  2. I added more python versions and opensearch versions into integration workflow and it produced hundreds of combinations. GHA fails if there are 256+ combinations in a matrix. Do you mind if I limit list of OpenSearch versions to latest version in each major/minor release? The matrix below produces 120 combinations, it is also too much I suppose (+40 combinations from python 3.5 and 3.6).
     matrix:
       version: [ '1.0.1', '1.1.0', '1.2.4', '1.3.7', '2.0.1', '2.1.0', '2.2.1', '2.3.0', '2.4.0', '2.5.0' ]
       secured: ["true", "false"]
       python-version: ['2.7', '3.7', '3.8', '3.9', '3.10', '3.11']

@VachaShah
Copy link
Collaborator

I'm trying to extend CI for all opensearch and python versions. It seems pretty simple, but I have two troubles I'd like you to help me, @VachaShah:

  1. Integration on unreleased version workflow every time does full build of OpenSearch, it takes significant time. It builds every OpenSearch version few times - per python version. I need to use GHA cache, but I don't understand how docker image is generated to cache it. Could you please help me with that?
  2. I added more python versions and opensearch versions into integration workflow and it produced hundreds of combinations. GHA fails if there are 256+ combinations in a matrix. Do you mind if I limit list of OpenSearch versions to latest version in each major/minor release? The matrix below produces 120 combinations, it is also too much I suppose (+40 combinations from python 3.5 and 3.6).
     matrix:
       version: [ '1.0.1', '1.1.0', '1.2.4', '1.3.7', '2.0.1', '2.1.0', '2.2.1', '2.3.0', '2.4.0', '2.5.0' ]
       secured: ["true", "false"]
       python-version: ['2.7', '3.7', '3.8', '3.9', '3.10', '3.11']

@Yury-Fridlyand Ofcourse happy to help!

  1. For integration-unreleased, the docker image gets generated when ./gradlew assemble is run on OpenSearch source code. We also have a discussion ongoing for reducing the time taken by Github Actions specially for unreleased integration as the number of branches increase on OpenSearch and increasing released OpenSearch versions as well. ([PROPOSAL] Reduce GitHub Action jobs against any OpenSearch version opensearch-clients#39)
  2. We can definitely limit the OpenSearch versions in the matrix to the latest in a major/minor version line. I see that ci.yml runs with multiple python versions while integration.yml runs against multiple OpenSearch versions with a single python version. Are you planning to add multiple python versions in integration.yml?

@Yury-Fridlyand
Copy link
Collaborator Author

I think I got your idea. Thank you for the advice.
I reworked workflows and now they provide much more coverage. Furthermore, I optimized integration-unreleased.yml workflow to run significantly faster, so it can be executed on every push/PR. It uses faster build procedure, caches and re-uses build artifacts.
There are 200+ checks which were executed in 7 min without using cache. Cache was created right now and it is kept for 7 days; it will speed up CI up to 3 min.

Note: Deprecation message about Python 2.7 can't be suppressed - there is a bug in third-party tool.

If this approach and changes approved, I will apply them to other OpenSearch Python repos.

@Yury-Fridlyand Yury-Fridlyand changed the title Update CI workflow python versions Update CI workflows to use more Python and OpenSearch versions Feb 1, 2023
Copy link
Collaborator

@VachaShah VachaShah left a comment

Choose a reason for hiding this comment

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

This is awesome @Yury-Fridlyand!

- { opensearch_ref: '2.0' }
- { opensearch_ref: 'main' }
opensearch_ref: [ '1.x', '2.x', '2.0', 'main' ]
python-version: [ '2.7', '3.7', '3.8', '3.9', '3.10', '3.11' ]
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we don't need to specify multiple python versions here. The same code is tested against multiple versions of python in ci.yml. The main purpose here is to test its connectivity to server. WDYT?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I agree. Will update CI shortly.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in bf484a9.

sleep 90
nox --no-error-on-missing-interpreter -rs lint test

- name: Save server logs
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need to save the server logs? Wouldn't the failures appear on the workflow run?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Logs could be helpful to analyze the failures in case if you can't or don't want to reproduce it on your machine.
They are stored in GHA for one or two weeks.

fail-fast: false
matrix:
opensearch_ref: [ '1.x', '2.x', '2.0', 'main' ]
python-version: [ '3.5', '3.6' ]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Similar comment for multiple python versions.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in bf484a9.

secured: ["true", "false"]
version: [ '1.0.1', '1.1.0', '1.2.4', '1.3.7', '2.0.1', '2.1.0', '2.2.1', '2.3.0', '2.4.0', '2.5.0' ]
secured: [ "true", "false" ]
python-version: [ '2.7', '3.7', '3.8', '3.9', '3.10', '3.11' ]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Similar comment for multiple python versions.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in bf484a9.

@VachaShah
Copy link
Collaborator

This is amazing @Yury-Fridlyand!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants