Deploy a crew using either UUID or project name. Args: uuid (Optional[str]): The UUID of the crew to deploy. skip_validate (bool): Skip pre-deploy validation checks. source (DeploySource): Where the deployment was initiated from. forc
(
self,
uuid: str | None = None,
skip_validate: bool = False,
source: DeploySource = "cli",
force: bool = False,
)
| 430 | return _deployment_identifier(status_response) |
| 431 | |
| 432 | def deploy( |
| 433 | self, |
| 434 | uuid: str | None = None, |
| 435 | skip_validate: bool = False, |
| 436 | source: DeploySource = "cli", |
| 437 | force: bool = False, |
| 438 | ) -> None: |
| 439 | """ |
| 440 | Deploy a crew using either UUID or project name. |
| 441 | |
| 442 | Args: |
| 443 | uuid (Optional[str]): The UUID of the crew to deploy. |
| 444 | skip_validate (bool): Skip pre-deploy validation checks. |
| 445 | source (DeploySource): Where the deployment was initiated from. |
| 446 | force (bool): Redeploy even while a models comparison runs on the |
| 447 | deployment, which stops it (AMP refuses otherwise). |
| 448 | """ |
| 449 | self._force = force |
| 450 | if not _prepare_project_for_deploy(skip_validate): |
| 451 | return |
| 452 | self._telemetry.start_deployment_span(uuid, source=source) |
| 453 | console.print("Starting deployment...", style="bold blue") |
| 454 | repository = self._prepare_git_repository() |
| 455 | remote_repo_url = repository.origin_url() if repository else None |
| 456 | |
| 457 | status = self._deployment_status(uuid, self.project_name) |
| 458 | if status is not None and self._can_deploy_from_amp( |
| 459 | uuid, self.project_name, status |
| 460 | ): |
| 461 | response = self._deploy_from_amp_source( |
| 462 | uuid, self.project_name, repository, status |
| 463 | ) |
| 464 | else: |
| 465 | response = self._deploy_from_local_source( |
| 466 | uuid, self.project_name, repository, remote_repo_url |
| 467 | ) |
| 468 | if response is None: |
| 469 | self._standard_no_param_error_message() |
| 470 | return |
| 471 | |
| 472 | _refuse_on_running_comparison(response) |
| 473 | self._validate_response(response) |
| 474 | self._display_deployment_info(response.json()) |
| 475 | |
| 476 | def _deployment_status( |
| 477 | self, |