rbe

package
v0.0.0-...-fcfcbe3 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: BSD-3-Clause Imports: 15 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// ExcludeGitDir is a regular expression which may be passed to
	// Client.Upload to exclude the ".git" directory.
	ExcludeGitDir = `^(.*\/)*\.git(\/.*)*$`

	// InstanceChromiumSwarm is the RBE instance used for chromium-swarm.
	InstanceChromiumSwarm = "projects/chromium-swarm/instances/default_instance"

	// InstanceChromiumSwarmDev is the RBE instance used for chromium-swarm-dev.
	InstanceChromiumSwarmDev = "projects/chromium-swarm-dev/instances/default_instance"

	// InstanceChromeSwarming is the RBE instance used for chrome-swarming.
	InstanceChromeSwarming = "projects/chrome-swarming/instances/default_instance"
)

Variables

View Source
var (
	// EmptyDigest is the digest of an empty entry in RBE-CAS.
	EmptyDigest = digest.Empty.String()
)

Functions

func DigestToString

func DigestToString(hash string, size int64) string

DigestToString creates a string for the digest with the given hash and size.

func GetCASInstance

func GetCASInstance(c cas.CAS) (string, error)

func StringToDigest

func StringToDigest(str string) (string, int64, error)

StringToDigest splits the digest string into a digest.Digest instance.

Types

type Client

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

Client is a struct used to interact with RBE-CAS.

func NewClient

func NewClient(ctx context.Context, instance string, ts oauth2.TokenSource) (*Client, error)

NewClient returns a Client instance.

func (*Client) Close

func (c *Client) Close() error

Close implements cas.CAS.

func (*Client) Download

func (c *Client) Download(ctx context.Context, root, casDigest string) error

Download the given digests from RBE-CAS.

func (*Client) Merge

func (c *Client) Merge(ctx context.Context, digests []string) (string, error)

Merge the given digests, returning a new digest which contains all of them.

func (*Client) Upload

func (c *Client) Upload(ctx context.Context, root string, paths, excludes []string) (string, error)

Upload the given paths to RBE-CAS.

type RBEClient

type RBEClient interface {
	Close() error
	ComputeMerkleTree(ctx context.Context, execRoot, workingDir, remoteWorkingDir string, is *command.InputSpec, cache filemetadata.Cache) (root digest.Digest, inputs []*uploadinfo.Entry, stats *client.TreeStats, err error)
	DownloadDirectory(ctx context.Context, d digest.Digest, execRoot string, cache filemetadata.Cache) (map[string]*client.TreeOutput, *client.MovedBytesMetadata, error)
	GetDirectoryTree(ctx context.Context, d *remoteexecution.Digest) (result []*remoteexecution.Directory, err error)
	UploadIfMissing(ctx context.Context, data ...*uploadinfo.Entry) ([]digest.Digest, int64, error)
}

RBEClient is an abstraction of client.Client which enables mocks for testing.

Directories

Path Synopsis
cmd
cas

Jump to

Keyboard shortcuts

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