Documentation ¶
Overview ¶
Package rexec provides a top-level client for executing remote commands.
Index ¶
- type Client
- type Context
- func (ec *Context) DownloadOutErr()
- func (ec *Context) DownloadOutputs(outputDir string)
- func (ec *Context) DownloadSpecifiedOutputs(outs map[string]*rc.TreeOutput, outDir string)
- func (ec *Context) ExecuteRemotely()
- func (ec *Context) GetCachedResult()
- func (ec *Context) GetFlattenedOutputs() (map[string]*rc.TreeOutput, error)
- func (ec *Context) GetOutputFileDigests(useAbsPath bool) (map[string]digest.Digest, error)
- func (ec *Context) UpdateCachedResult()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { FileMetadataCache filemetadata.Cache GrpcClient *rc.Client }
Client is a remote execution client.
type Context ¶
type Context struct { // The metadata of the current execution. Metadata *command.Metadata // The result of the current execution, if available. Result *command.Result // contains filtered or unexported fields }
Context allows more granular control over various stages of command execution. At any point, any errors that occurred will be stored in the Result.
func (*Context) DownloadOutErr ¶
func (ec *Context) DownloadOutErr()
DownloadOutErr downloads the stdout and stderr of the command.
func (*Context) DownloadOutputs ¶
DownloadOutputs downloads the outputs of the command in the context to the specified directory.
func (*Context) DownloadSpecifiedOutputs ¶
func (ec *Context) DownloadSpecifiedOutputs(outs map[string]*rc.TreeOutput, outDir string)
DownloadSpecifiedOutputs downloads the specified outputs into the specified directory This function is run when the option to preserve unchanged outputs is on
func (*Context) ExecuteRemotely ¶
func (ec *Context) ExecuteRemotely()
ExecuteRemotely tries to execute the command remotely and download the results. It uploads any missing inputs first.
func (*Context) GetCachedResult ¶
func (ec *Context) GetCachedResult()
GetCachedResult tries to get the command result from the cache. The Result will be nil on a cache miss. The Context will be ready to execute the action, or, alternatively, to update the remote cache with a local result. If the ExecutionOptions do not allow to accept remotely cached results, the operation is a noop.
func (*Context) GetFlattenedOutputs ¶
func (ec *Context) GetFlattenedOutputs() (map[string]*rc.TreeOutput, error)
GetFlattenedOutputs flattens the outputs from the ActionResult of the context and returns a map of output paths relative to the working directory and their corresponding TreeOutput
func (*Context) GetOutputFileDigests ¶
GetOutputFileDigests returns a map of output file paths to digests. This function is supposed to be run after a successful cache-hit / remote-execution has been run with the given execution context. If called before the completion of remote-execution, the function returns a nil result.
func (*Context) UpdateCachedResult ¶
func (ec *Context) UpdateCachedResult()
UpdateCachedResult tries to write local results of the execution to the remote cache. TODO(olaola): optional arguments to override values of local outputs, and also stdout/err.