flytekit icon indicating copy to clipboard operation
flytekit copied to clipboard

Log Agents In The Agent Server

Open Future-Outlier opened this issue 1 year ago • 1 comments

Tracking issue

https://github.com/flyteorg/flyte/issues/3936

Why are the changes needed?

Let users can observe available agents in the agent pod.

What changes were proposed in this pull request?

add a function print_agents_metadata

def print_agents_metadata():
    from flytekit.extend.backend.base_agent import AgentRegistry

    agents = AgentRegistry.list_agents()
    for agent in agents:
        name = agent.name
        task_type = "sync" if agent.is_sync else "async"
        for task_category in agent.supported_task_categories:
            click.secho(
                f"Starting {name} supports {task_type} task {task_category.name} with version {task_category.version}",
                fg="blue",
            )

How was this patch tested?

  1. Use the pyflyte serve agent command to print output to the terminal.
  2. unit tests

Setup process

pyflyte serve agent

Screenshots

image

Check all the applicable boxes

  • [x] I updated the documentation accordingly.
  • [x] All new and existing tests passed.
  • [x] All commits are signed-off.

Future-Outlier avatar Mar 29 '24 07:03 Future-Outlier

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 75.95%. Comparing base (8ab9a3c) to head (b1150ed). Report is 27 commits behind head on master.

:exclamation: Current head b1150ed differs from pull request most recent head 9fb8af8. Consider uploading reports for the commit 9fb8af8 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2309      +/-   ##
==========================================
- Coverage   83.48%   75.95%   -7.54%     
==========================================
  Files         324      180     -144     
  Lines       24720    18134    -6586     
  Branches     3517     3547      +30     
==========================================
- Hits        20637    13773    -6864     
- Misses       3451     3763     +312     
+ Partials      632      598      -34     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Mar 29 '24 07:03 codecov[bot]

@pingsutw Thank you so much for doing this on your weekend. Thank you.

image

Future-Outlier avatar Apr 07 '24 11:04 Future-Outlier