Documentation
¶
Overview ¶
Package reapi provides remote execution API.
Index ¶
- Variables
- func MetadataFromOutgoingContext(ctx context.Context) (*rpb.RequestMetadata, bool)
- func NewContext(ctx context.Context, rmd *rpb.RequestMetadata) context.Context
- type CacheStore
- func (c CacheStore) GetActionResult(ctx context.Context, d digest.Digest) (*rpb.ActionResult, error)
- func (c CacheStore) GetContent(ctx context.Context, d digest.Digest, fname string) ([]byte, error)
- func (c CacheStore) HasContent(ctx context.Context, d digest.Digest) bool
- func (c CacheStore) SetActionResult(ctx context.Context, d digest.Digest, ar *rpb.ActionResult) error
- func (c CacheStore) SetContent(ctx context.Context, d digest.Digest, fname string, content []byte) error
- func (c CacheStore) Source(_ context.Context, d digest.Digest, fname string) digest.Source
- func (c CacheStore) String() string
- type Client
- func (c *Client) CacheStore() CacheStore
- func (c *Client) Close() error
- func (c *Client) ExecuteAndWait(ctx context.Context, req *rpb.ExecuteRequest, opts ...grpc.CallOption) (string, *rpb.ExecuteResponse, error)
- func (c *Client) FetchTree(ctx context.Context, dirname string, d digest.Digest, ds *digest.Store) (*rpb.Directory, error)
- func (c *Client) FileURI(d digest.Digest) string
- func (c *Client) Get(ctx context.Context, d digest.Digest, name string) ([]byte, error)
- func (c *Client) GetActionResult(ctx context.Context, d digest.Digest) (*rpb.ActionResult, error)
- func (c *Client) IOMetrics() *iometrics.IOMetrics
- func (c *Client) Missing(ctx context.Context, blobs []digest.Digest) ([]digest.Digest, error)
- func (c *Client) Proto(ctx context.Context, d digest.Digest, p proto.Message) error
- func (c *Client) Upload(ctx context.Context, ds *digest.Store, blobs []digest.Digest) (int, error)
- func (c *Client) UploadAll(ctx context.Context, ds *digest.Store) (int, error)
- type Option
Constants ¶
This section is empty.
Variables ¶
var ErrBadPlatformContainerImage = errors.New("reapi: bad platform container image")
ErrBadPlatformContainerImage is an error if the request used bad platform container image.
var ( // FileSemaphore limits concurrent file access to create BatchUpdateBlobgs to protect from runtime thread exhaustion. FileSemaphore = semaphore.New("reapi-cas-file", runtimex.NumCPU()) )
Functions ¶
func MetadataFromOutgoingContext ¶
func MetadataFromOutgoingContext(ctx context.Context) (*rpb.RequestMetadata, bool)
MetadataFromOutgoingContext returns request metadata in outgoing context.
func NewContext ¶
NewContext returns new context with request metadata.
Types ¶
type CacheStore ¶
type CacheStore struct {
// contains filtered or unexported fields
}
CacheStore provides a thin wrapper around REAPI client that gets and uploads blobs and action results.
func (CacheStore) GetActionResult ¶
func (c CacheStore) GetActionResult(ctx context.Context, d digest.Digest) (*rpb.ActionResult, error)
GetActionResult gets action result for the action identified by the digest.
func (CacheStore) GetContent ¶
GetContent gets contents for the fname identified by the digest.
func (CacheStore) HasContent ¶
HasContent returns whether digest is in cache store.
func (CacheStore) SetActionResult ¶
func (c CacheStore) SetActionResult(ctx context.Context, d digest.Digest, ar *rpb.ActionResult) error
SetActionResult sets action result for the action identified by the digest. If a failing action is provided, caching will be skipped.
func (CacheStore) SetContent ¶
func (c CacheStore) SetContent(ctx context.Context, d digest.Digest, fname string, content []byte) error
SetContent sets contents for the fname identified by the digest.
func (CacheStore) String ¶
func (c CacheStore) String() string
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a remote exec API client.
func NewFromConn ¶
NewFromConn creates new remote exec API client from conn.
func (*Client) CacheStore ¶
func (c *Client) CacheStore() CacheStore
CacheStore returns cache store of the client.
func (*Client) ExecuteAndWait ¶
func (c *Client) ExecuteAndWait(ctx context.Context, req *rpb.ExecuteRequest, opts ...grpc.CallOption) (string, *rpb.ExecuteResponse, error)
ExecuteAndWait executes a cmd and waits for the result.
func (*Client) FetchTree ¶
func (c *Client) FetchTree(ctx context.Context, dirname string, d digest.Digest, ds *digest.Store) (*rpb.Directory, error)
FetchTree fetches trees at dirname identified by digest into digest store and returns its root directory.
func (*Client) Get ¶
Get fetches the content of blob from CAS by digest. For small blobs, it uses BatchReadBlobs. For large blobs, it uses Read method of the ByteStream API
func (*Client) GetActionResult ¶
GetActionResult gets the action result by the digest.
type Option ¶
type Option struct { Prefix string Address string Instance string // use compressed blobs if server supports compressed blobs and size is bigger than this. // When 0 is set, blob compression is disabled. CompressedBlob int64 KeepAliveParams keepalive.ClientParameters }
Option contains options of remote exec API.
func (*Option) RegisterFlags ¶
RegisterFlags registers flags on the option.
func (*Option) UpdateProjectID ¶
UpdateProjectID updates the Option for projID and returns cloud project ID to use.
Directories
¶
Path | Synopsis |
---|---|
Package bytestreamio provides io interfaces on bytestream service.
|
Package bytestreamio provides io interfaces on bytestream service. |
Package digest handles content digests of remote executon API.
|
Package digest handles content digests of remote executon API. |
Package merkletree operates on a merkle tree for remote execution API.
|
Package merkletree operates on a merkle tree for remote execution API. |
exporter
Package exporter is an exporter of directory tree from RBE-CAS.
|
Package exporter is an exporter of directory tree from RBE-CAS. |
importer
Package importer is an importer of directory tree into RBE-CAS.
|
Package importer is an importer of directory tree into RBE-CAS. |
Package proto provides protocol buffer message for reapi.
|
Package proto provides protocol buffer message for reapi. |
Package reapitest provides fake implementation of reapi for test.
|
Package reapitest provides fake implementation of reapi for test. |
Package retry provides retrying functionalities.
|
Package retry provides retrying functionalities. |