prefect.deployments.runner
Objects for creating and configuring deployments for flows using serve
functionality.
Example:
Functions
deploy
build=False
to skip building and pushing
an image.
Args:
*deployments
: A list of deployments to deploy.work_pool_name
: The name of the work pool to use for these deployments. Defaults to the value ofPREFECT_DEFAULT_WORK_POOL_NAME
.image
: The name of the Docker image to build, including the registry and repository. Pass a DockerImage instance to customize the Dockerfile used and build arguments.build
: Whether or not to build a new image for the flow. If False, the provided image will be used as-is and pulled at runtime.push
: Whether or not to skip pushing the built image to a registry.print_next_steps_message
: Whether or not to print a message with next steps after deploying the deployments.
- A list of deployment IDs for the created/updated deployments.
Classes
DeploymentApplyError
Raised when an error occurs while applying a deployment.
RunnerDeployment
A Prefect RunnerDeployment definition, used for specifying and building deployments.
Methods:
afrom_storage
entrypoint
: The path to a file containing a flow and the name of the flow function in the format./path/to/file.py\:flow_func_name
.name
: A name for the deploymentflow_name
: The name of the flow to deploystorage
: A storage object to use for retrieving flow code. If not provided, a URL must be provided.interval
: An interval on which to execute the current flow. Accepts either a number or a timedelta object. If a number is given, it will be interpreted as seconds.cron
: A cron schedule of when to execute runs of this flow.rrule
: An rrule schedule of when to execute runs of this flow.paused
: Whether or not the deployment is paused.schedule
: A schedule object defining when to execute runs of this deployment. Used to provide additional scheduling options liketimezone
orparameters
.schedules
: A list of schedule objects defining when to execute runs of this deployment. Used to provide additional scheduling options liketimezone
orparameters
.triggers
: A list of triggers that should kick of a run of this flow.parameters
: A dictionary of default parameter values to pass to runs of this flow.description
: A description for the created deployment. Defaults to the flow’s description if not provided.tags
: A list of tags to associate with the created deployment for organizational purposes.version
: A version for the created deployment. Defaults to the flow’s version.version_type
: The type of version information to use for the deployment. The version type will be inferred if not provided.enforce_parameter_schema
: Whether or not the Prefect API should enforce the parameter schema for this deployment.work_pool_name
: The name of the work pool to use for this deployment.work_queue_name
: The name of the work queue to use for this deployment’s scheduled runs. If not provided the default work queue for the work pool will be used.job_variables
: Settings used to override the values specified default base job template of the chosen work pool. Refer to the base job template of the chosen work pool for available settings._sla
: (Experimental) SLA configuration for the deployment. May be removed or modified at any time. Currently only supported on Prefect Cloud.
apply
work_pool_name
: The name of the work pool to use for this deployment.image
: The registry, name, and tag of the Docker image to use for this deployment. Only used when the deployment is deployed to a work pool.version_info
: The version information to use for the deployment.
entrypoint_type
from_entrypoint
entrypoint
: The path to a file containing a flow and the name of the flow function in the format./path/to/file.py\:flow_func_name
.name
: A name for the deploymentflow_name
: The name of the flow to deployinterval
: An interval on which to execute the current flow. Accepts either a number or a timedelta object. If a number is given, it will be interpreted as seconds.cron
: A cron schedule of when to execute runs of this flow.rrule
: An rrule schedule of when to execute runs of this flow.paused
: Whether or not to set this deployment as paused.schedules
: A list of schedule objects defining when to execute runs of this deployment. Used to define multiple schedules or additional scheduling options liketimezone
.triggers
: A list of triggers that should kick of a run of this flow.parameters
: A dictionary of default parameter values to pass to runs of this flow.description
: A description for the created deployment. Defaults to the flow’s description if not provided.tags
: A list of tags to associate with the created deployment for organizational purposes.version
: A version for the created deployment. Defaults to the flow’s version.enforce_parameter_schema
: Whether or not the Prefect API should enforce the parameter schema for this deployment.work_pool_name
: The name of the work pool to use for this deployment.work_queue_name
: The name of the work queue to use for this deployment’s scheduled runs. If not provided the default work queue for the work pool will be used.job_variables
: Settings used to override the values specified default base job template of the chosen work pool. Refer to the base job template of the chosen work pool for available settings._sla
: (Experimental) SLA configuration for the deployment. May be removed or modified at any time. Currently only supported on Prefect Cloud.
from_flow
flow
: A flow function to deployname
: A name for the deploymentinterval
: An interval on which to execute the current flow. Accepts either a number or a timedelta object. If a number is given, it will be interpreted as seconds.cron
: A cron schedule of when to execute runs of this flow.rrule
: An rrule schedule of when to execute runs of this flow.paused
: Whether or not to set this deployment as paused.schedule
: A schedule object defining when to execute runs of this deployment. Used to provide additional scheduling options liketimezone
orparameters
.schedules
: A list of schedule objects defining when to execute runs of this deployment. Used to define multiple schedules or additional scheduling options liketimezone
.concurrency_limit
: The maximum number of concurrent runs this deployment will allow.triggers
: A list of triggers that should kick of a run of this flow.parameters
: A dictionary of default parameter values to pass to runs of this flow.description
: A description for the created deployment. Defaults to the flow’s description if not provided.tags
: A list of tags to associate with the created deployment for organizational purposes.version
: A version for the created deployment. Defaults to the flow’s version.version_type
: The type of version information to use for the deployment.enforce_parameter_schema
: Whether or not the Prefect API should enforce the parameter schema for this deployment.work_pool_name
: The name of the work pool to use for this deployment.work_queue_name
: The name of the work queue to use for this deployment’s scheduled runs. If not provided the default work queue for the work pool will be used.job_variables
: Settings used to override the values specified default base job template of the chosen work pool. Refer to the base job template of the chosen work pool for available settings._sla
: (Experimental) SLA configuration for the deployment. May be removed or modified at any time. Currently only supported on Prefect Cloud.
from_storage
entrypoint
: The path to a file containing a flow and the name of the flow function in the format./path/to/file.py\:flow_func_name
.name
: A name for the deploymentflow_name
: The name of the flow to deploystorage
: A storage object to use for retrieving flow code. If not provided, a URL must be provided.interval
: An interval on which to execute the current flow. Accepts either a number or a timedelta object. If a number is given, it will be interpreted as seconds.cron
: A cron schedule of when to execute runs of this flow.rrule
: An rrule schedule of when to execute runs of this flow.paused
: Whether or not the deployment is paused.schedule
: A schedule object defining when to execute runs of this deployment. Used to provide additional scheduling options liketimezone
orparameters
.schedules
: A list of schedule objects defining when to execute runs of this deployment. Used to provide additional scheduling options liketimezone
orparameters
.triggers
: A list of triggers that should kick of a run of this flow.parameters
: A dictionary of default parameter values to pass to runs of this flow.description
: A description for the created deployment. Defaults to the flow’s description if not provided.tags
: A list of tags to associate with the created deployment for organizational purposes.version
: A version for the created deployment. Defaults to the flow’s version.version_type
: The type of version information to use for the deployment. The version type will be inferred if not provided.enforce_parameter_schema
: Whether or not the Prefect API should enforce the parameter schema for this deployment.work_pool_name
: The name of the work pool to use for this deployment.work_queue_name
: The name of the work queue to use for this deployment’s scheduled runs. If not provided the default work queue for the work pool will be used.job_variables
: Settings used to override the values specified default base job template of the chosen work pool. Refer to the base job template of the chosen work pool for available settings._sla
: (Experimental) SLA configuration for the deployment. May be removed or modified at any time. Currently only supported on Prefect Cloud.