Hey! We have an internal Flytekit plugin for Ray t...
# flyte-connectors
d
Hey! We have an internal Flytekit plugin for Ray tasks. The OSS Ray plugin did not satisfy our use cases and did not align with our organization's design. The internal Flytekit plugin uses our SDK to create a Ray Cluster on a separate GKE cluster from the one Flyte is deployed on. It then executes the job on the Ray cluster. And then deletes the Ray cluster once the job is finished. Therefore, all the pod on the Flyte GKE cluster does is manage the Ray cluster lifecycle. We are looking into Flyte Agents and we understand there's a performance gain when compared to the backend plugins, since no pods are created and the Agent can be autoscaled. Does our use case sound like a good candidate to test with Flyte Agents? Is there a reason why the OSS ray plugin is still a backend plugin and not an Agent?
❤️ 1
d
Yes it is a good idea
kevin and I have discussed a little bit about this before too
d
@damp-lion-88352 do you mean you discussed an agent for the Ray backend plugin?
f
@dry-egg-91175 this is a great usecase for agents. perfect fit
🙏 1
d
@dry-egg-91175 Yes
d
Great! I'm still pretty new to agents so I have a question: We manage the cluster lifecycle through our plugin's
pre_execute
,
execute
and
post_execute
methods. How do these methods work with Agent's
create
,
get
, and
delete
? Should we instead (i) create the Ray cluster + run the job, (ii) get the job status, (iii) delete the Ray cluster in the Agent's (i)
create
, (ii)
get
, and (iii)
delete
methods?
d
I will discuss with Kevin and reply to you
Cc @glamorous-carpet-83516
f
Yes create should create and maybe even submit the job. You can submit the job in get too
d
d
Thank you for the example. I believe it will be very useful if there's documentation on how a task's
pre_execute
,
execute
, and
post_execute
methods interact with an agent's
create
,
get
, and
delete
methods. If there's no pod created for tasks run through an agent, where are the
pre_execute
,
execute
,
post_execute
methods invoked? what's the sequence of invocation? Is there a recommended design pattern on dividing responsibilities between the task's methods and the agent's methods?
d
Will draw a diagram for you tomorrow
d
Thank you so much!
@damp-lion-88352 just checking up to see if there's any work planned around it yet - we can also assist you if needed
❤️ 1
d
There's only
execute
will be invoked if there's no pod created for tasks run through an agent
Here is the agent server's entrypoint
it will call the function here
image.png
This is the diagram
I don't think
pre execute
and
post execute
will be called
It'll not be called in agent server (remote execution), but in local execution.