Skip to content

Commit de0b470

Browse files
committed
orchestratord test: Change upgrade order
1 parent 13e7ec6 commit de0b470

File tree

2 files changed

+39
-15
lines changed

2 files changed

+39
-15
lines changed

ci/nightly/pipeline.template.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2364,6 +2364,7 @@ steps:
23642364
steps:
23652365
- id: orchestratord-defaults
23662366
label: "Orchestratord test (defaults from documentation)"
2367+
artifact_paths: ["mz_debug_*.zip"]
23672368
depends_on: devel-docker-tags
23682369
timeout_in_minutes: 120
23692370
plugins:
@@ -2376,6 +2377,7 @@ steps:
23762377

23772378
- id: orchestratord-default-properties
23782379
label: "Orchestratord test (defaults for properties)"
2380+
artifact_paths: ["mz_debug_*.zip"]
23792381
depends_on: devel-docker-tags
23802382
timeout_in_minutes: 120
23812383
plugins:
@@ -2388,6 +2390,7 @@ steps:
23882390

23892391
- id: orchestratord-individual
23902392
label: "Orchestratord test (individual properties)"
2393+
artifact_paths: ["mz_debug_*.zip"]
23912394
depends_on: devel-docker-tags
23922395
timeout_in_minutes: 120
23932396
plugins:
@@ -2400,6 +2403,7 @@ steps:
24002403

24012404
- id: orchestratord-combine
24022405
label: "Orchestratord test (combine properties)"
2406+
artifact_paths: ["mz_debug_*.zip"]
24032407
depends_on: build-aarch64
24042408
timeout_in_minutes: 120
24052409
plugins:
@@ -2412,6 +2416,7 @@ steps:
24122416

24132417
- id: orchestratord-upgrade-individual
24142418
label: "Orchestratord test (upgrade, individual props)"
2419+
artifact_paths: ["mz_debug_*.zip"]
24152420
depends_on: devel-docker-tags
24162421
timeout_in_minutes: 120
24172422
plugins:
@@ -2427,6 +2432,7 @@ steps:
24272432

24282433
- id: orchestratord-upgrade-combine
24292434
label: "Orchestratord test (upgrade, combine props)"
2435+
artifact_paths: ["mz_debug_*.zip"]
24302436
depends_on: devel-docker-tags
24312437
timeout_in_minutes: 120
24322438
plugins:
@@ -2442,6 +2448,7 @@ steps:
24422448

24432449
- id: orchestratord-upgrade-chain-individual
24442450
label: "Orchestratord test (upgrade chain, individual props)"
2451+
artifact_paths: ["mz_debug_*.zip"]
24452452
depends_on: devel-docker-tags
24462453
timeout_in_minutes: 120
24472454
plugins:
@@ -2457,6 +2464,7 @@ steps:
24572464

24582465
- id: orchestratord-upgrade-chain-combine
24592466
label: "Orchestratord test (upgrade chain, combine props)"
2467+
artifact_paths: ["mz_debug_*.zip"]
24602468
depends_on: devel-docker-tags
24612469
timeout_in_minutes: 120
24622470
plugins:

test/orchestratord/mzcompose.py

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
from materialize.mzcompose.services.balancerd import Balancerd
4242
from materialize.mzcompose.services.clusterd import Clusterd
4343
from materialize.mzcompose.services.environmentd import Environmentd
44+
from materialize.mzcompose.services.mz_debug import MzDebug
4445
from materialize.mzcompose.services.orchestratord import Orchestratord
4546
from materialize.mzcompose.services.testdrive import Testdrive
4647
from materialize.util import all_subclasses
@@ -55,9 +56,23 @@
5556
Environmentd(),
5657
Clusterd(),
5758
Balancerd(),
59+
MzDebug(),
5860
]
5961

6062

63+
def run_mz_debug() -> None:
64+
spawn.runv(
65+
[
66+
"./mz-debug",
67+
"self-managed",
68+
"--k8s-namespace",
69+
"materialize-environment",
70+
"--mz-instance-name",
71+
"12345678-1234-1234-1234-123456789012",
72+
]
73+
)
74+
75+
6176
def get_tag(tag: str | None = None) -> str:
6277
# We can't use the mzbuild tag because it has a different fingerprint for
6378
# environmentd/clusterd/balancerd and the orchestratord depends on them
@@ -505,7 +520,7 @@ def check() -> None:
505520
)
506521
expected = f"{image_registry}/environmentd:{self.value}"
507522
assert (
508-
image == expected
523+
image == expected or f"ghcr.io/materializeinc/{image}" == expected
509524
), f"Expected environmentd image {expected}, but found {image}"
510525

