Skip to main content
Deploys the app to Anaconda Platform. This method packages and deploys the configured app, waiting for it to reach the specified readiness condition before returning. Parameters:
string
default:"at_least_one_running"
The condition that must be met for the deployment to be considered ready.Deployment readiness conditions define what counts as a successful completion of the current deployment instance. They exist because deployments often run from CI/CD environments, where downstream build triggers depend on a specific completion criterion, and because different users need different guarantees: some want a cluster of workers ready before serving traffic, while others want just one worker ready.Available readiness conditions:
  • at_least_one_running: At least min(min_replicas, 1) workers of the current deployment instance’s version have started running. Use when endpoints are deployed ephemerally and are considered ready when at least one instance is running; additional instances are for load management.
  • all_running: At least min_replicas workers are running for the deployment to be considered ready. Use when inference endpoints are under an SLA or need to handle a larger load.
  • fully_finished: At least min_replicas workers are running, and no pending or crashlooping workers from previous versions remain. Use to ensure the endpoint is fully available and no other versions are running, or that the endpoint has been fully scaled down.
  • async: The deployment is considered ready as soon as the server acknowledges it has registered the app in the backend. Use when you only care that the URL is minted, or when the deployment should eventually scale to zero.
integer
default:"600"
Maximum time in seconds to wait for the deployment to reach readiness.
integer
default:"60"
Once the deployment meets readiness_condition, workers are monitored for an additional readiness_wait_time seconds to catch crash loops that surface shortly after startup. If a worker enters a crash loop during this window, the deploy fails with AppCrashLoopException. Increase this value for apps with slow startups or when infrastructure is not quickly available.
function
Function to use for logging progress messages. Default prints to stderr.
Returns:
DeployedApp
An object representing the deployed app with methods to interact with it (logs, info, scale_to_zero, delete) and properties like public_url.
Raises:
  • CodePackagingException: If code_package is not provided or is not a valid PackagedCode instance.
  • AppConfigError: If the app configuration is invalid.
  • AppCreationFailedException: If the app deployment submission fails due to an API error. Contains status_code and error_text attributes for debugging.
  • AppCrashLoopException: If a worker enters a CrashLoopBackOff or Failed state during deployment. Contains worker_id and logs attributes for debugging.
  • AppReadinessException: If the app fails to meet readiness conditions within max_wait_time.
  • AppUpgradeInProgressException: If an upgrade is already in progress when deployment starts. Use force_upgrade=True to override. Contains the upgrader attribute.
  • AppConcurrentUpgradeException: If another deployment was triggered while this deployment was in progress, invalidating the current deployment. Contains expected_version and actual_version.
  • OuterboundsBackendUnhealthyException: If the platform backend is unreachable (network issues, DNS failures) or returns server errors (HTTP 5xx). This indicates a platform-side issue, not a problem with your configuration. Retry the deployment or contact Anaconda support.
  • AppDeletedDuringDeploymentException: If the app was deleted by another process or user while this deployment was in progress. This can occur when concurrent operations conflict.
Examples: Basic deployment:
Wait for all replicas to be ready:
Async deployment (don’t wait for workers):
Handling deployment errors: