4141from materialize .mzcompose .services .balancerd import Balancerd
4242from materialize .mzcompose .services .clusterd import Clusterd
4343from materialize .mzcompose .services .environmentd import Environmentd
44+ from materialize .mzcompose .services .mz_debug import MzDebug
4445from materialize .mzcompose .services .orchestratord import Orchestratord
4546from materialize .mzcompose .services .testdrive import Testdrive
4647from materialize .util import all_subclasses
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+
6176def 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:
10701085class 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
14981514def 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