Skip to content

Commit

Permalink
Enhance clarity and consistency of step descriptions (#302) (#321)
Browse files Browse the repository at this point in the history
(cherry-picked from e058b21)

- Better indicating a timeout step with `Wait for up to...`
- Start the description of "UpgradeStep" with a verb
- No period at the end of the step description
- Quotation mark around variables like app name, unit name, model name,
etc
- Other miscellaneous grammar and wording fixes

fixes: #288
  • Loading branch information
agileshaw committed Mar 20, 2024
1 parent 4979023 commit cb9df7f
Show file tree
Hide file tree
Showing 16 changed files with 221 additions and 250 deletions.
3 changes: 2 additions & 1 deletion cou/apps/auxiliary.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ def _get_change_require_osd_release_step(self) -> PreUpgradeStep:
"""
ceph_mon_unit, *_ = self.units
return PreUpgradeStep(
description="Ensure require-osd-release option matches with ceph-osd version",
description="Ensure that the 'require-osd-release' option matches the "
"'ceph-osd' version",
coro=set_require_osd_release_option(ceph_mon_unit.name, self.model),
)

Expand Down
32 changes: 16 additions & 16 deletions cou/apps/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ def generate_upgrade_plan(self, target: OpenStackRelease) -> ApplicationUpgradeP
self.upgrade_plan_sanity_checks(target)

upgrade_plan = ApplicationUpgradePlan(
description=f"Upgrade plan for '{self.name}' to {target}",
description=f"Upgrade plan for '{self.name}' to '{target}'",
)
upgrade_plan.add_steps(self.pre_upgrade_steps(target))
upgrade_plan.add_steps(self.upgrade_steps(target))
Expand All @@ -520,9 +520,8 @@ def _get_upgrade_current_release_packages_step(self) -> PreUpgradeStep:
:rtype: PreUpgradeStep
"""
step = PreUpgradeStep(
description=(
f"Upgrade software packages of '{self.name}' from the current APT repositories"
),
description=f"Upgrade software packages of '{self.name}' from the current "
"APT repositories",
parallel=True,
)
step.add_steps(
Expand Down Expand Up @@ -565,7 +564,7 @@ def _get_refresh_charm_step(self, target: OpenStackRelease) -> PreUpgradeStep:
)

if self.charm_origin == "cs":
description = f"Migration of '{self.name}' from charmstore to charmhub"
description = f"Migrate '{self.name}' from charmstore to charmhub"
switch = f"ch:{self.charm}"
elif self.channel in self.possible_current_channels:
channel = self.channel
Expand Down Expand Up @@ -599,9 +598,8 @@ def _get_upgrade_charm_step(self, target: OpenStackRelease) -> UpgradeStep:
"""
if self.channel != self.target_channel(target):
return UpgradeStep(
description=(
f"Upgrade '{self.name}' to the new channel: '{self.target_channel(target)}'"
),
description=f"Upgrade '{self.name}' to the new channel: "
f"'{self.target_channel(target)}'",
coro=self.model.upgrade_charm(self.name, self.target_channel(target)),
)
return UpgradeStep()
Expand All @@ -627,7 +625,7 @@ def _set_action_managed_upgrade(self, enable: bool) -> UpgradeStep:
return UpgradeStep()

return UpgradeStep(
f"Change charm config of '{self.name}' 'action-managed-upgrade' to {enable}",
f"Change charm config of '{self.name}' 'action-managed-upgrade' to '{enable}'",
coro=self.model.set_application_config(self.name, {"action-managed-upgrade": enable}),
)

Expand All @@ -641,10 +639,8 @@ def _get_workload_upgrade_step(self, target: OpenStackRelease) -> UpgradeStep:
"""
if self.os_origin != self.new_origin(target) and self.origin_setting:
return UpgradeStep(
description=(
f"Change charm config of '{self.name}' "
f"'{self.origin_setting}' to '{self.new_origin(target)}'"
),
description=f"Change charm config of '{self.name}' "
f"'{self.origin_setting}' to '{self.new_origin(target)}'",
coro=self.model.set_application_config(
self.name, {self.origin_setting: self.new_origin(target)}
),
Expand All @@ -666,7 +662,7 @@ def _get_reached_expected_target_step(self, target: OpenStackRelease) -> PostUpg
:rtype: PostUpgradeStep
"""
return PostUpgradeStep(
description=f"Check if the workload of '{self.name}' has been upgraded",
description=f"Verify that the workload of '{self.name}' has been upgraded",
coro=self._check_upgrade(target),
)

Expand All @@ -678,11 +674,15 @@ def _get_wait_step(self) -> PostUpgradeStep:
"""
if self.wait_for_model:
description = (
f"Wait {self.wait_timeout}s for model {self.model.name} to reach the idle state."
f"Wait for up to {self.wait_timeout}s for model '{self.model.name}' "
"to reach the idle state"
)
apps = None
else:
description = f"Wait {self.wait_timeout}s for app {self.name} to reach the idle state."
description = (
f"Wait for up to {self.wait_timeout}s for app '{self.name}' "
"to reach the idle state"
)
apps = [self.name]

return PostUpgradeStep(
Expand Down
4 changes: 2 additions & 2 deletions cou/steps/plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ async def generate_plan(analysis_result: Analysis, args: CLIargs) -> UpgradePlan
if args.backup:
plan.add_step(
PreUpgradeStep(
description="Backup mysql databases",
description="Back up MySQL databases",
parallel=False,
coro=backup(analysis_result.model),
)
Expand Down Expand Up @@ -122,7 +122,7 @@ async def create_upgrade_group(
:type apps: list[OpenStackApplication]
:param target: Target OpenStack release.
:type target: OpenStackRelease
:param description: Description of the upgrade step.
:param description: Description of the upgrade plan.
:type description: str
:param filter_function: Function to filter applications.
:type filter_function: Callable[[OpenStackApplication], bool]
Expand Down
8 changes: 4 additions & 4 deletions docs/how-to/interruption.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ Usage example:
...
Running cloud upgrade...
Verify that all OpenStack applications are in idle state ✔
Backup mysql databases ✔
Upgrade plan for 'keystone' to victoria
Back up MySQL databases ✔
Upgrade plan for 'keystone' to 'victoria'
Upgrade software packages of 'keystone' from the current APT repositories
Upgrade software packages on unit keystone/0
Upgrade software packages on unit keystone/1
Upgrade software packages on unit keystone/2
Upgrade 'keystone' to the new channel: 'victoria/stable'
Change charm config of 'keystone' 'openstack-origin' to 'cloud:focal-victoria'
Wait 1800s for model test-model to reach the idle state.
Check if the workload of 'keystone' has been upgraded
Wait for up to 1800s for model 'test-model' to reach the idle state
Verify that the workload of 'keystone' has been upgraded

Would you like to start the upgrade? Continue (y/N): n

Expand Down
10 changes: 5 additions & 5 deletions docs/how-to/no-backup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Plan:
Verify that all OpenStack applications are in idle state
# note that there's no backup step planned
Control Plane principal(s) upgrade plan
Upgrade plan for 'rabbitmq-server' to victoria
Upgrade plan for 'rabbitmq-server' to 'victoria'
Upgrade software packages of 'rabbitmq-server' from the current APT repositories
Upgrade software packages on unit rabbitmq-server/0
Upgrade software packages on unit rabbitmq-server/1
Expand All @@ -42,18 +42,18 @@ Upgrade:
Verify that all OpenStack applications are in idle state ✔
# note that there's no backup step being executed

Upgrade plan for 'rabbitmq-server' to victoria
Upgrade plan for 'rabbitmq-server' to 'victoria'
Upgrade software packages of 'rabbitmq-server' from the current APT repositories
Upgrade software packages on unit rabbitmq-server/0
Upgrade software packages on unit rabbitmq-server/1
Upgrade software packages on unit rabbitmq-server/2
Upgrade 'rabbitmq-server' to the new channel: '3.9/stable'
Change charm config of 'rabbitmq-server' 'source' to 'cloud:focal-victoria'
Wait 1800s for model test-model to reach the idle state.
Check if the workload of 'rabbitmq-server' has been upgraded
Wait for up to 1800s for model 'test-model' to reach the idle state
Verify that the workload of 'rabbitmq-server' has been upgraded

Continue (y/n): y
Upgrade plan for 'rabbitmq-server' to victoria ✔
Upgrade plan for 'rabbitmq-server' to 'victoria'

... # apply steps
Upgrade completed.
58 changes: 29 additions & 29 deletions docs/how-to/plan-upgrade.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,74 +21,74 @@ Usage example
Generating upgrade plan... ✔
Upgrade cloud from 'ussuri' to 'victoria'
Verify that all OpenStack applications are in idle state
Backup mysql databases
Back up MySQL databases
Control Plane principal(s) upgrade plan
Upgrade plan for 'rabbitmq-server' to victoria
Upgrade plan for 'rabbitmq-server' to 'victoria'
Upgrade software packages of 'rabbitmq-server' from the current APT repositories
Upgrade software packages on unit rabbitmq-server/0
Upgrade software packages on unit rabbitmq-server/1
Upgrade software packages on unit rabbitmq-server/2
Upgrade 'rabbitmq-server' to the new channel: '3.9/stable'
Change charm config of 'rabbitmq-server' 'source' to 'cloud:focal-victoria'
Wait 1800s for model test-model to reach the idle state.
Check if the workload of 'rabbitmq-server' has been upgraded
Upgrade plan for 'keystone' to victoria
Wait for up to 1800s for model 'test-model' to reach the idle state
Verify that the workload of 'rabbitmq-server' has been upgraded
Upgrade plan for 'keystone' to 'victoria'
Upgrade software packages of 'keystone' from the current APT repositories
Upgrade software packages on unit keystone/0
Upgrade software packages on unit keystone/1
Upgrade software packages on unit keystone/2
Upgrade 'keystone' to the new channel: 'victoria/stable'
Change charm config of 'keystone' 'openstack-origin' to 'cloud:focal-victoria'
Wait 1800s for model test-model to reach the idle state.
Check if the workload of 'keystone' has been upgraded
Upgrade plan for 'cinder' to victoria
Wait for up to 1800s for model 'test-model' to reach the idle state
Verify that the workload of 'keystone' has been upgraded
Upgrade plan for 'cinder' to 'victoria'
Upgrade software packages of 'cinder' from the current APT repositories
Upgrade software packages on unit cinder/0
Upgrade 'cinder' to the new channel: 'victoria/stable'
Change charm config of 'cinder' 'openstack-origin' to 'cloud:focal-victoria'
Wait 300s for app cinder to reach the idle state.
Check if the workload of 'cinder' has been upgraded
Upgrade plan for 'glance' to victoria
Wait for up to 300s for app 'cinder' to reach the idle state
Verify that the workload of 'cinder' has been upgraded
Upgrade plan for 'glance' to 'victoria'
Upgrade software packages of 'glance' from the current APT repositories
Upgrade software packages on unit glance/0
Upgrade 'glance' to the new channel: 'victoria/stable'
Change charm config of 'glance' 'openstack-origin' to 'cloud:focal-victoria'
Wait 300s for app glance to reach the idle state.
Check if the workload of 'glance' has been upgraded
Upgrade plan for 'neutron-api' to victoria
Wait for up to 300s for app 'glance' to reach the idle state
Verify that the workload of 'glance' has been upgraded
Upgrade plan for 'neutron-api' to 'victoria'
Upgrade software packages of 'neutron-api' from the current APT repositories
Upgrade software packages on unit neutron-api/0
Upgrade 'neutron-api' to the new channel: 'victoria/stable'
Change charm config of 'neutron-api' 'openstack-origin' to 'cloud:focal-victoria'
Wait 300s for app neutron-api to reach the idle state.
Check if the workload of 'neutron-api' has been upgraded
Upgrade plan for 'neutron-gateway' to victoria
Wait for up to 300s for app 'neutron-api' to reach the idle state
Verify that the workload of 'neutron-api' has been upgraded
Upgrade plan for 'neutron-gateway' to 'victoria'
Upgrade software packages of 'neutron-gateway' from the current APT repositories
Upgrade software packages on unit neutron-gateway/0
Upgrade 'neutron-gateway' to the new channel: 'victoria/stable'
Change charm config of 'neutron-gateway' 'openstack-origin' to 'cloud:focal-victoria'
Wait 300s for app neutron-gateway to reach the idle state.
Check if the workload of 'neutron-gateway' has been upgraded
Upgrade plan for 'placement' to victoria
Wait for up to 300s for app 'neutron-gateway' to reach the idle state
Verify that the workload of 'neutron-gateway' has been upgraded
Upgrade plan for 'placement' to 'victoria'
Upgrade software packages of 'placement' from the current APT repositories
Upgrade software packages on unit placement/0
Upgrade 'placement' to the new channel: 'victoria/stable'
Change charm config of 'placement' 'openstack-origin' to 'cloud:focal-victoria'
Wait 300s for app placement to reach the idle state.
Check if the workload of 'placement' has been upgraded
Upgrade plan for 'nova-cloud-controller' to victoria
Wait for up to 300s for app 'placement' to reach the idle state
Verify that the workload of 'placement' has been upgraded
Upgrade plan for 'nova-cloud-controller' to 'victoria'
Upgrade software packages of 'nova-cloud-controller' from the current APT repositories
Upgrade software packages on unit nova-cloud-controller/0
Upgrade 'nova-cloud-controller' to the new channel: 'victoria/stable'
Change charm config of 'nova-cloud-controller' 'openstack-origin' to 'cloud:focal-victoria'
Wait 300s for app nova-cloud-controller to reach the idle state.
Check if the workload of 'nova-cloud-controller' has been upgraded
Upgrade plan for 'mysql' to victoria
Wait for up to 300s for app 'nova-cloud-controller' to reach the idle state
Verify that the workload of 'nova-cloud-controller' has been upgraded
Upgrade plan for 'mysql' to 'victoria'
Upgrade software packages of 'mysql' from the current APT repositories
Upgrade software packages on unit mysql/0
Change charm config of 'mysql' 'source' to 'cloud:focal-victoria'
Wait 1800s for app mysql to reach the idle state.
Check if the workload of 'mysql' has been upgraded
Wait for up to 1800s for app 'mysql' to reach the idle state
Verify that the workload of 'mysql' has been upgraded
Control Plane subordinate(s) upgrade plan
Upgrade plan for 'neutron-openvswitch' to victoria
Upgrade plan for 'neutron-openvswitch' to 'victoria'
Upgrade 'neutron-openvswitch' to the new channel: 'victoria/stable'
Loading

0 comments on commit cb9df7f

Please sign in to comment.