bazel

package
v0.0.0-...-764741f Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2019 License: Apache-2.0 Imports: 15 Imported by: 0

README

Bazel Remote Execution Snapshot

This contains snapshot support for the Bazel gRPC Remote Execution API We currently rely on fs_util, a tool distributed by github.com/pantsbuild/pants, for underlying implementation

Snapshot ID format

Bazel Remote Execution snapshots use Snapshot IDs of format bz-- and map to a unique Bazel digest

Components:
  • bzFiler satisfies the snapshot.Snapshot interface
    • Checks out a Bazel Digest as a snapshot & sets up local filesystem
    • Ingests directory or file and stores it as a snapshot
    • noop Updates
  • bzCheckout satisfies the snapshot.Checkout interface
  • bzCommand runs fs_util tool as an exec.Cmd with relevant options / flags / args
    • Possible arguments and expected output
      • file save [path] ->
      • directory save --root [root] [dir] ->
      • directory materialize

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Module

func Module() ice.Module

Types

type BzFiler

type BzFiler struct {

	// Public resolver exposes selection of server host:port for underlying connections to cas
	// NOTE: we may want to introduce a custom resolver that limits the number of underlying
	// resolve calls if these are costly (i.e. make a network request) and we make a high number
	// of CAS requests.
	// GRPC package provides tools for making client connection contexts that support
	// retry and backoff configuration, but we currently have to expose the resolver to
	// an underlying tool that makes CAS requests on our behalf during Checkout and Ingest.
	CASResolver dialer.Resolver
	// contains filtered or unexported fields
}

Implements Snapshot interface (snapshot.Checkouter, snapshot.Ingester, and snapshot.Updater) Default tree implementation uses fs_util, a tool provided by pants at https://github.com/pantsbuild/binaries/tree/gh-pages/build-support/bin/fs_util which handles underlying implementation of bazel snapshot functionality

func MakeBzFiler

func MakeBzFiler(tmp *temp.TempDir, r dialer.Resolver) (*BzFiler, error)

func MakeBzFilerKeepCheckouts

func MakeBzFilerKeepCheckouts(tmp *temp.TempDir, r dialer.Resolver) (*BzFiler, error)

func (*BzFiler) Checkout

func (bf *BzFiler) Checkout(id string) (snapshot.Checkout, error)

func (*BzFiler) CheckoutAt

func (bf *BzFiler) CheckoutAt(id string, dir string) (snapshot.Checkout, error)

func (*BzFiler) Ingest

func (bf *BzFiler) Ingest(path string) (string, error)

func (*BzFiler) IngestMap

func (bf *BzFiler) IngestMap(srcToDest map[string]string) (string, error)

func (*BzFiler) Update

func (bf *BzFiler) Update() error

Default updater is a no-op

func (*BzFiler) UpdateInterval

func (bf *BzFiler) UpdateInterval() time.Duration

type CheckoutNotExistError

type CheckoutNotExistError struct {
	Err string
}

Type that indicates a Checkout operation failed because one or more input elements did not exist. This does not currently hold specific data, but could in the future include specific Digest information. This is limited by output from the underlying Filer -> BzTree implementation that uses the fs_util tool (materialize command).

func (*CheckoutNotExistError) Error

func (c *CheckoutNotExistError) Error() string

Implements the Error interface

Jump to

Keyboard shortcuts

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