-
Notifications
You must be signed in to change notification settings - Fork 311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Async Agent #1712
Async Agent #1712
Conversation
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
try: | ||
tmp = TaskTemplate.from_flyte_idl(request.template) | ||
inputs = LiteralMap.from_flyte_idl(request.inputs) if request.inputs else None | ||
agent = AgentRegistry.get_agent(context, tmp.type) | ||
if agent is None: | ||
return CreateTaskResponse() | ||
return agent.create(context=context, inputs=inputs, output_prefix=request.output_prefix, task_template=tmp) | ||
if agent.asynchronous: | ||
return await agent.async_create( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets put a
log.debug()
try:
agent.async
except Exception:
log.error
raise
log.debug(done)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the idea is we want to log and know what went wrong in production. Think about how will you make it easier to debug in production and manage in production. Also we should think about adding prometheus metrics or open telemetry (separate PR is ok)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]> Signed-off-by: Future Outlier <[email protected]>
TL;DR
Use async API in the agent service
Type
Are all requirements met?
Complete description
^^^
Tracking Issue
NA
Follow-up issue
NA