File tree Expand file tree Collapse file tree 4 files changed +17
-4
lines changed
misc/python/materialize/mzcompose Expand file tree Collapse file tree 4 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -701,13 +701,13 @@ def validate_sources_sinks_clusters(self) -> str | None:
701
701
def sanity_restart_mz (self ) -> None :
702
702
"""Restart Materialized if it is part of the composition to find
703
703
problems with persisted objects, functions as a sanity check."""
704
- # Exclude environmentd image, which is used in cloud-canary, and doesn't start up fully without clusterd images
705
704
if (
706
705
"materialized" in self .compose ["services" ]
707
- and "materialize/environmentd"
708
- not in self .compose ["services" ]["materialized" ]["image" ]
706
+ and "sanity_restart" in self .compose ["services" ]["materialized" ]["labels" ]
709
707
):
710
- ui .header ("Sanity Check: Restart Mz, verify source/sink/replica health" )
708
+ ui .header (
709
+ "Sanity Restart: Restart Mz and verify source/sink/replica health"
710
+ )
711
711
self .kill ("materialized" )
712
712
# TODO(def-): Better way to detect when kill has finished
713
713
time .sleep (3 )
@@ -724,6 +724,10 @@ def sanity_restart_mz(self) -> None:
724
724
# Sources and cluster replicas need a few seconds to start up
725
725
print (f"Retrying ({ i + 1 } /{ NUM_RETRIES } )..." )
726
726
time .sleep (1 )
727
+ else :
728
+ ui .header (
729
+ "Sanity Restart skipped because Mz not in services or `sanity_restart` label not set"
730
+ )
727
731
728
732
def down (
729
733
self ,
Original file line number Diff line number Diff line change @@ -159,6 +159,9 @@ class ServiceConfig(TypedDict, total=False):
159
159
restart : str
160
160
"""Restart policy."""
161
161
162
+ labels : list [str ]
163
+ """Container labels."""
164
+
162
165
163
166
class Service :
164
167
"""A Docker Compose service in a `Composition`.
Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ def __init__(
48
48
system_parameter_defaults : dict [str , str ] | None = None ,
49
49
additional_system_parameter_defaults : dict [str , str ] | None = None ,
50
50
soft_assertions : bool = True ,
51
+ sanity_restart : bool = True ,
51
52
) -> None :
52
53
depends_graph : dict [str , ServiceDependency ] = {
53
54
s : {"condition" : "service_started" } for s in depends_on
@@ -164,6 +165,9 @@ def __init__(
164
165
if memory :
165
166
config ["deploy" ] = {"resources" : {"limits" : {"memory" : memory }}}
166
167
168
+ if sanity_restart :
169
+ config .setdefault ("labels" , []).append ("sanity_restart" )
170
+
167
171
volumes = []
168
172
if use_default_volumes :
169
173
volumes += DEFAULT_MZ_VOLUMES
Original file line number Diff line number Diff line change 54
54
"--orchestrator-process-secrets-directory=/mzdata/secrets" ,
55
55
"--orchestrator-process-scratch-directory=/scratch" ,
56
56
],
57
+ # We can not restart this container at will, as it does not have clusterd
58
+ sanity_restart = False ,
57
59
),
58
60
Testdrive (), # Overriden below
59
61
Mz (
You can’t perform that action at this time.
0 commit comments