Skip to main content

restart_deployment

Restart a running deployment to ensure its initialization code (e.g. imports and code outside the inference function) are re-executed.

Parameters

mb.restart_deployment(deployment_name=, ...)
  • deployment_name: str The name of the deployment.
  • version: Optional[str,'latest'] The version to restart. The version can be the integer version of the deployment, or latest. If no version is specified then latest is used.
  • branch: Optional[str] The branch of the deployment and version. If not specified then the current branch is used. By default that is main.

Returns

No value is returned. A success status message is printed if the command is successful.

Examples

Restart the latest version of a deployment

To restart running instances of example_deployment:

mb.restart_deployment("example_deployment")

Restart a specific version and branch of a deployment

To restart only some versions of a running deployment, specify version= and branch=:

mb.restart_deployment("example_deployment", version=5, branch="dev")

See also