Skip to content

Commit

Permalink
fix: use template from Future-Outlier/flyte-custom-agent-template
Browse files Browse the repository at this point in the history
Signed-off-by: mao3267 <[email protected]>
  • Loading branch information
mao3267 committed Jan 11, 2025
1 parent 434c7af commit 2d1fa58
Show file tree
Hide file tree
Showing 16 changed files with 25 additions and 134 deletions.
11 changes: 7 additions & 4 deletions basic-custom-agent/{{cookiecutter.project_name}}/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,17 @@ RUN pip install --no-cache-dir \
# Install Flytekit from GitHub
RUN pip install --no-cache-dir git+https://github.com/flyteorg/flytekit.git@master

# Copy and install the plugin
COPY {{cookiecutter.project_name}} /flytekit-{{cookiecutter.project_name}}
RUN pip install --no-cache-dir /flytekit-{{cookiecutter.project_name}}
# Copy and install the bigquery plugin
COPY flytekit-bigquery /flytekit-bigquery
RUN pip install --no-cache-dir /flytekit-bigquery

COPY flytekit-openai /flytekit-openai
RUN pip install --no-cache-dir /flytekit-openai

# Cleanup
RUN apt-get purge -y build-essential git \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Set the default command
CMD ["pyflyte", "serve", "agent", "--port", "8000"]
CMD ["pyflyte", "serve", "agent", "--port", "8000"]
5 changes: 3 additions & 2 deletions basic-custom-agent/{{cookiecutter.project_name}}/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ docker buildx build --platform linux/amd64 -t localhost:30000/flyteagent:custom-
docker run -it localhost:30000/flyteagent:custom-agent
```

4. Check the logs (sensor is created by flytekit, bigquery is created by the custom agent)
4. Check the logs (sensor is created by flytekit, bigquery and openai is created by the custom agent)
```
(dev) future@outlier ~ % docker run -it localhost:30000/flyteagent:custom-agent
Expand All @@ -34,6 +34,7 @@ Starting up the server to expose the prometheus metrics...
┃ Agent Name ┃ Support Task Types ┃ Is Sync ┃
┡━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━┩
│ Sensor │ sensor (v0) │ False │
│ ChatGPT Agent │ chatgpt (v0) │ True │
│ Bigquery Agent │ bigquery_query_job_task (v0) │ False │
└────────────────┴───────────────────────────────┴─────────┘
```
```
47 changes: 0 additions & 47 deletions basic-custom-agent/{{cookiecutter.project_name}}/docker_build.sh

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Flytekit BigQuery Plugin

BigQuery enables us to build data-intensive applications without operational burden. Flyte backend can be connected with the BigQuery service. Once enabled, it can allow you to query a BigQuery table.

To install the plugin, run the following command:

```bash
pip install flytekitplugins-bigquery
```

To configure BigQuery in the Flyte deployment's backend, follow the [configuration guide](https://docs.flyte.org/en/latest/deployment/plugin_setup/gcp/bigquery.html#deployment-plugin-setup-gcp-bigquery).
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
"""

from .agent import BigQueryAgent
from .task import BigQueryConfig, BigQueryTask
from .task import BigQueryConfig, BigQueryTask
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,4 @@ def delete(self, resource_meta: BigQueryMetadata, **kwargs):
client.cancel_job(resource_meta.job_id, resource_meta.project, resource_meta.location)


AgentRegistry.register(BigQueryAgent())
AgentRegistry.register(BigQueryAgent())
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,4 @@ def get_custom(self, settings: SerializationSettings) -> Dict[str, Any]:

def get_sql(self, settings: SerializationSettings) -> Optional[_task_model.Sql]:
sql = _task_model.Sql(statement=self.query_template, dialect=_task_model.Sql.Dialect.ANSI)
return sql
return sql
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@
"Topic :: Software Development :: Libraries :: Python Modules",
],
entry_points={"flytekit.plugins": [f"{PLUGIN_NAME}=flytekitplugins.{PLUGIN_NAME}"]},
)
)
30 changes: 0 additions & 30 deletions basic-sync-agent/{{cookiecutter.project_name}}/Dockerfile

This file was deleted.

47 changes: 0 additions & 47 deletions basic-sync-agent/{{cookiecutter.project_name}}/docker_build.sh

This file was deleted.

0 comments on commit 2d1fa58

Please sign in to comment.