Skip to content

Conversation

@owen-d
Copy link
Member

@owen-d owen-d commented Dec 2, 2024

Block Builder Package Refactoring

This PR restructures the Block Builder package to improve modularity and testability. The changes establish a clear separation of concerns and lay the groundwork for future enhancements.

Please see the new Architecture.md for diagrams & in depth changes.

Key Changes

Package Restructuring

  • Split pkg/blockbuilder into three focused subpackages:
    • types/: Core interfaces and shared data structures
    • scheduler/: Job queue and scheduling logic
    • builder/: Worker implementation and transport layer

Interface Improvements

  • Introduced clear interface boundaries between components:
    • Worker: Job processing and status reporting
    • Scheduler: Job distribution and worker management
    • Transport: Communication layer abstraction

Types

  • Centralized type definitions in types package

Documentation

  • Updated architecture.md with comprehensive package structure
  • Added detailed component diagrams
  • Documented design principles and interactions

Testing

  • Added support for in-memory transport for testing

Followups

  • Integrating the existing builder into the worker interface
  • Introducing grpc as a transport
  • Metrics/o11y for some of the new constructs
  • a scheduler implementation using these
  • service.Service support for said scheduler
@owen-d owen-d requested a review from a team as a code owner December 2, 2024 04:50
@owen-d owen-d changed the title Block scheduler Dec 2, 2024
Copy link
Contributor

@ashwanthgoli ashwanthgoli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@ashwanthgoli ashwanthgoli changed the title feature: Block scheduler scaffolding Dec 2, 2024
@owen-d owen-d merged commit a10140d into grafana:main Dec 2, 2024
58 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2 participants