511526
retry(check, 240)
@@ -1070,11 +1085,11 @@ def check_pods() -> None:
10701085
class AuthenticatorKind(Modification):
10711086
@classmethod
10721087
def values(cls, version: MzVersion) -> list[Any]:
1073-
# Test None, Password (v0.147.7+), and Sasl (v0.147.16+)
1088+
# Test None, Password (v0.147.7+), and Sasl
10741089
result = ["None"]
10751090
if version >= MzVersion.parse_mz("v0.147.7"):
10761091
result.append("Password")
1077-
if version >= MzVersion.parse_mz("v0.147.16"):
1092+
if version >= MzVersion.parse_mz("v26.0.0"):
10781093
result.append("Sasl")
10791094
return result
10801095

@@ -1100,13 +1115,13 @@ def validate(self, mods: dict[type[Modification], Any]) -> None:
11001115
if self.value == "Password" and version <= MzVersion.parse_mz("v0.147.6"):
11011116
return
11021117

1103-
if self.value == "Sasl" and version < MzVersion.parse_mz("v0.147.16"):
1118+
if self.value == "Sasl" and version < MzVersion.parse_mz("v26.0.0"):
11041119
return
11051120

11061121
port = (
11071122
6875
11081123
if (version >= MzVersion.parse_mz("v0.147.0") and self.value == "Password")
1109-
or (version >= MzVersion.parse_mz("v0.147.16") and self.value == "Sasl")
1124+
or (version >= MzVersion.parse_mz("v26.0.0") and self.value == "Sasl")
11101125
else 6877
11111126
)
11121127
for i in range(120):
@@ -1252,6 +1267,9 @@ def workflow_defaults(c: Composition, parser: WorkflowArgumentParser) -> None:
12521267
)
12531268
args = parser.parse_args()
12541269

1270+
c.up(Service("mz-debug", idle=True))
1271+
c.invoke("cp", "mz-debug:/usr/local/bin/mz-debug", ".")
1272+
12551273
current_version = get_tag(args.tag)
12561274

12571275
# Following https://materialize.com/docs/installation/install-on-local-kind/
@@ -1392,9 +1410,6 @@ def workflow_defaults(c: Composition, parser: WorkflowArgumentParser) -> None:
13921410
materialize_setup = list(yaml.load_all(f, Loader=yaml.Loader))
13931411
assert len(materialize_setup) == 3
13941412

1395-
print(version)
1396-
print(current_version)
1397-
print(version == current_version)
13981413
if version == current_version:
13991414
materialize_setup[2]["spec"][
14001415
"environmentdImageRef"
@@ -1493,6 +1508,7 @@ def workflow_defaults(c: Composition, parser: WorkflowArgumentParser) -> None:
14931508
]
14941509
)
14951510
raise ValueError("Never completed")
1511+
run_mz_debug()
14961512

14971513

14981514
def workflow_default(c: Composition, parser: WorkflowArgumentParser) -> None:
@@ -1534,7 +1550,8 @@ def workflow_default(c: Composition, parser: WorkflowArgumentParser) -> None:
15341550
"0.29.0"
15351551
), f"kind >= v0.29.0 required, while you are on {kind_version}"
15361552

1537-
c.up(Service("testdrive", idle=True))
1553+
c.up(Service("testdrive", idle=True), Service("mz-debug", idle=True))
1554+
c.invoke("cp", "mz-debug:/usr/local/bin/mz-debug", ".")
15381555

15391556
cluster = "kind"
15401557
clusters = spawn.capture(["kind", "get", "clusters"]).strip().split("\n")
@@ -1806,18 +1823,14 @@ def run_scenario(
18061823
mod.modify(definition)
18071824
if mod.value in mod.failed_reconciliation_values():
18081825
expect_fail = True
1809-
if not initialize:
1810-
definition["materialize"]["spec"][
1811-
"rolloutStrategy"
1812-
] = "ImmediatelyPromoteCausingDowntime"
1813-
definition["materialize"]["spec"]["requestRollout"] = str(uuid.uuid4())
1814-
run(definition, expect_fail)
18151826
if initialize:
18161827
init(definition)
18171828
run(definition, expect_fail)
18181829
initialize = False # only initialize once
18191830
else:
18201831
upgrade(definition, expect_fail)
1832+
definition["materialize"]["spec"]["requestRollout"] = str(uuid.uuid4())
1833+
run(definition, expect_fail)
18211834
mod_dict = {mod.__class__: mod.value for mod in mods}
18221835
for subclass in all_subclasses(Modification):
18231836
if subclass not in mod_dict:
@@ -1830,6 +1843,7 @@ def run_scenario(
18301843
print(
18311844
f"Reproduce with bin/mzcompose --find orchestratord run default --recreate-cluster --scenario='{scenario_json}'"
18321845
)
1846+
run_mz_debug()
18331847
raise
18341848

18351849

@@ -2007,3 +2021,5 @@ def post_run_check(definition: dict[str, Any], expect_fail: bool) -> None:
20072021
raise ValueError("Never completed")
20082022
# Wait a bit for the status to stabilize
20092023
time.sleep(60)
2024+
2025+
run_mz_debug()

0 commit comments

Comments
 (0)