siso: add grpc admin service

grpc admin installs channelz
https://grpc.io/blog/a-short-introduction-to-channelz/
so we can investigate connection issue by using grpcdebug
https://github.com/grpc-ecosystem/grpcdebug@latest

e.g.

$ ~/go/bin/grpcdebug $(cat out/siso/.siso_port) channelz channels

Bug: b/539291862
Change-Id: Ifcfcd8eed6eb34d3987b9d69865e793639bad477
Reviewed-on: https://chromium-review.googlesource.com/c/build/+/8165903
Auto-Submit: Fumitoshi Ukai <ukai@google.com>
Reviewed-by: Junji Watanabe <jwata@google.com>
Commit-Queue: Junji Watanabe <jwata@google.com>
diff --git a/siso/build/statusz.go b/siso/build/statusz.go
index b5d4eeb..62412b8 100644
--- a/siso/build/statusz.go
+++ b/siso/build/statusz.go
@@ -12,11 +12,21 @@
 	"net/http"
 	"os"
 	"path/filepath"
+	"strings"
+
+	"google.golang.org/grpc"
+	"google.golang.org/grpc/admin"
 
 	"go.chromium.org/build/siso/o11y/clog"
 )
 
 func NewStatuszServer(ctx context.Context, b *Builder, dir string) error {
+	grpcServer := grpc.NewServer()
+	adminCleanup, err := admin.Register(grpcServer)
+	if err != nil {
+		return err
+	}
+
 	mux := http.NewServeMux()
 
 	mux.Handle("/api/active_steps", http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
@@ -32,8 +42,22 @@
 			clog.Warningf(ctx, "failed to write response: %v", err)
 		}
 	}))
+
+	mainHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+		if r.ProtoMajor == 2 && strings.HasPrefix(r.Header.Get("Content-Type"), "application/grpc") {
+			grpcServer.ServeHTTP(w, r)
+		} else {
+			mux.ServeHTTP(w, r)
+		}
+	})
+
+	var protocols http.Protocols
+	protocols.SetHTTP1(true)
+	protocols.SetUnencryptedHTTP2(true)
+
 	s := &http.Server{
-		Handler: mux,
+		Handler:   mainHandler,
+		Protocols: &protocols,
 	}
 	lc := net.ListenConfig{}
 	listener, err := lc.Listen(ctx, "tcp", "localhost:0")
@@ -46,6 +70,7 @@
 		if err != nil {
 			clog.Warningf(ctx, "listener close error: %v", err)
 		}
+		adminCleanup()
 	}()
 
 	s.Addr = listener.Addr().String()
diff --git a/siso/reapi/proxy.go b/siso/reapi/proxy.go
index 54c8084..06ac789 100644
--- a/siso/reapi/proxy.go
+++ b/siso/reapi/proxy.go
@@ -17,6 +17,7 @@
 	"cloud.google.com/go/longrunning/autogen/longrunningpb"
 	bspb "google.golang.org/genproto/googleapis/bytestream"
 	"google.golang.org/grpc"
+	"google.golang.org/grpc/admin"
 	"google.golang.org/grpc/codes"
 	"google.golang.org/grpc/metadata"
 	"google.golang.org/grpc/status"
@@ -138,6 +139,12 @@
 	bsp := &byteStreamProxy{client: bspb.NewByteStreamClient(p.client.casDataConn)}
 	bspb.RegisterByteStreamServer(server, bsp)
 
+	adminCleanup, err := admin.Register(server)
+	if err != nil {
+		return err
+	}
+	defer adminCleanup()
+
 	errCh := make(chan error, 1)
 	go func() {
 		errCh <- server.Serve(lis)