tool

package
v0.0.0-...-ebb4f00 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package tool provides implementation of the debugging related operations supported by go/cmd/remotetool package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	GrpcClient *rc.Client
}

Client is a remote execution client.

func (*Client) CheckDeterminism

func (c *Client) CheckDeterminism(ctx context.Context, actionDigest, actionRoot string, attempts int) error

CheckDeterminism executes the action the given number of times and compares output digests, reporting failure if a mismatch is detected.

func (*Client) DownloadAction

func (c *Client) DownloadAction(ctx context.Context, actionDigest, outputPath string, overwrite bool) error

DownloadAction parses and downloads an action to the given directory. The output directory will have the following:

  1. ac.textproto: the action proto file in text format.
  2. cmd.textproto: the command proto file in text format.
  3. input/: the input tree root directory with all files under it.
  4. input_node_properties.txtproto: all the NodeProperties defined on the input tree, as an InputSpec proto file in text format. Will be omitted if no NodeProperties are defined.

func (*Client) DownloadActionResult

func (c *Client) DownloadActionResult(ctx context.Context, actionDigest, pathPrefix string) error

DownloadActionResult downloads the action result of the given action digest if it exists in the remote cache.

func (*Client) DownloadBlob

func (c *Client) DownloadBlob(ctx context.Context, blobDigest, path string) (string, error)

DownloadBlob downloads a blob from the remote cache into the specified path. If the path is empty, it writes the contents to stdout instead.

func (*Client) DownloadDirectory

func (c *Client) DownloadDirectory(ctx context.Context, rootDigest, path string) error

DownloadDirectory downloads a an input root from the remote cache into the specified path.

func (*Client) ExecuteAction

func (c *Client) ExecuteAction(ctx context.Context, actionDigest, actionRoot, outDir string, oe outerr.OutErr) (*command.Metadata, error)

ExecuteAction executes an action in a canonical structure remotely. The structure is the same as that produced by DownloadAction. top level >

> ac.textproto (Action text proto)
> cmd.textproto (Command text proto)
> input_node_properties.textproto (InputSpec text proto, optional)
> input (Input root)
  > inputs...

func (*Client) ShowAction

func (c *Client) ShowAction(ctx context.Context, actionDigest string) (string, error)

ShowAction parses and displays an action with its corresponding command.

func (*Client) UploadBlob

func (c *Client) UploadBlob(ctx context.Context, path string) error

UploadBlob uploads a blob from the specified path into the remote cache.

func (*Client) UploadBlobV2

func (c *Client) UploadBlobV2(ctx context.Context, path string) error

UploadBlobV2 uploads a blob from the specified path into the remote cache using newer cas implementation.

Jump to

Keyboard shortcuts

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