Documentation ¶
Overview ¶
Package entrypoint is a library that knows how to wrap a process and write it's output and exit code to disk
Index ¶
Constants ¶
View Source
const ( // InternalErrorCode is what we write to the marker file to // indicate that we failed to start the wrapped command InternalErrorCode = 127 // AbortedErrorCode is what we write to the marker file to // indicate that we were terminated via a signal. AbortedErrorCode = 130 // DefaultTimeout is the default timeout for the test // process before SIGINT is sent DefaultTimeout = 120 * time.Minute // DefaultGracePeriod is the default timeout for the test // process after SIGINT is sent before SIGKILL is sent DefaultGracePeriod = 15 * time.Second )
View Source
const ( // JSONConfigEnvVar is the environment variable that // utilities expect to find a full JSON configuration // in when run. JSONConfigEnvVar = "ENTRYPOINT_OPTIONS" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Options ¶
type Options struct { // Args is the process and args to run Args []string `json:"args"` // Timeout determines how long to wait before the // entrypoint sends SIGINT to the process Timeout time.Duration `json:"timeout"` // GracePeriod determines how long to wait after // sending SIGINT before the entrypoint sends // SIGKILL. GracePeriod time.Duration `json:"grace_period"` // ArtifactDir is a directory where test processes can dump artifacts // for upload to persistent storage (courtesy of sidecar). // If specified, it is created by entrypoint before starting the test process. // May be ignored if not using sidecar. ArtifactDir string `json:"artifact_dir,omitempty"` *wrapper.Options }
Options exposes the configuration necessary for defining the process being watched and where in GCS an upload will land.
func (*Options) BindOptions ¶
BindOptions binds flags to options
func (*Options) ConfigVar ¶
ConfigVar exposes the environment variable used to store serialized configuration
func (Options) ExecuteProcess ¶
ExecuteProcess creates the artifact directory then executes the process as configured, writing the output to the process log.
func (*Options) LoadConfig ¶
LoadConfig loads options from serialized config
Click to show internal directories.
Click to hide internal directories.