s

    Sumant Agnihotri

    4 months ago
    Hi all, Im learning the basics of Prefect and have a quick question. When I write this and register my flow to the cloud:
    with Flow("flow-a") as flow_a:
            a()
            b()
        flow = Flow("flow-a-b", tasks=[a, b])
        flow.register(project_name="tester")
    Is the code written in function
    a
    and
    b
    saved on the cloud, or does the cloud refers to my system every time it needs to run the flow on an agent? If it does refer to my system, will it make a difference if the agent is running on a different system?
    Kevin Kho

    Kevin Kho

    4 months ago
    We don’t see your code and data because of the hybrid model. Prefect doesn’t host any compute so all of the compute happens in your infrastructure
    Anna Geller

    Anna Geller

    4 months ago
    During the registration, you send metadata to Prefect Cloud - Prefect doesn't store your code or data, only metadata that points to the storage location telling where your flow code is stored.
    will it make a difference if the agent is running on a different system?
    it's the same for all agents lastly, you may actually move the register part into main:
    with Flow("flow-a") as flow:
        task_a = a()
        b(upstream_tasks=[task_a])
    
    if __name__ == "__main__":
        flow.register(project_name="tester")