package
0.0.1-alpha
Repository: https://github.com/twitter/scoot.git
Documentation: pkg.go.dev

# README

Generating Bazel Remote Execution API Protobuf Code

This directory contains generated and edited code from the Bazel API definition found at https://github.com/bazelbuild/remote-apis

Generating Go API Code

Tools Required

https://grpc.io/docs/quickstart/go.html

  • go get -u google.golang.org/grpc
  • ensure protoc --version >= 3
  • go get -u github.com/golang/protobuf/protoc-gen-go

Dependencies

Clone the following repositories at the normal place in your GOPATH:

Generate

We will generate 2 .pb.go files from the remote-apis repository with 2 separate commands, since these reside in different packages (see https://github.com/golang/protobuf for background on this limitation).

Assumes:

  • CWD is the top level of the clone of this scoot repository
  • protoc installed at ~/bin/protoc/bin/protoc
  • GOPATH is ~/workspace and dependencies are cloned under workspace/src
~/bin/protoc/bin/protoc \
-I ~/workspace/src/github.com/bazelbuild/remote-apis/ \
-I ~/workspace/src/github.com/googleapis/googleapis/ \
~/workspace/src/github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2/remote_execution.proto \
--go_out=plugins=grpc:bazel/remoteexecution

~/bin/protoc/bin/protoc \
-I ~/workspace/src/github.com/bazelbuild/remote-apis/ \
-I ~/workspace/src/github.com/googleapis/googleapis/ \
~/workspace/src/github.com/bazelbuild/remote-apis/build/bazel/semver/semver.proto \
--go_out=plugins=grpc:bazel/remoteexecution

This should generate bazel/remoteexecution/build/...

Edit (Make it work)

The directory structure and package import paths of the generated code will not work for us. To Fix this, move the .pb.go to the top level bazel/remoteexecution/ directory:

mv bazel/remoteexecution/build/bazel/remote/execution/v2/remote_execution.pb.go bazel/remoteexecution/
mv bazel/remoteexecution/build/bazel/semver/semver.pb.go bazel/remoteexecution/
rm -rf bazel/remoteexecution/build

Edit the files to normalize them for their current location under the same package:

  • change the semver.pb.go package to "remoteexecution"
  • remote_execution.pb.go will not need to import "build/bazel/semver" any longer
  • remote_execution.pb.go semver package references can be truncated ("semver.S" becomes "S")

Run all tests to verify compatibility.

Other Dependencies

Depending on the proto changes, vendored libraries may need to be updated, e.g.:

  • github.com/golang/protobuf
  • google.golang.org/grpc

Usage in the Scoot repo

Use this package for the Bazel API generated code:

import (
    remoteexecution "github.com/twitter/scoot/bazel/remoteexecution"
)

# Functions

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Constants

Server will allow symlink targets to escape the input root tree, possibly resulting in non-hermetic builds.
Server will return an INVALID_ARGUMENT on input symlinks with absolute targets.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Checking the result against the cache.
Finished execution.
Currently being executed by a worker.
Currently idle, awaiting a free machine to execute.
No description provided by the author

# Variables

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

An `Action` captures all the information about an execution which is required to reproduce it.
Describes the server/instance capabilities for updating the action cache.
An ActionResult represents the result of an [Action][build.bazel.remote.execution.v2.Action] being run.
A request message for [ContentAddressableStorage.BatchReadBlobs][build.bazel.remote.execution.v2.ContentAddressableStorage.BatchReadBlobs].
A response message for [ContentAddressableStorage.BatchReadBlobs][build.bazel.remote.execution.v2.ContentAddressableStorage.BatchReadBlobs].
A response corresponding to a single blob that the client tried to upload.
A request message for [ContentAddressableStorage.BatchUpdateBlobs][build.bazel.remote.execution.v2.ContentAddressableStorage.BatchUpdateBlobs].
A request corresponding to a single blob that the client wants to upload.
A response message for [ContentAddressableStorage.BatchUpdateBlobs][build.bazel.remote.execution.v2.ContentAddressableStorage.BatchUpdateBlobs].
A response corresponding to a single blob that the client tried to upload.
Capabilities of the remote cache system.
A `Command` is the actual command executed by a worker running an [Action][build.bazel.remote.execution.v2.Action] and specifications of its environment.
An `EnvironmentVariable` is one variable to set in the running program's environment.
A content digest.
A `Directory` represents a directory node in a file tree, containing zero or more children [FileNodes][build.bazel.remote.execution.v2.FileNode], [DirectoryNodes][build.bazel.remote.execution.v2.DirectoryNode] and [SymlinkNodes][build.bazel.remote.execution.v2.SymlinkNode].
A `DirectoryNode` represents a child of a [Directory][build.bazel.remote.execution.v2.Directory] which is itself a `Directory` and its associated metadata.
ExecutedActionMetadata contains details about a completed execution.
Metadata about an ongoing [execution][build.bazel.remote.execution.v2.Execution.Execute], which will be contained in the [metadata field][google.longrunning.Operation.response] of the [Operation][google.longrunning.Operation].
A request message for [Execution.Execute][build.bazel.remote.execution.v2.Execution.Execute].
The response message for [Execution.Execute][build.bazel.remote.execution.v2.Execution.Execute], which will be contained in the [response field][google.longrunning.Operation.response] of the [Operation][google.longrunning.Operation].
Capabilities of the remote execution system.
An `ExecutionPolicy` can be used to control the scheduling of the action.
A `FileNode` represents a single file and associated metadata.
A request message for [ContentAddressableStorage.FindMissingBlobs][build.bazel.remote.execution.v2.ContentAddressableStorage.FindMissingBlobs].
A response message for [ContentAddressableStorage.FindMissingBlobs][build.bazel.remote.execution.v2.ContentAddressableStorage.FindMissingBlobs].
A request message for [ActionCache.GetActionResult][build.bazel.remote.execution.v2.ActionCache.GetActionResult].
A request message for [Capabilities.GetCapabilities][google.devtools.remoteexecution.v2.Capabilities.GetCapabilities].
A request message for [ContentAddressableStorage.GetTree][build.bazel.remote.execution.v2.ContentAddressableStorage.GetTree].
A response message for [ContentAddressableStorage.GetTree][build.bazel.remote.execution.v2.ContentAddressableStorage.GetTree].
A `LogFile` is a log stored in the CAS.
An `OutputDirectory` is the output in an `ActionResult` corresponding to a directory's full contents rather than a single file.
An `OutputFile` is similar to a [FileNode][build.bazel.remote.execution.v2.FileNode], but it is used as an output in an `ActionResult`.
An `OutputSymlink` is similar to a [Symlink][build.bazel.remote.execution.v2.SymlinkNode], but it is used as an output in an `ActionResult`.
A `Platform` is a set of requirements, such as hardware, operating system, or compiler toolchain, for an [Action][build.bazel.remote.execution.v2.Action]'s execution environment.
A single property for the environment.
Allowed values for priority in [ResultsCachePolicy][google.devtools.remoteexecution.v2.ResultsCachePolicy] Used for querying both cache and execution valid priority ranges.
Supported range of priorities, including boundaries.
An optional Metadata to attach to any RPC request to tell the server about an external context of the request.
A `ResultsCachePolicy` is used for fine-grained control over how action outputs are stored in the CAS and Action Cache.
No description provided by the author
A response message for [Capabilities.GetCapabilities][google.devtools.remoteexecution.v2.Capabilities.GetCapabilities].
A `SymlinkNode` represents a symbolic link.
Details for the tool used to call the API.
A `Tree` contains all the [Directory][build.bazel.remote.execution.v2.Directory] protos in a single directory Merkle tree, compressed into one message.
A request message for [ActionCache.UpdateActionResult][build.bazel.remote.execution.v2.ActionCache.UpdateActionResult].
A request message for [WaitExecution][build.bazel.remote.execution.v2.Execution.WaitExecution].

# Interfaces

ActionCacheClient is the client API for ActionCache service.
ActionCacheServer is the server API for ActionCache service.
CapabilitiesClient is the client API for Capabilities service.
CapabilitiesServer is the server API for Capabilities service.
No description provided by the author
No description provided by the author
ContentAddressableStorageClient is the client API for ContentAddressableStorage service.
ContentAddressableStorageServer is the server API for ContentAddressableStorage service.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ExecutionClient is the client API for Execution service.
ExecutionServer is the server API for Execution service.

# Type aliases

Describes how the server treats absolute symlink targets.
The digest function used for converting values into keys for CAS and Action Cache.
The current stage of execution.