Deploy Doctor

Preflight readiness checks for deployments with run_all_checks

Doctor confirms that Python, ports, agents.yaml, and the host CLIs (docker, aws, az, gcloud) are ready before you deploy.

python
from praisonai_deploy import run_all_checks

report = run_all_checks("agents.yaml")
print(report.all_passed)
Diagram

doctor

Python

Port

agents.yaml

Docker

Cloud CLIs

Quick Start

  1. Run every check
    bash
    praisonai deploy doctor --all
  2. From Python
    python
    from praisonai_deploy import run_all_checks
    
    report = run_all_checks("agents.yaml")
    for check in report.checks:
        print(check.name, check.passed)

What It Checks

run_all_checks runs local, Docker, and cloud-provider checks.

CheckPasses when
Python VersionPython 3.9 or higher
PortThe configured port is free
agents.yamlA valid deploy: section is present
Dockerdocker --version succeeds
AWS CLIaws sts get-caller-identity succeeds
Azure CLIaz account show succeeds and, when a subscription_id is configured, the ambient subscription matches it. A mismatch fails the check with fix_suggestion: "az account set --subscription <configured id>".
GCP CLIgcloud config get-value project returns a project

Each failing check includes a fix_suggestion telling you how to resolve it.


DoctorReport

run_all_checks returns a DoctorReport.

PropertyTypeDescription
checksList[DoctorCheckResult]Individual check results
total_checksintNumber of checks run
passed_checksintNumber that passed
failed_checksintNumber that failed
all_passedboolWhether every check passed

Each DoctorCheckResult has name, passed, message, and an optional fix_suggestion.


Common Patterns

Gate a deploy on readiness.

python
from praisonai_deploy import Deploy, run_all_checks

report = run_all_checks("agents.yaml")
if report.all_passed:
    Deploy.from_yaml("agents.yaml").deploy()
else:
    for check in report.checks:
        if not check.passed:
            print(check.name, "->", check.fix_suggestion)

Best Practices

Run doctor in CI before deploy

A failing doctor check stops a broken deploy before it starts, saving a slow round-trip to a cloud provider.

Read the fix_suggestion

Every failed check tells you exactly what to run — aws configure, az login, gcloud init, or install a missing CLI.


Related