-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Agent Persistence #58
Conversation
services/postgres/alembic/versions/2020-08-18T072234_add_agent_persistence.py
Outdated
Show resolved
Hide resolved
services/postgres/alembic/versions/2020-08-18T072234_add_agent_persistence.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Chris White <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's also replace all instances of models.Agent
with prefect.api.models.Agent
to ensure Cloud compatibility
services/postgres/alembic/versions/2020-08-18T072234_add_agent_persistence.py
Outdated
Show resolved
Hide resolved
services/postgres/alembic/versions/2020-08-18T072234_add_agent_persistence.py
Outdated
Show resolved
Hide resolved
services/postgres/alembic/versions/2020-08-18T072234_add_agent_persistence.py
Outdated
Show resolved
Hide resolved
services/postgres/alembic/versions/2020-08-18T072234_add_agent_persistence.py
Outdated
Show resolved
Hide resolved
services/postgres/alembic/versions/2020-08-18T072234_add_agent_persistence.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Jeremiah Lowin <[email protected]>
@cicdw What do you mean? The |
@joshmeek as an example, if we re-use the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work @joshmeek ! Thanks for your patience through this extended review process
Summary
This draft PR adds the foundation for being able to manage agents in the backend API. The idea here is that users will be able to create an
Agent
and then that agent will have a configuration on it where every time that user wants to use it they can spin up anAgentInstance
with that configuration. Note: agent instances can still be spun up without setting a configuration and they will be persisted. The concept of prefect Agents doesn't really change and this separation of Agent / Instance is more for backend management.Scenario:
prefect agent start --agent-id XXXX
is displayed that can be used to start an instance of that agent any time it is desiredThis is meant to be used in collaboration with the agent_persistence branch in core. UI side to follow soon!
Opening as a draft PR to get comments and feedback on a few questions I have as well as things like the data models.
Changes
Two new tables are added to the DB
agent
which manages the configuration andagent_instance
which manages things like name, labels, core_version, etc. (standard agent configuration kwargs). This also adds a new field to the flow run tableagent_instance
that is updated by the id of an agent instance when the flow run transitions into a submitted state. Some subsequent mutations are also implemented.Open questions:
agent_instance
table tracks alast_query_time
that is updated on every call to retrieve runs. Do we want this?agent
table expose the configuration name as config (current), settings, metadata, etc.agent
table have aname
field? I can see a scenario of wanting to create an agent w/ a name.Importance
Adding the ability to track/manage agents will open the doors to a better experience and provide more detailed information on what is happening across the platform. This also lays the foundation for future agent command patterns because we will be able to direct commands to specific agents/instances.
Checklist
This PR:
changes/
directory (if appropriate)I don't expect tests to pass yet.