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

[stable] Make version pinning optional #89

Conversation

sombrafam
Copy link

The OVN charms prepared for the upgrade from OVN 20.03 to newer versions by unconditionally enabling version pinning.

Since then we have reached agreement with upstream that rolling upgrades should work when upgrading within the previous upstream LTS version and the next.

Having the pinning enabled may cause unnecessary grief for anyone already upgraded to OVN 22.03.

Add a charm configuration option to allow controlling the version pinning.

Closes-Bug: #2030944
Signed-off-by: Frode Nordahl [email protected]
(cherry picked from commit f68ecbd) (cherry picked from commit 2a61104) (cherry picked from commit bde8c8c)

@sombrafam sombrafam force-pushed the backports-version-pinning-option-to-20.03 branch from 155dbdd to f50f539 Compare May 5, 2024 14:08
@fnordahl
Copy link
Contributor

fnordahl commented May 5, 2024

@sombrafam your approach looks interesting however I wonder if it could also be solved by cherry-picking commit e3d4e0c and commit 1e312c8?

@sombrafam
Copy link
Author

So, I considered that 20.04 is supported across focal and jammy, and therefore would make sense to test the Python versions present there. Does that make sense?

@dosaboy
Copy link
Contributor

dosaboy commented May 11, 2024

the stable/20.03 branch is currently failing pep8 tests with:

$ tox -epep8
pep8: commands[0]> flake8 actions lib unit_tests
lib/charms/ovn_charm.py:296:5: F811 redefinition of unused 'enable_openstack' from line 271
unit_tests/test_lib_charms_ovn_charm.py:354:12: E275 missing whitespace after keyword
unit_tests/test_lib_charms_ovn_charm.py:355:12: E275 missing whitespace after keyword
pep8: exit 1 (0.17 seconds) /home/ubuntu/layer-ovn> flake8 actions lib unit_tests pid=4428
pep8: FAIL code 1 (0.20=setup[0.03]+cmd[0.17] seconds)
evaluation failed :( (0.32 seconds)

So even if we fix the ability to run tests they won't pass. These were fixed by other patches that have not been backported:

61869ad
2b303a4

To get things moving I will propose a backport of these patches and combine with the fix to tox to get it passing.

@dosaboy
Copy link
Contributor

dosaboy commented May 11, 2024

#91 proposed. Once that is landed you can rebase your patch without the extras and should work this time.

@sombrafam
Copy link
Author

#91 proposed. Once that is landed you can rebase your patch without the extras and should work this time.

That doesn't address the issue of not having coverage in Focal. We should have that since 20.03 runs in Focal and Jammy.

@dosaboy
Copy link
Contributor

dosaboy commented May 14, 2024

#91 proposed. Once that is landed you can rebase your patch without the extras and should work this time.

That doesn't address the issue of not having coverage in Focal. We should have that since 20.03 runs in Focal and Jammy.

How would you run 20.03 on Jammy? To get to Jammy you would also have to upgrade to 22.03 since that is the version of ovn in Jammy.

@dosaboy
Copy link
Contributor

dosaboy commented May 14, 2024

#91 proposed. Once that is landed you can rebase your patch without the extras and should work this time.

That doesn't address the issue of not having coverage in Focal. We should have that since 20.03 runs in Focal and Jammy.

How would you run 20.03 on Jammy? To get to Jammy you would also have to upgrade to 22.03 since that is the version of ovn in Jammy.

Also the 20.03 charms do not support Jammy, see https://charmhub.io/ovn-chassis?channel=20.03/stable for example so you would never be able to run this code on Jammy.

@sombrafam sombrafam force-pushed the backports-version-pinning-option-to-20.03 branch 2 times, most recently from 0dca980 to 1897fb7 Compare May 14, 2024 13:43
@@ -6,10 +6,10 @@ on:

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-focal
Copy link
Contributor

Choose a reason for hiding this comment

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

Use ubuntu-20.04 here or stay with ubuntu-latest

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think you need to pin the OS version of the runner. Unless pip compiles a Python module the OS version shouldn't really matter.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Author

@sombrafam sombrafam May 21, 2024

Choose a reason for hiding this comment

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

Thanks for the review Nicolas. If I don't pin the version how will pip know that I want to run python 3.8/3.9? Since the backports are for focal, we need to use those python versions.

Copy link
Contributor

Choose a reason for hiding this comment

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

The actions/setup-python action will set up the correct Python version. When you then run something using python3 or similar in the runner it will use the Python version you had set up with that action.

Copy link
Author

Choose a reason for hiding this comment

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

Where would that go? I don't see that file or section in this project or in tests.yaml file.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Author

Choose a reason for hiding this comment

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

Ah ok, got it. So, if "python-version: [3.8, 3.9]" is set, "actions/setup-python@v2" will configure PIP for those two versions?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, it will create two VMs, one for each of the Python versions you put in that list.

@sombrafam sombrafam force-pushed the backports-version-pinning-option-to-20.03 branch 3 times, most recently from 89c0e0a to 8b5402b Compare May 23, 2024 13:34
@sombrafam
Copy link
Author

@nicolasbock do you have powers to trigger the CI? There is a build pending.

@sombrafam sombrafam force-pushed the backports-version-pinning-option-to-20.03 branch from 8b5402b to 020c979 Compare May 23, 2024 14:21
@sombrafam
Copy link
Author

@nicolasbock do you have powers to trigger the CI? There is a build pending.

Sorry for asking again but I pushed my last commit without adding the change. Can you re-trigger it one more time?

@nicolasbock
Copy link
Contributor

Sorry, no, I can't. You can rebase the commit though. That would trigger CI again.

@sombrafam
Copy link
Author

@nicolasbock, do you have any suggestions on how to fix this or debug this? I can't reproduce the issue locally, and it's only occurring here.

The OVN charms prepared for the upgrade from OVN 20.03 to newer
versions by unconditionally enabling version pinning.

Since then we have reached agreement with upstream that rolling
upgrades should work when upgrading within the previous upstream
LTS version and the next.

Having the pinning enabled may cause unnecessary grief for anyone
already upgraded to OVN 22.03.

Add a charm configuration option to allow controlling the version
pinning.

Closes-Bug: #2030944
Signed-off-by: Frode Nordahl <[email protected]>
(cherry picked from commit f68ecbd)
(cherry picked from commit 2a61104)
(cherry picked from commit bde8c8c)

Fix github build versions
@nicolasbock nicolasbock force-pushed the backports-version-pinning-option-to-20.03 branch from d51dfeb to bb8a4a4 Compare June 6, 2024 16:46
@brianphaley brianphaley merged commit c68ca86 into openstack-charmers:stable/20.03 Jun 6, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants