moby / moby/buildkit

Logging mechanism for frontends

Open
#644 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
10.3k
Forks
1.5k
Avg merge
1d 21h
Merged PRs (30d)
50

Description

Currently any logging done by a frontend to its stdio goes to the daemon logs (for builtin and, I think, server side gateway based frontends) or to the client stdio (client side gateway frontends) where it corrupts the tty based logging.

Shall we consider adding a Log method of some sort to the gRPC provided to the frontend? So in frontend/gateway/pb/gateway.proto add:

 service LLBBridge {
         // apicaps:CapResolveImage
         rpc ResolveImageConfig(ResolveImageConfigRequest) returns (ResolveImageConfigResponse);
         // apicaps:CapSolveBase
         rpc Solve(SolveRequest) returns (SolveResponse);
         // apicaps:CapReadFile
         rpc ReadFile(ReadFileRequest) returns (ReadFileResponse);
         // apicaps:CapReadDir
         rpc ReadDir(ReadDirRequest) returns (ReadDirResponse);
         rpc Ping(PingRequest) returns (PongResponse);
         rpc Return(ReturnRequest) returns (ReturnResponse);
+        rpc Log(LogRequest) returns (google.protobuf.Empty);
 }

+message LogRequest {
+       string message = 1;
+       «enum|int|tbd» level = 2;
+       map<string, string> metadata = 3;
+} 

and then figure out a way to integrate that stream with controlapi.StatusResponse (and to display it)?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with frontend/gateway/pb/gateway.proto and inspect controlapi.StatusResponse to understand the existing frontend gateway and status paths. Determine how a frontend log request could be integrated and displayed without corrupting daemon or client tty logs. Done means frontend logging has a defined transport and appears through the intended status output.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, grpc
Domain
backend-api-design, observability
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.