Back to godoc.org

Package exec

v0.0.15
Latest Go to latest

The latest major version is .

Published: Jul 31, 2020 | License: BSD-3-Clause | Module: go.chromium.org/goma/server

Overview

Package exec provides goma exec service implementation.

Index

Constants

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.

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

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(),
		},
	}
)
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: `counts toolchain selection. result is "used", "found", "requested" or "missed"`,
			TagKeys: []tag.Key{
				selectorKey,
				resultKey,
			},
			Measure:     toolchainSelects,
			Aggregation: view.Count(),
		},
	}
)

func RecordAPIError

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

RecordAPIError records api-error in resp.

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

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier