modulepackage
0.0.0-20250304205544-71af207b4383
Repository: https://github.com/mongodb/jasper.git
Documentation: pkg.go.dev
# README
========================================
jasper
-- Process Management Service
Overview
Jasper is a library for managing groups of processes in the context of
test automation, and is a component of Evergreen <https://github.com/evergreen-ci/evergreen>
_ and related tools.
Documentation
The core API documentation is in the godoc <https://godoc.org/github.com/mongodb/jasper/>
_.
Until there's documentation of the REST and gRPC interfaces, you can use
the rest interface declaration <https://github.com/mongodb/jasper/blob/master/remote/rest_service.go>
_
and the proto file <https://github.com/mongodb/jasper/blob/master/jasper.proto>
_.
# Packages
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
# Functions
BuildCommand builds the Command given the configuration of arguments.
BuildCommandGroup runs the group of sub-commands given the configuration of arguments.
BuildCommandGroupContinueOnError runs the group of sub-commands given the configuration of arguments, continuing execution despite any errors.
BuildRemoteCommand builds the Command remotely given the configuration of arguments.
BuildRemoteCommandGroup runs the group of sub-commands remotely given the configuration of arguments.
BuildRemoteCommandGroupContinueOnError runs the group of sub-commands remotely given the configuration of arguments, continuing execution despite any errors.
GetInMemoryLogStream gets at most count logs from the in-memory output logs for the given Process proc.
GetSignalTriggerFactory retrieves a factory to create the signal trigger represented by the id.
Kill sends a SIGKILL signal to the given process under the given context.
KillAll sends a SIGKILL signal to each of the given processes under the given context.
MakeSynchronizedManager wraps the given manager in a thread-safe Manager, which also uses thread-safe processes.
ManagerTests returns the common test suite for the Manager interface.
NewCommand returns a blank Command.
NewInMemoryLogger is a basic constructor that constructs a logger configuration for plain formatted in-memory buffered logger.
NewJob constructs an amboy job that wraps a provided ProcessConstructor.
NewJobBasic constructs an amboy job that uses jasper process management internally.
NewJobBasicExtended builds a job that creates a process with environment variables and a working directory defined.
NewJobBasicForeground creates an amboy job that writes all output linewise to the current processes global grip logging instance with error and output separated by level.
NewJobExtended builds a job that creates a process with environment variables and a working directory defined.
NewJobForeground creates an amboy job that writes all output linewise to the current processes global grip logging instance with error and output separated by level.
NewJobOptions creates a new job using the options to define the parameters of the job.
NewLoggingCache produces a thread-safe implementation of a local logging cache.
NewOOMTracker returns an implementation of the OOMTracker interface for the current platform.
NewProcess is a factory function which constructs a thread-safe standalone process outside of the context of a manager.
NewProcessTracker creates a cgroup for all tracked processes if supported.
NewRemoteManager builds a remote manager that wraps an existing manager, but creates all commands with the specified remote options.
NewSelfClearingProcessManager creates and returns a process manager that places a limit on the number of concurrent processes stored by Jasper at any given time, and will clear itself of dead processes when necessary without the need for calling Clear() from the user.
NewSynchronizedManager is a constructor for a thread-safe basic Manager.
ProcessTests returns the common test suite for the Process interface.
RegisterJobs adds factories for the job types provided by these packages to make it possible to dispatch these jobs to a remote/distributed queue.
RegisterSignalTriggerFactory registers a factory to create the signal trigger represented by the id.
SetupDownloadMongoDBReleases performs necessary setup to download MongoDB with the given options.
SignalEvent is a no-op on Unix-based systems.
Terminate sends a SIGTERM signal to the given process under the given context.
TerminateAll sends a SIGTERM signal to each of the given processes under the given context.
# Constants
CleanTerminationSignalTrigger is the ID for the signal trigger to use for termination of processes with exit code 0.
DefaultCachePruneDelay is the duration between LRU cache prunes.
DefaultMaxCacheSize is the maximum allowed size of the LRU cache.
EnvironID is the environment variable that is set on all processes.
ManagerEnvironID is the environment variable that is set on all managed process that always identifies the process' manager.
# Variables
ErrCachedLoggerNotFound indicates that a logger was not found in the cache.
# Structs
Command objects allow a quick and lightweight interface for firing off ad-hoc processes for smaller tasks.
LogStream represents the output of reading the in-memory log buffer as a stream, containing the logs (if any) and whether or not the stream is done reading.
ManagerTestCase represents a test case including a manager and options.ModifyOpts to modify process creation options.
ProcessInfo reports on the current state of a process.
ProcessTestCase represents a test case including a constructor and options to create a process.
# Interfaces
LoggingCache provides an interface to a cache of loggers.
Manager provides a basic, high level process management interface for processes, and supports creation and introspection.
OOMTracker provides a tool for detecting if there have been OOM events on the system.
Process objects reflect ways of starting and managing processes.
ProcessTracker provides a way to logically group processes that should be managed collectively.
# Type aliases
Job is an alias for an amboy.Job.
ProcessConstructor is a function type that, given a context.Context and a options.Create struct, returns a Process and an error.
ProcessTrigger describes the way to write cleanup functions for processes, which provide ways of adding behavior to processes after they complete.
ProcessTriggerSequence is simply a convenience type to simplify running more than one triggered operation.
SignalTrigger describes the way to write hooks that will execute before a process is about to be signaled.
SignalTriggerFactory is a function that creates a SignalTrigger.
SignalTriggerID is the unique representation of a signal trigger.
SignalTriggerSequence is a convenience type to simplify running more than one signal trigger.