From b263e43f23a680da78e0ca2ef4e6be7e2d6d3e21 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 23 Sep 2025 08:45:46 -0500 Subject: [PATCH 1/2] Cleanup-cli --- .../orchestration/drivers_orchestration.py | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/.evergreen/orchestration/drivers_orchestration.py b/.evergreen/orchestration/drivers_orchestration.py index 6e3e67fc..8ee71a96 100644 --- a/.evergreen/orchestration/drivers_orchestration.py +++ b/.evergreen/orchestration/drivers_orchestration.py @@ -149,15 +149,21 @@ def get_options(): "--tls-cert-key-file", help="A .pem to be used as the tlsCertificateKeyFile option in mongo-orchestration", ) + other_group.add_argument( + "--custom-orch-file", + help="The path to a custom orchestration config file", + ) - # Get the options, and then allow environment variable overrides. + # Get the options, and then allow environment variables to override defaults. opts = parser.parse_args(sys.argv[2:]) for key in vars(opts).keys(): env_var = key.upper() if env_var == "VERSION": env_var = "MONGODB_VERSION" if env_var in os.environ: - if env_var == "AUTH": + if parser.get_default(key) != getattr(opts, key): + LOGGER.info("Overriding env var '%s' with cli option", env_var) + elif env_var == "AUTH": opts.auth = os.environ.get("AUTH") == "auth" elif env_var == "SSL": ssl_opt = os.environ.get("SSL", "") @@ -538,7 +544,6 @@ def clean_start(opts): for fname in [ "out.log", "server.log", - "orchestration.config", "config.json", "server.pid", ]: @@ -559,10 +564,13 @@ def start(opts): # Set up the mongo orchestration config. os.makedirs(mo_home / "lib", exist_ok=True) - mo_config = mo_home / "orchestration.config" - mdb_binaries = Path(opts.mongodb_binaries) - config = dict(releases=dict(default=normalize_path(mdb_binaries))) - mo_config.write_text(json.dumps(config, indent=2)) + if opts.custom_orch_file: + mo_config = Path(opts.custom_orch_file) + else: + mo_config = mo_home / "orchestration.config" + mdb_binaries = Path(opts.mongodb_binaries) + config = dict(releases=dict(default=normalize_path(mdb_binaries))) + mo_config.write_text(json.dumps(config, indent=2)) mo_config_str = normalize_path(mo_config) sys_executable = normalize_path(sys.executable) command = f"{sys_executable} -m mongo_orchestration.server" From a8434b8941254ee2d1da2b31c0d603c2e87d6047 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Tue, 23 Sep 2025 08:47:55 -0500 Subject: [PATCH 2/2] update name --- .evergreen/orchestration/drivers_orchestration.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.evergreen/orchestration/drivers_orchestration.py b/.evergreen/orchestration/drivers_orchestration.py index 8ee71a96..3a84ddd4 100644 --- a/.evergreen/orchestration/drivers_orchestration.py +++ b/.evergreen/orchestration/drivers_orchestration.py @@ -150,8 +150,8 @@ def get_options(): help="A .pem to be used as the tlsCertificateKeyFile option in mongo-orchestration", ) other_group.add_argument( - "--custom-orch-file", - help="The path to a custom orchestration config file", + "--custom-mo-config", + help="The path to a custom mongo orchestration config file", ) # Get the options, and then allow environment variables to override defaults. @@ -564,8 +564,8 @@ def start(opts): # Set up the mongo orchestration config. os.makedirs(mo_home / "lib", exist_ok=True) - if opts.custom_orch_file: - mo_config = Path(opts.custom_orch_file) + if opts.custom_mo_config: + mo_config = Path(opts.custom_mo_config) else: mo_config = mo_home / "orchestration.config" mdb_binaries = Path(opts.mongodb_binaries)