(argv: list[str])
| 58 | |
| 59 | |
| 60 | def main(argv: list[str]) -> None: |
| 61 | parser = ArgumentParser( |
| 62 | prog="mzcompose", |
| 63 | formatter_class=argparse.RawDescriptionHelpFormatter, |
| 64 | description=""" |
| 65 | mzcompose orchestrates services defined in mzcompose.py. |
| 66 | It wraps Docker Compose to add some Materialize-specific features.""", |
| 67 | epilog=""" |
| 68 | These are only the most common options. There are additional Docker Compose |
| 69 | options that are also supported. Consult `docker compose help` for the full |
| 70 | set. |
| 71 | |
| 72 | For help on a specific command, run `mzcompose COMMAND --help`. |
| 73 | |
| 74 | For 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) |
no test coverage detected