bazelbuild / remote-apis

An API for caching and execution of actions on a remote system.
Apache License 2.0
333 stars 118 forks source link

Standardize Build Event Protocol #318

Open sluongng opened 4 hours ago

sluongng commented 4 hours ago

Today, among different matured build tool solutions there exists several build event protocols that enable build telemetry use cases:

On top of these, many build tools and CI systems in the wild have started adopting a more generic telemetry system (Open Telemetry, Prometheus) for their CI/CD telemetry needs:

So I want to start a discussion about a standardized Build Event Protocol so that different client and server implementations can agree on a common specification moving forward, and reduce overall fragmentation.

Please comment below if you are interested in adopting such a spec.

EdSchouten commented 4 hours ago

Just to clarify: are we talking about build_event_stream.proto a.k.a. Build Event Protocol, or publish_build_event.proto a.k.a. Build Event Service?

Standardizing the latter (BES) might make sense. The former (BEP), I'm not convinced that's a good idea. The reason being that it exposes information in a schema that corresponds to Bazel's data model. For example, is it realistic to assume that Pants, Buck2, etc. etc. etc. all have the equivalent of a "ConvenienceSymlinksIdentified" event? I don't think so.

sluongng commented 4 hours ago

Agree. I don't think we want to make Bazel-specific events a standardized spec.

I think a good starting point would be a new event protocol that meets all the common needs of existing tools:

  1. Creating an invocation with an ID
  2. Command line, workspace information
  3. Timing data
  4. ???

And leave an Any field for different tools to implement domain-specific events. Overtime, we can identify common needs between tools (i.e. more than 2 tools interested in the same thing) to add more event types to the spec.

sluongng commented 4 hours ago

cc: @philwo @aherrmann @bergsieker who might be interested in this topic.

EdSchouten commented 4 hours ago

My concern is that if we attempt to standardize anything that is in excess of the Build Event Service, it would severely suffer from an inner-platform effect.