How to write your custom agent and build it with a Dockerfile.
- flytekit will load plugin here,
so you must add your plugin to
entry_points
in setup.py. - Agent registration is triggered by loading the plugin. For example, BigQuery's agent registration is triggered here
- Following the folder structure in this repo, you can build your custom agent.
- Build your own custom agent (learn more)
In the following command,
localhost:30000
is the Docker registry that ships with the Flyte demo cluster. Use it or replace it with a registry where you have push permissions.
docker buildx build --platform linux/amd64 -t localhost:30000/flyteagent:custom-agent -f Dockerfile .
- Test the image:
docker run -it localhost:30000/flyteagent:custom-agent
- 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
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
🚀 Starting the agent service...
Starting up the server to expose the prometheus metrics...
Agent Metadata
┏━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┓
┃ Agent Name ┃ Support Task Types ┃ Is Sync ┃
┡━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━┩
│ Sensor │ sensor (v0) │ False │
│ ChatGPT Agent │ chatgpt (v0) │ True │
│ Bigquery Agent │ bigquery_query_job_task (v0) │ False │
└────────────────┴───────────────────────────────┴─────────┘