diff --git a/deployer/README.md b/deployer/README.md index 3bad308c1a..a2483be5e8 100644 --- a/deployer/README.md +++ b/deployer/README.md @@ -91,9 +91,9 @@ It takes a name of a cluster and a name of a hub (or list of names) as arguments │ [default: None] │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ -│ --config-path TEXT File to read secret deployment config from │ -│ [default: shared/deployer/enc-auth-providers-credentials.secret.yaml] │ -│ --dask-gateway-version TEXT Version of dask-gateway to install CRDs for [default: v2022.10.0] │ +│ --dask-gateway-version TEXT Version of dask-gateway to install CRDs for [default: 2023.1.0] │ +│ --debug When present, the `--debug` flag will be passed to the `helm upgrade` command. │ +│ --dry-run When present, the `--dry-run` flag will be passed to the `helm upgrade` command. │ │ --help Show this message and exit. │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ``` diff --git a/deployer/deployer.py b/deployer/deployer.py index fa74095312..9a0fff6d85 100644 --- a/deployer/deployer.py +++ b/deployer/deployer.py @@ -146,6 +146,16 @@ def deploy( dask_gateway_version: str = typer.Option( "2023.1.0", help="Version of dask-gateway to install CRDs for" ), + debug: bool = typer.Option( + False, + "--debug", + help="""When present, the `--debug` flag will be passed to the `helm upgrade` command.""", + ), + dry_run: bool = typer.Option( + False, + "--dry-run", + help="""When present, the `--dry-run` flag will be passed to the `helm upgrade` command.""", + ), ): """ Deploy one or more hubs in a given cluster @@ -163,13 +173,13 @@ def deploy( if hub_name: hub = next((hub for hub in hubs if hub.spec["name"] == hub_name), None) print_colour(f"Deploying hub {hub.spec['name']}...") - hub.deploy(dask_gateway_version) + hub.deploy(dask_gateway_version, debug, dry_run) else: for i, hub in enumerate(hubs): print_colour( f"{i+1} / {len(hubs)}: Deploying hub {hub.spec['name']}..." ) - hub.deploy(dask_gateway_version) + hub.deploy(dask_gateway_version, debug, dry_run) @app.command() diff --git a/deployer/hub.py b/deployer/hub.py index 17b8eb8e6b..6034c7db34 100644 --- a/deployer/hub.py +++ b/deployer/hub.py @@ -142,7 +142,7 @@ def get_generated_config(self): return generated_config - def deploy(self, dask_gateway_version): + def deploy(self, dask_gateway_version, debug, dry_run): """ Deploy this hub """ @@ -204,6 +204,12 @@ def deploy(self, dask_gateway_version): f"--values={generated_values_file.name}", ] + if dry_run: + cmd.append("--dry-run") + + if debug: + cmd.append("--debug") + # Add on the values files for values_file in values_files: cmd.append(f"--values={values_file}")