(address: str, name: Optional[str])
| 621 | ), |
| 622 | ) |
| 623 | def config(address: str, name: Optional[str]): |
| 624 | warn_if_agent_address_set() |
| 625 | |
| 626 | serve_details = ServeInstanceDetails( |
| 627 | **ServeSubmissionClient(address).get_serve_details() |
| 628 | ) |
| 629 | applications = serve_details.applications |
| 630 | |
| 631 | # Fetch app configs for all live applications on the cluster |
| 632 | if name is None: |
| 633 | configs = [ |
| 634 | yaml.dump( |
| 635 | app.deployed_app_config.model_dump(exclude_unset=True), |
| 636 | Dumper=ServeDeploySchemaDumper, |
| 637 | sort_keys=False, |
| 638 | ) |
| 639 | for app in applications.values() |
| 640 | if app.deployed_app_config is not None |
| 641 | ] |
| 642 | if configs: |
| 643 | print("\n---\n\n".join(configs), end="") |
| 644 | else: |
| 645 | print("No configuration was found.") |
| 646 | # Fetch a specific app config by name. |
| 647 | else: |
| 648 | app = applications.get(name) |
| 649 | if app is None or app.deployed_app_config is None: |
| 650 | print(f'No config has been deployed for application "{name}".') |
| 651 | else: |
| 652 | config = app.deployed_app_config.model_dump(exclude_unset=True) |
| 653 | print( |
| 654 | yaml.dump(config, Dumper=ServeDeploySchemaDumper, sort_keys=False), |
| 655 | end="", |
| 656 | ) |
| 657 | |
| 658 | |
| 659 | @cli.command( |
nothing calls this directly
no test coverage detected
searching dependent graphs…