Skip to content
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

Merged
merged 12 commits into from
Aug 12, 2023
Merged

Async Agent #1712

merged 12 commits into from
Aug 12, 2023

Conversation

pingsutw
Copy link
Member

@pingsutw pingsutw commented Jun 27, 2023

TL;DR

Use async API in the agent service

Type

  • Bug Fix
  • Feature
  • Plugin

Are all requirements met?

  • Code completed
  • Smoke tested
  • Unit tests added
  • Code documentation added
  • Any pending items have an associated Issue

Complete description

^^^

Tracking Issue

NA

Follow-up issue

NA

pingsutw added 4 commits June 21, 2023 23:03
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]>
@pingsutw pingsutw marked this pull request as draft June 27, 2023 18:02
Signed-off-by: Kevin Su <[email protected]>
pingsutw added 3 commits June 28, 2023 22:12
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
@pingsutw pingsutw marked this pull request as ready for review July 5, 2023 11:24
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(
Copy link
Contributor

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)

Copy link
Contributor

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)

Copy link
Member Author

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]>
@pingsutw pingsutw merged commit 19c19ee into master Aug 12, 2023
fg91 pushed a commit that referenced this pull request Aug 15, 2023
Signed-off-by: Kevin Su <[email protected]>
Future-Outlier pushed a commit to Future-Outlier/flytekit that referenced this pull request Oct 3, 2023
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Future Outlier <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants