Skip to content

Commit

Permalink
Further edits to agents docs (#4952)
Browse files Browse the repository at this point in the history
* copy edits

Signed-off-by: nikki everett <[email protected]>

* add anchor link

Signed-off-by: nikki everett <[email protected]>

* add note about contribution

Signed-off-by: nikki everett <[email protected]>

* add deprecated integrations section, update agents links

Signed-off-by: nikki everett <[email protected]>

---------

Signed-off-by: nikki everett <[email protected]>
  • Loading branch information
neverett authored Feb 26, 2024
1 parent d751d0b commit 0c771ef
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 8 deletions.
3 changes: 2 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,8 @@
"source_regex_mapping": REPLACE_PATTERNS,
"list_table_toc": [
"flytesnacks/tutorials",
"flytesnacks/integrations",
"flytesnacks/integrations",
"flytesnacks/deprecated_integrations"
],
"dev_build": bool(int(os.environ.get("MONODOCS_DEV_BUILD", 1))),
}
Expand Down
4 changes: 2 additions & 2 deletions docs/core_use_cases/analytics.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ and [DBT](https://github.com/flyteorg/flytekit/tree/master/plugins/flytekit-dbt)
integrations.
If you need to connect to a database, Flyte provides first-party
support for {ref}`AWS Athena <aws-athena>`, {ref}`Google Bigquery <big-query>`,
{ref}`Snowflake <plugins-snowflake>`, {ref}`SQLAlchemy <sql_alchemy>`, and
support for {ref}`AWS Athena <aws-athena>`, {ref}`Google Bigquery <bigquery_agent>`,
{ref}`Snowflake <snowflake_agent>`, {ref}`SQLAlchemy <sql_alchemy>`, and
{ref}`SQLite3 <integrations_sql_sqlite3>`.
```
2 changes: 1 addition & 1 deletion docs/core_use_cases/data_engineering.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,6 @@ and [DBT](https://github.com/flyteorg/flytekit/tree/master/plugins/flytekit-dbt)
integrations.
For database connectors, Flyte provides first-party support for {ref}`AWS Athena <aws-athena>`,
{ref}`Google Bigquery <big-query>`, {ref}`Snowflake <plugins-snowflake>`,
{ref}`Google BigQuery <bigquery_agent>`, {ref}`Snowflake <snowflake_agent>`,
{ref}`SQLAlchemy <sql_alchemy>`, and {ref}`SQLite3 <integrations_sql_sqlite3>`.
```
12 changes: 12 additions & 0 deletions docs/flyte_agents/developing_agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ The Flyte agent framework enables rapid agent development, since agents are deco

If you need to create a new type of task, we recommend creating a new agent to run it rather than running the task in a pod. After testing the new agent, you can update your FlytePropeller configMap to specify the type of task that the agent should run.

```{note}
We strongly encourage you to contribute your agent to the Flyte community. To do so, follow the steps in "[Contributing to Flyte](https://docs.flyte.org/en/latest/community/contribute.html)", and reach out to us on [Slack](https://docs.flyte.org/en/latest/community/contribute.html#) if you have any questions.
```

There are two types of agents: **async** and **sync**.
* **Async agents** enable long-running jobs that execute on an external platform over time. They communicate with external services that have asynchronous APIs that support `create`, `get`, and `delete` operations. The vast majority of agents are async agents.
* **Sync agents** enable request/response services that return immediate outputs (e.g. calling an internal API to fetch data or communicating with the OpenAI API).
Expand Down Expand Up @@ -83,3 +89,9 @@ AgentRegistry.register(CustomAsyncAgent())
```

For an example implementation, see the [BigQuery agent](https://github.com/flyteorg/flytekit/blob/master/plugins/flytekit-bigquery/flytekitplugins/bigquery/agent.py#L43).

```{note}

To contribute

```
7 changes: 4 additions & 3 deletions docs/flyte_agents/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,18 @@ prev-page-title: Extending Flyte
(flyte_agents_guide)=
# Flyte agents

Flyte agents are long-running, stateless services that receive execution requests via gRPC and initiate jobs with appropriate external or internal services. They enable two key workflows: asynchronously launching jobs on hosted platforms (e.g. Databbricks or Snowflake) and calling external synchronous services, such as access control, data retrieval, and model inferencing.
Flyte agents are long-running, stateless services that receive execution requests via gRPC and initiate jobs with appropriate external or internal services. They enable two key workflows: asynchronously launching jobs on hosted platforms (e.g. Databricks or Snowflake) and calling external synchronous services, such as access control, data retrieval, and model inferencing.

Each agent service is a Kubernetes deployment that receives gRPC requests from FlytePropeller when users trigger a particular type of task (for example, the BigQuery agent handles BigQuery tasks). The agent service then initiates a job with the appropriate service. Since Agents can be spawned in process, they allow for running all services locally as long as the connection secrets are available. Moreover, Agents use a protobuf interface, thus can be implemented in any language, providing a lot of opportunity for flexibility and reuse of existing libraries, as well as simpler testing.
Each agent service is a Kubernetes deployment that receives gRPC requests from FlytePropeller when users trigger a particular type of task (for example, the BigQuery agent handles BigQuery tasks). The agent service then initiates a job with the appropriate service. Since agents can be spawned in process, they allow for running all services locally as long as the connection secrets are available. Moreover, agents use a protobuf interface, thus can be implemented in any language, enabling flexibility, reuse of existing libraries, and simpler testing.

You can create different agent services that host different agents, e.g., a production and a development agent service.
You can create different agent services that host different agents, e.g., a production and a development agent service:

:::{figure} https://i.ibb.co/vXhBDjP/Screen-Shot-2023-05-29-at-2-54-14-PM.png
:alt: Agent Service
:class: with-shadow
:::

(using_agents_in_tasks)=
## Using agents in tasks

If you need to connect to an external service in your workflow, we recommend using the corresponding agent rather than a web API plugin. Agents are designed to be scalable and can handle large workloads efficiently, and decrease load on FlytePropeller, since they run outside of it. You can also test agents locally without having to change the Flyte backend configuration, streamlining development.
Expand Down
2 changes: 1 addition & 1 deletion docs/flyte_fundamentals/optimizing_tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ When this task is executed on a Flyte cluster, it automatically provisions all o
the resources that you need. In this case, that need is distributed
training, but Flyte also provides integrations for {ref}`Spark <plugins-spark-k8s>`,
{ref}`Ray <kube-ray-op>`, {ref}`MPI <kf-mpi-op>`, {ref}`Sagemaker <aws-sagemaker>`,
{ref}`Snowflake <plugins-snowflake>`, and more.
{ref}`Snowflake <snowflake_agent>`, and more.

Even though Flyte itself is a powerful compute engine and orchestrator for
data engineering, machine learning, and analytics, perhaps you have existing
Expand Down
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ Core use cases <core_use_cases/index>
User Guide <user_guide/index>
Tutorials <flytesnacks/tutorials>
Integrations <flytesnacks/integrations>
Deprecated integrations <flytesnacks/deprecated_integrations>
```

```{toctree}
Expand Down

0 comments on commit 0c771ef

Please sign in to comment.