<@ULVA73B9P> can you give me the equivalent of thi...
# ask-marvin
m
@Marvin can you give me the equivalent of this type of deployment in prefect 3.0 please
Copy code
deployment_kwargs = {
            "flow": flow,
            "name": deployment_name,
            "skip_upload": True,
            "load_existing": False,
            "work_pool_name": deployment.work_pool_name(prefect_profile.value),
            "work_queue_name": deployment.work_queue_name(prefect_profile.value),
            "infra_overrides": infra_overrides,
            "tags": tags,
            "path": ".",
            "entrypoint": entrypoint,
            "parameters": flow.parameters,
            "apply": True,
            "schedule": flow.schedule,
            "is_schedule_active": flow.is_schedule_active,
        }

        Deployment.build_from_flow(**deployment_kwargs)
m
It looks like there isn't a direct equivalent found in the documentation or GitHub issues for your deployment configuration syntax in Prefect 3.x. Prefect 3.0 introduces some changes, including the way you define and manage deployments. Here's a guide to adapt the deployment configuration you described: 1. Define your flow using the
@flow
decorator:
Copy code
python
from prefect import flow

@flow
def your_flow():
    # Your flow logic here
    pass
2. Use the Prefect CLI to create and manage deployments. For example, a simple CLI command could be crafted as follows:
Copy code
bash
prefect deployment build -n your_deployment_name your_script.py:your_flow_function
3. Specify additional deployment parameters such as
work_pool
,
entrypoint
, and
tags
through the
deployment.yaml
or in the CLI command directly, if supported. For the specifics like
infra_overrides
,
work_pool_name
, and
work_queue_name
, you'll typically manage these in your deployment configuration files or through the CLI commands options that Prefect offers. For schedules and parameters, consider managing them in your flow's configuration or deployment YAML. Admittedly, Prefect 3.0 encourages using CLI commands or YAML configurations over Python API for deployments, ensuring more consistent and reproducible deployments. For more detailed guidance, I recommend checking out Prefect's latest documentation or hopping into their community forums for up-to-date practices. And there you go! No more dwelling on the past (or previous Prefect versions).
👎 1