Adithya Ramanathan
11/17/2020, 3:07 PM.prefect
file in storage when submitting a flow to the server, versus the serialized variant of a flow that is used to register with the GraphQL API?
To motivate the reasoning, we have a need to directly invoke the GraphQL API, and are therefore manually serializing flows ourselves. As per our current understanding, we also need to build the .prefect
file in storage and make sure that is referenced in the serialization, but given the fact that the tasks
are captured in the serialized flow anyway, we were curious as to what the .prefect
file is used for, what other information is captured there? Mainly trying to understand why, rather than perhaps build a work around of any kind.
Thanks in advance!josh
11/17/2020, 3:18 PM.prefect
file is a flow that is pickled using cloudpickle. Essentially it is bytecode returned from cloudpickle.dump
. Take a look at the flow’s save function that does this.
Also worth pointing out that if you’re calling the GraphQL API directly to invoke flow registration and performing serialization yourself there’s a possibility that you may be able to benefit from storing your flow as a script instead of a pickle https://docs.prefect.io/core/idioms/file-based.html 🙂Adithya Ramanathan
11/17/2020, 3:21 PMprefect
both serialize and `cloudpickle.dump`/store as a python script? Why doesn’t the agent get/use the serialization itself to execute the flow?josh
11/17/2020, 3:28 PMAdithya Ramanathan
11/17/2020, 3:59 PMjosh
11/17/2020, 4:12 PMAdithya Ramanathan
11/17/2020, 4:12 PMjosh
11/17/2020, 4:16 PMAdithya Ramanathan
11/17/2020, 4:17 PM