-
Notifications
You must be signed in to change notification settings - Fork 669
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Future-Outlier <[email protected]>
- Loading branch information
1 parent
bb82cce
commit 97cebbc
Showing
2 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--- | ||
jupytext: | ||
formats: md:myst | ||
text_representation: | ||
extension: .md | ||
format_name: myst | ||
--- | ||
|
||
(implementing_agent_metadata_service)= | ||
# Implementing Agent Metadata Service | ||
|
||
## Why we need Agent Metadata Service? | ||
Before FlytePropeller sends a request to the agent server, it needs to know 4 things: | ||
|
||
1. What is the name of the agent? | ||
2. Which task category does the agent support? | ||
3. What version is the task category? | ||
4. Does the agent execute tasks synchronously or asynchronously? | ||
|
||
:::{note} | ||
1. An agent can support multiple task categories. | ||
2. We will use the combination of [task category][version] to identify the specific agent's deployment and know whether the task is synchronous or asynchronous in FlytePropeller. | ||
3. Task category is `task_type` in flytekit. | ||
::: | ||
|
||
Let's take BigQuery Agent as an example, it's name is `BigQuery Agent`, it supports `bigquery_query_job_task`, it's version is `0` by default, it executes task `asynchronously`. | ||
|
||
After FlytePropeller gets these metadata, it can send a request to the agent deployment using the correct gRPC method. | ||
|
||
|
||
## How to implement Agent Metadata Service? | ||
We need to do 2 things. | ||
|
||
1. Implement Agent Metadata Service. | ||
2. Add Agent Metadata Service to Agent Server. | ||
|
||
You can refer to [base_agent.py](https://github.com/flyteorg/flytekit/blob/master/flytekit/extend/backend/base_agent.py), [agent_service.py](https://github.com/flyteorg/flytekit/blob/master/flytekit/extend/backend/agent_service.py), and [serve.py](https://github.com/flyteorg/flytekit/blob/master/flytekit/clis/sdk_in_container/serve.py) to see how we implement Agent Metadata Service in flytekit's Agent Server. | ||
|
||
Those gRPC methods are generated by [flyteidl](https://github.com/flyteorg/flyte/blob/master/flyteidl/protos/flyteidl/service/agent.proto) and you can import them from [here](https://github.com/flyteorg/flyte/tree/master/flyteidl/gen). | ||
|
||
:::{note} | ||
You can search the keyword `metadata` to find implementations in those files. | ||
::: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters