-
Notifications
You must be signed in to change notification settings - Fork 579
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
Ducktape test to execute workloads through multi-release upgrades #8253
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
52abd72
tests: RedpandaVersion typing
andijcr f332fca
tests/redpanda_test: upgrade_through_versions now accepts a callback
andijcr cd44aa3
services/workload_protocol: introduced Protocol for test workloads
andijcr a1b9b56
tsts/workload_license: tests enterprise license during upgrades
andijcr 59af831
tests/workload_producer_consumer: ProducerConsumerWorkload
andijcr 7fec570
tests/workload_upgrade_runner_test: RedpandaUpgradeTest
andijcr 16289e7
t/redpanda_installer: cache for highest_from_previous_feature_version
andijcr 0913b54
t/workload_upgrade_runner_test: disable test in debug mode
andijcr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# Copyright 2023 Redpanda Data, Inc. | ||
# | ||
# Use of this software is governed by the Business Source License | ||
# included in the file licenses/BSL.md | ||
# | ||
# As of the Change Date specified in that file, in accordance with | ||
# the Business Source License, use of this software will be governed | ||
# by the Apache License, Version 2.0 | ||
|
||
from abc import abstractmethod | ||
andijcr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
from typing import Protocol, Optional, ClassVar, Any | ||
|
||
from rptest.services.redpanda_installer import RedpandaInstaller, RedpandaVersion, RedpandaVersionLine, RedpandaVersionTriple | ||
from rptest.tests.redpanda_test import RedpandaTest | ||
|
||
|
||
class PWorkload(Protocol): | ||
DONE: ClassVar[int] = -1 | ||
NOT_DONE: ClassVar[int] = 1 | ||
""" | ||
member variable to access RedpandaTest facilities | ||
""" | ||
ctx: RedpandaTest | ||
|
||
def get_workload_name(self) -> str: | ||
return self.__class__.__name__ | ||
|
||
def get_earliest_applicable_release( | ||
self) -> Optional[RedpandaVersionLine | RedpandaVersionTriple]: | ||
""" | ||
returns the earliest release that this Workload can operate on. | ||
None -> use the oldest available release | ||
(X, Y) -> use the latest minor version in line vX.Y | ||
(X, Y, Z) -> use the release vX.Y.Z | ||
""" | ||
return None | ||
|
||
def get_latest_applicable_release(self) -> RedpandaVersion: | ||
""" | ||
returns the latest release that this Workload can operate on. | ||
RedpandaInstaller.HEAD -> use head version (compiled from source | ||
(X, Y) -> use the latest minor version in line vX.Y | ||
(X, Y, Z) -> use the release vX.Y.Z | ||
""" | ||
return RedpandaInstaller.HEAD | ||
|
||
def begin(self) -> None: | ||
""" | ||
This method is called before starting the workload. the active redpanda version is self->get_earliest_applicable_relase(). | ||
use this method to set up the topic this workload will operate on, with a unique and descriptive name. | ||
Additionally, this method should setup an external service that will produce and consume data from the topic. | ||
""" | ||
return | ||
|
||
def on_partial_cluster_upgrade( | ||
self, versions: dict[Any, RedpandaVersionTriple]) -> int: | ||
""" | ||
This method is called while upgrading a cluster, in a mixed state where some of the nodes will have the new version and some the old one. | ||
versions is a dictionary of redpanda node->version | ||
""" | ||
return PWorkload.DONE | ||
|
||
@abstractmethod | ||
def on_cluster_upgraded(self, version: RedpandaVersionTriple) -> int: | ||
""" | ||
This method is called to ensure that Workload is progressing on the active redpanda version | ||
use this method to check the external services and the Workload invariants on the active redpanda version. | ||
return self.DONE to signal that no further check is needed for this redpanda version | ||
return self.NOT_DONE to signal that self.progress should be called again on this redpanda version | ||
""" | ||
raise NotImplementedError | ||
|
||
def end(self) -> None: | ||
""" | ||
This method is called after the last call of progress, the repdanda active version is self.get_latest_applicable_release(). | ||
use this method to tear down external services and perform cleanup. | ||
""" | ||
return |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: it would be nice to wrap this version back and forth in a type (i.e. RedpandaVersionTriple becomes a dataclass and this stuff is wrapped in a member)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pain with a dataclass is that we use "head" as a version in the codebase, and sometimes we need to convert it to and actual triple. That requires RedpandaInstaller to do it, and a query to a running instance of redpanda in principle, breaking a bit the encapsulation of a dataclass.