How phonepe/drove works
Main Components of the System
• Drove Controller: This is the “brain” of the orchestrator. It handles orchestration logic, state management, scheduling, state machine transitions (through the statemachine module), API endpoints (with its UI/resource modules), event logging, and error handling.
• Drove Executor: This module is responsible for actual container execution. It manages tasks via its own state machine, performs healthchecks, gathers resource metrics, and communicates with the controller.
• Authentication Module: The drove-authentication project provides security features like basic auth, JWT token management, and client filtering to secure inter-service communications.
• Client Components: Projects such as drove-client and drove-client-httpcomponent-transport encapsulate the logic for remote communications between components (for example, sending execution requests or receiving state updates).
• Common & Models: The drove-common and drove-models modules serve as the shared libraries for utility logic, communication protocols (messages, events, API responses), and domain models that are exchanged across different system components.
• Discovery/Leader Election: Several discovery modules (drove-hazelcast-discovery and drove-ignite-discovery) are used to support cluster membership, leader election, and state synchronization across cluster nodes.
• Event and Job Execution: The drove-events-client and drove-jobexecutor modules indicate that the system also performs asynchronous event handling and job management, likely integrating with container lifecycle events.
• State Machines: Finally, the drove-statemachine module encapsulates the orchestration process for state transitions in application instances and tasks.
Out the Relationships and Interactions
• Bidirectional communication lines between controller and executor, likely via HTTP-based messaging (using the drove-client libraries) and via dedicated communication components (e.g. RemoteExecutorMessageSender and RemoteControllerMessageSender).
• That both controller and executor use common libraries and models to exchange messages – these should be shown as a central shared component.
• Incorporate the authentication service as a middleware layer that sits in front of API endpoints and inter-service calls.
• Optionally, consider showing the packaging/deployment side (docker files, debian, rpm build directories) as an orthogonal concern that influences how the services are deployed in a production environment.
Architectural Patterns and Technologies
• Modular, microservices-like decomposition: Each subproject is a standalone Maven module, reinforcing the separation of concerns.
• State Machine Patterns: Both the controller and executor use state machine implementations to manage application and task lifecycles.
• Client/Server Communications: REST or HTTP-based communication channels exist between components, assisted by the client transport modules.
• Discovery and Leader Election: The use of Hazelcast and Ignite indicates distributed coordination strategies.
• Packaging & Deployment: The presence of Dockerfile, Podman profiles, debian packaging, and rpmbuild scripts indicate that containerization and OS-level packaging are integral to deployment.
Additional Details
• Document the flow of a container lifecycle – starting from an application submission (via an API in the controller), processing through state transitions, command forwarding to the executor, and event feedback from the executor back to the controller.