prefect.deployments
runner
prefect.deployments.runner
Objects for creating and configuring deployments for flows using serve
functionality.
Example:
Classes
DeploymentApplyError
Raised when an error occurs while applying a deployment.
RunnerDeployment
A Prefect RunnerDeployment definition, used for specifying and building deployments.
Methods:
entrypoint_type
full_name
validate_name
validate_automation_names
Ensure that each trigger has a name for its automation if none is provided.
validate_deployment_parameters
Update the parameter schema to mark frozen parameters as readonly.
reconcile_paused
reconcile_schedules
from_flow
Configure a deployment for a given flow.
Args:
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_entrypoint
Configure a deployment for a given flow located at a given entrypoint.
Args:
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_storage
Create a RunnerDeployment from a flow located at a given entrypoint and stored in a local storage location.
Args:
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.