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

Function main

misc/python/materialize/cli/mzcompose.py:60–179  ·  view source on GitHub ↗
(argv: list[str])

Source from the content-addressed store, hash-verified

58
59
60def main(argv: list[str]) -> None:
61 parser = ArgumentParser(
62 prog="mzcompose",
63 formatter_class=argparse.RawDescriptionHelpFormatter,
64 description="""
65mzcompose orchestrates services defined in mzcompose.py.
66It wraps Docker Compose to add some Materialize-specific features.""",
67 epilog="""
68These are only the most common options. There are additional Docker Compose
69options that are also supported. Consult `docker compose help` for the full
70set.
71
72For help on a specific command, run `mzcompose COMMAND --help`.
73
74For additional details on mzcompose, consult doc/developer/mzbuild.md.""",
75 )
76
77 # Global arguments.
78 parser.add_argument(
79 "--mz-quiet",
80 action="store_true",
81 help="suppress Materialize-specific informational messages",
82 )
83 parser.add_argument(
84 "--find",
85 metavar="DIR",
86 help="use the mzcompose.py file from DIR, rather than the current directory",
87 )
88 parser.add_argument(
89 "--preserve-ports",
90 action="store_true",
91 help="bind container ports to the same host ports rather than choosing random host ports",
92 )
93 parser.add_argument(
94 "--project-name",
95 metavar="PROJECT_NAME",
96 help="Use a different project name than the directory name",
97 )
98 parser.add_argument(
99 "--host-network",
100 action="store_true",
101 help="Override networking to use host networking",
102 )
103 parser.add_argument(
104 "--sanity-restart-mz",
105 action="store_true",
106 # Sanity restarts are rather slow and rarely find a bug, don't run on test pipeline in PRs
107 default=os.getenv("BUILDKITE_PIPELINE_SLUG") != "test"
108 or os.getenv("BUILDKITE_TAG", "") != ""
109 or os.getenv("BUILDKITE_BRANCH") == "main",
110 help="Whether to restart Materialized at the end of test cases and tests, enabled by default on release branches",
111 )
112 parser.add_argument("--ignore-docker-version", action="store_true")
113 mzbuild.Repository.install_arguments(parser)
114
115 # Docker Compose arguments that we explicitly ban. Since we don't support
116 # these, we hide them from the help output.
117 parser.add_argument("-f", "--file", nargs="?", help=argparse.SUPPRESS)

Callers 1

mzcompose.pyFile · 0.70

Calls 15

ArgumentParserClass · 0.85
DescribeCommandClass · 0.85
DescriptionCommandClass · 0.85
DownCommandClass · 0.85
GenShortcutsCommandClass · 0.85
HelpCommandClass · 0.85
RunCommandClass · 0.85
WebCommandClass · 0.85
install_argumentsMethod · 0.80
init_from_envMethod · 0.80

Tested by

no test coverage detected