Hey how are we supposed to deploy cf flows? wrappe...
# marvin-ai
c
Hey how are we supposed to deploy cf flows? wrapped in a prefect flow? I'm yet to figure a deployment strategy as in the interaction between the two kinds
prefect deploy
will only show
prefect.flow
decorated functions, but not `cf.flow`; I have to manually input the entrypoint for cf flows to be recognised
t
interesting question as i was looking for an answer for the same
c
@Nate
n
im not sure if @Jeremiah intends cf.flow objects to be valid prefect deployment entrypoints my suggestion would be to do like
Copy code
@cf.flow
def do_agent_stuff(): ...

@flow
def compose_cf_stuff():
   # do normal python or call cf.flow code
   do_agent_stuff()

if __name__ == "__main__":
   compose_cf_stuff.from_source(...).deploy(...)
   # or instead `prefect deploy this/file.py:compose_cf_stuff`
prefect rocket 1
α
Currently struggling with this as well. Trying to deploy a @cf.flow() , but I get
Copy code
/opt/anaconda3/envs/cf_magnify/lib/python3.12/site-packages/prefect/utilities/importtools.py:511: RuntimeWarning: coroutine 'sync_compatible.<locals>.coroutine_wrapper.<locals>.ctx_call' was never awaited
  logger.debug("Failed to compile: %s", e)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
/opt/anaconda3/envs/cf_magnify/lib/python3.12/site-packages/prefect/flows.py:1742: RuntimeWarning: coroutine 'sync_compatible.<locals>.coroutine_wrapper.<locals>.ctx_call' was never awaited
  if flow is None:
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
/opt/anaconda3/envs/cf_magnify/lib/python3.12/site-packages/prefect/utilities/importtools.py:511: RuntimeWarning: coroutine 'sync_compatible.<locals>.coroutine_wrapper.<locals>.ctx_call' was never awaited
  logger.debug("Failed to compile: %s", e)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
/opt/anaconda3/envs/cf_magnify/lib/python3.12/site-packages/prefect/flows.py:1742: RuntimeWarning: coroutine 'sync_compatible.<locals>.coroutine_wrapper.<locals>.ctx_call' was never awaited
  if flow is None:
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
Despite that, miraculously, the flow gets deployed (@Nate even though it's a @cf.flow ), then I when I run the deployed flow, I get the ever frustrating:
Copy code
Flow run infrastructure exited with non-zero status code:
 Exited with non 0 code. (Error Code: 1)
My patience is getting tested every time I see this, as I'm honestly left without any information about how to solve my problems. This may be caused by attempting to run an image with a misspecified platform or architecture.The same flow runs locally, as well as inside my local Docker container.