MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / Clusterd

Class Clusterd

misc/python/materialize/mzcompose/services/clusterd.py:25–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23
24
25class Clusterd(Service):
26 def __init__(
27 self,
28 name: str = "clusterd",
29 image: str | None = None,
30 environment_id: str | None = None,
31 environment_extra: list[str] = [],
32 memory: str | None = None,
33 cpu: str | None = None,
34 options: list[str] = [],
35 restart: str = "no",
36 stop_grace_period: str = "120s",
37 scratch_directory: str = "/scratch",
38 volumes: list[str] = [],
39 workers: int = 1,
40 process_names: list[str] = [],
41 mz_service: str = "materialized",
42 ) -> None:
43 environment = [
44 "CLUSTERD_LOG_FILTER",
45 f"CLUSTERD_GRPC_HOST={name}",
46 # For old Mz versions
47 "CLUSTERD_USE_CTP=true",
48 "MZ_SOFT_ASSERTIONS=1",
49 "MZ_EAT_MY_DATA=1",
50 # Defaults that were previously set by the clusterd entrypoint.sh.
51 "CLUSTERD_STORAGE_CONTROLLER_LISTEN_ADDR=0.0.0.0:2100",
52 "CLUSTERD_COMPUTE_CONTROLLER_LISTEN_ADDR=0.0.0.0:2101",
53 "CLUSTERD_INTERNAL_HTTP_LISTEN_ADDR=0.0.0.0:6878",
54 "CLUSTERD_SECRETS_READER=local-file",
55 "CLUSTERD_SECRETS_READER_LOCAL_FILE_DIR=/mzdata/secrets",
56 "LD_PRELOAD=libeatmydata.so",
57 f"CLUSTERD_PERSIST_PUBSUB_URL=http://{mz_service}:6879",
58 *environment_extra,
59 ]
60
61 if not environment_id:
62 environment_id = DEFAULT_MZ_ENVIRONMENT_ID
63
64 environment += [f"CLUSTERD_ENVIRONMENT_ID={environment_id}"]
65
66 process_names = process_names if process_names else [name]
67 process_index = process_names.index(name)
68 compute_timely_config = timely_config(
69 process_names, 2102, workers, DEFAULT_COMPUTE_EXERT_PROPORTIONALITY
70 )
71 storage_timely_config = timely_config(
72 process_names, 2103, workers, DEFAULT_STORAGE_EXERT_PROPORTIONALITY
73 )
74
75 environment += [
76 f"CLUSTERD_PROCESS={process_index}",
77 f"CLUSTERD_COMPUTE_TIMELY_CONFIG={compute_timely_config}",
78 f"CLUSTERD_STORAGE_TIMELY_CONFIG={storage_timely_config}",
79 ]
80
81 options = ["clusterd", f"--scratch-directory={scratch_directory}", *options]
82

Callers 15

mzcompose.pyFile · 0.90
mzcompose.pyFile · 0.90
run_testFunction · 0.90
mzcompose.pyFile · 0.90
mzcompose.pyFile · 0.90
mzcompose.pyFile · 0.90
workflow_mainFunction · 0.90
workflow_instance_sizeFunction · 0.90
mzcompose.pyFile · 0.90
mzcompose.pyFile · 0.90
mzcompose.pyFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected