exec

package
v0.0.26 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2022 License: BSD-3-Clause Imports: 23 Imported by: 0

Documentation

Overview

Package exec provides goma exec service implementation.

Index

Constants

View Source
const DefaultMaxReqMsgSize = 64 * 1024 * 1024

DefaultMaxReqMsgSize is max request message size for exec serivce. exec server may recieve (exec client may send) > 45MB if there are many embedded content. request from gce staging bot, 45MB is used. 64MB might not be sufficient enough. grpc's default is 4MB.

View Source
const DefaultMaxRespMsgSize = 6 * 1024 * 1024

DefaultMaxRespMsgSize is max response size of exec service. exec server may send (exec client may receive) > 4MB. e.g. 2 outputs may close to 2MB (*.o, *.dwo) + other outputs (*.o.d, stdout, stderr). http://b/79554706 grpc's default is 4MB.

Variables

View Source
var (

	// DefaultToolchainViews are the default views provided by this package.
	// You need to register the view for data to actually be collected.
	DefaultToolchainViews = []*view.View{
		{
			Description: `counts toolchain selection. result is "used", "found", "requested" or "missed"`,
			TagKeys: []tag.Key{
				selectorKey,
				resultKey,
			},
			Measure:     toolchainSelects,
			Aggregation: view.Count(),
		},
	}
)
View Source
var (

	// DefaultViews are the default views provided by this package.
	// You need to register the view for data to actually be collected.
	DefaultViews = []*view.View{
		{
			Description: "exec request api-error",
			TagKeys: []tag.Key{
				apiErrorKey,
			},
			Measure:     apiErrors,
			Aggregation: view.Count(),
		},
		{
			Description: "exec request client retry",
			TagKeys: []tag.Key{
				clientRetryKey,
			},
			Measure:     clientRetries,
			Aggregation: view.Count(),
		},
		{
			Description: `counts toolchain selection. result is "used", "found", "requested" or "missed"`,
			TagKeys: []tag.Key{
				selectorKey,
				resultKey,
			},
			Measure:     toolchainSelects,
			Aggregation: view.Count(),
		},
	}
)

Functions

func RecordAPIError

func RecordAPIError(ctx context.Context, resp *gomapb.ExecResp) error

RecordAPIError records api-error in resp.

func RecordRequesterInfo added in v0.0.17

func RecordRequesterInfo(ctx context.Context, reqInfo *gomapb.RequesterInfo) error

RecordRequesterInfo records requester info. e.g. client retry count.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a client to access exec service via gRPC.

func NewClient

func NewClient(address string, opts ...grpc.DialOption) Client

NewClient creates new client to access exec service serving on address.

func (Client) Exec

func (c Client) Exec(ctx context.Context, in *gomapb.ExecReq, opts ...grpc.CallOption) (*gomapb.ExecResp, error)

Exec handles goma Exec requests.

type Inventory

type Inventory struct {
	// contains filtered or unexported fields
}

Inventory holds available command configs.

func (*Inventory) Configure

func (in *Inventory) Configure(ctx context.Context, cfgs *cmdpb.ConfigResp) error

Configure sets config in the inventory.

func (*Inventory) Pick

func (in *Inventory) Pick(ctx context.Context, req *gomapb.ExecReq, resp *gomapb.ExecResp) (*cmdpb.Config, []*cmdpb.FileSpec, error)

Pick picks command and subprograms requested in req, and returns config, selector and commands' FileSpec. It also update resp.Result about compiler selection.

func (*Inventory) ServeHTTP

func (in *Inventory) ServeHTTP(w http.ResponseWriter, req *http.Request)

func (*Inventory) VersionID

func (in *Inventory) VersionID() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL