<@U07PW9ZSR98> this is a quick example around what...
# pacc-jan-28-29-2025
m
@Jonathan Samples this is a quick example around what I was talking about in case your curious, there's some other configurations you can adjust here as well but gives a good jumping off point.
Copy code
from prefect import deploy, Flow

from basic_flow import basic_flow

deployment_args:dict = {
        "version":"test_version",
        "name":"Local_Default_Test",
        "work_pool_name":"docker-test",
        "work_queue_name":"default",
        "entrypoint":f"legacy_prefect/basic_flow.py:basic_flow",
        "image":"masonm2/temprepo:img_code",
        "push":False,
        "build":False,
        "job_variables":{"image":"masonm2/temprepo:img_code", "imagePullPolicy": "Always"},
        "parameters": {"env_name":"test"},
        "tags":[],
        "schedule":None,
    }

def deploy_from_flow(flow_fn: Flow, config: dict):
    """
    Deploy a flow from a file to Prefect Cloud
    """

    runner_dep = flow_fn.to_deployment(
        name = config["name"],
        version = config["version"],
        work_queue_name = config["work_queue_name"],
        job_variables = config["job_variables"],
    )

    runner_dep.entrypoint = config["entrypoint"]

    deploy(
        runner_dep,
        work_pool_name = config["work_pool_name"],
        image = config["image"],
        build = config["build"],
        push = config["push"],
    )

deploy_from_flow(basic_flow, deployment_args)
👍 1
j
Thanks @Mason Menges
m
the entrypoint specified here would be based on the working directory you have set in the dockerfile
No Problem 😄