Code Organization - mongodb/jasper GitHub Wiki

jasper

The root package contains the core functionality for local process management. This includes primarily process tracking, process managers, and the local process implementations. It also contains logic for running Commands, which are built on top of Jasper processes and basically provides convenient wrapper functionality on top of the existing process code.

The package also contains some functionality related to shared Jasper manager logic, such as downloading files and logging output.

remote

The remote package contains the logic for remote process management. The supported remote interfaces are:

The package provides both client and service implementations.

remote/internal

The remote/internal package contains code for the gRPC service, including autogenerated code from the gRPC protobuf file.

options

The options package contains various options that are used throughout the repository, including options to create processes, create files, download files, set up process logging backends, and scripting.

internal/executor

The internal/executor package contains an additional implementation layer for executing processes. This is a layer of abstraction below a process, which is necessary to interface with different Golang libraries. Each library has its own specific implementation that determines how a process will be run. For example, a process running over SSH uses the golang.org/x/crypto/ssh library while local processes use the standard library os/exec library.

cli

The cli package contains the logic to build the Jasper CLI.

scripting

The scripting package is for running scripts on local and remote Jasper managers. Jasper supports multiple languages, including:

  • Golang
  • Python

util

The util package mostly contains small helper utilities for other packages that don't belong anywhere else.

mock

The mock package contains mock implementations of some of the interfaces in Jasper for the purposes of testing. For example, the mock manager can be used in a test where it would be undesirable to actually create a process (e.g. writing a test for a process that has to SSH).

cmd

The cmd package primarily consists of main programs to create binary executables that are used for building/testing. The one exception is the cmd/jasper subpackage, which contains the main program for building the Jasper CLI.

benchmarks

The benchmarks package contains benchmarks for measuring throughput of process logging. Benchmarks are written using Poplar because it is easier to integrate the Poplar output into something that is consumable by the CI system Evergreen.