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

Add pre-upgrade step to verify nova-compute #280

Merged

Conversation

rgildein
Copy link
Contributor

@rgildein rgildein commented Mar 6, 2024

Add pre-upgrade step for CephOsd, which will check nova-compute upgrade status.

raleted: #275

Add pre-upgrade step for CephOsd, which will check nova-compute
upgrade status.

raleted: canonical#275
@rgildein rgildein added the enhancement New feature or request label Mar 6, 2024
@rgildein rgildein self-assigned this Mar 6, 2024
@rgildein rgildein requested review from a team, Pjack, aieri, agileshaw and jneo8 March 6, 2024 15:52
@rgildein rgildein marked this pull request as draft March 6, 2024 16:26
cou/apps/auxiliary.py Outdated Show resolved Hide resolved
@AppFactory.register_application(["ceph-osd"])
class CephOSD(AuxiliaryApplication):
"""Application for ceph-osd."""

def _are_collocated(self, units: list[COUUnit], charm: str) -> bool:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
def _are_collocated(self, units: list[COUUnit], charm: str) -> bool:
def _are_colocated(self, units: list[COUUnit], charm: str) -> bool:

and elsewhere

@rgildein rgildein requested a review from gabrielcocenza March 7, 2024 17:52
Copy link
Member

@gabrielcocenza gabrielcocenza left a comment

Choose a reason for hiding this comment

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

I'm ok with the current approach and the suggestions are not critical.

I think it would be nice to add a custom upgrade_plan_sanity_checks that checks if units were passed and in that case raise an Exception saying that ceph-osd doesn't accept being upgraded unit-by-unit

cou/apps/auxiliary.py Show resolved Hide resolved
cou/apps/auxiliary.py Outdated Show resolved Hide resolved
cou/apps/auxiliary.py Show resolved Hide resolved
cou/apps/auxiliary.py Show resolved Hide resolved
cou/apps/auxiliary.py Show resolved Hide resolved
"""
steps = [
PreUpgradeStep(
description="Check if colocated nova-compute units had been upgraded.",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
description="Check if colocated nova-compute units had been upgraded.",
description="Check if all nova-compute units had been upgraded.",

@rgildein
Copy link
Contributor Author

rgildein commented Mar 7, 2024

I'm ok with the current approach and the suggestions are not critical.

I think it would be nice to add a custom upgrade_plan_sanity_checks that checks if units were passed and in that case raise an Exception saying that ceph-osd doesn't accept being upgraded unit-by-unit

Since we add logic of units to all OpenStackApplication was introduced to all OpenStack applications, and we spoke that it's ok, I do not see why we need to raise an exception here. If you want to upgrade a single unit, it still means that all nova-computes needs to be upgraded.

Copy link
Member

@gabrielcocenza gabrielcocenza left a comment

Choose a reason for hiding this comment

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

Since we add logic of units to all OpenStackApplication was introduced to all OpenStack applications, and we spoke that it's ok, I do not see why we need to raise an exception here. If you want to upgrade a single unit, it still means that all nova-computes needs to be upgraded

OpenStack Applications have actions to upgrade unit by unit. Ceph can't do that because it doesn't have the actions necessary to do it.

Actually, I think all AuxiliaryApplication can't upgrade unit by unit, so this should be target in a different PR

Copy link
Member

@gabrielcocenza gabrielcocenza left a comment

Choose a reason for hiding this comment

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

I'm ok with the approach

cou/apps/auxiliary.py Outdated Show resolved Hide resolved
cou/apps/auxiliary.py Show resolved Hide resolved
@rgildein rgildein marked this pull request as ready for review March 8, 2024 15:34
@rgildein rgildein requested review from aieri and gabrielcocenza March 8, 2024 16:11
Copy link
Member

@gabrielcocenza gabrielcocenza left a comment

Choose a reason for hiding this comment

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

Just some small suggestions

tests/unit/apps/test_auxiliary.py Outdated Show resolved Hide resolved
tests/unit/apps/test_auxiliary.py Outdated Show resolved Hide resolved
tests/unit/apps/test_auxiliary.py Outdated Show resolved Hide resolved
tests/unit/apps/test_auxiliary.py Show resolved Hide resolved
@rgildein
Copy link
Contributor Author

Unit tests are failing due #286.

@rgildein rgildein requested a review from gabrielcocenza March 11, 2024 12:55
target = OpenStackRelease("victoria")
nova_compute = MagicMock(spec_set=NovaCompute)()
nova_compute.charm = "nova-compute"
nova_compute.units = {"nova-compute/0": COUUnit("nova-compute/0", None, "22.0.0")}
Copy link
Member

Choose a reason for hiding this comment

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

nit: I know that mocking find_compatible_versions the workload_version is irrelevant, but changing to the ussuri workload_version is preferable.

Suggested change
nova_compute.units = {"nova-compute/0": COUUnit("nova-compute/0", None, "22.0.0")}
nova_compute.units = {"nova-compute/0": COUUnit("nova-compute/0", None, "21.0.0")}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I accidentally change it base on this comment, if there will be another change-request I will change it. Thanks

Copy link
Contributor

@agileshaw agileshaw left a comment

Choose a reason for hiding this comment

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

LGTM

@rgildein rgildein merged commit e588f57 into canonical:dev/data-plane Mar 13, 2024
4 checks passed
@rgildein rgildein deleted the feature/BSENG-2012/add-ceph-osd-2 branch March 13, 2024 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants