Documentation ¶
Index ¶
- func CheckForRuntimes(ctx context.Context, requirements []*agentv0.Runtime) error
- func CheckPythonPath() (string, error)
- func ContainerName(name string) string
- func DockerEngineRunning(ctx context.Context) bool
- func Forward(ctx context.Context, reader io.Reader, writer io.Writer)
- func ForwardLogs(ctx context.Context, wg *sync.WaitGroup, reader io.Reader, writer io.Writer)
- func IsFreePort(port int) bool
- func PrintDownloadPercentage(reader io.ReadCloser, out io.Writer)
- func WaitForPortUnbound(ctx context.Context, port int) error
- type CPU
- type DockerContainerInstance
- type DockerEnvironment
- func (docker *DockerEnvironment) Clear(ctx context.Context) error
- func (docker *DockerEnvironment) ContainerID() (string, error)
- func (docker *DockerEnvironment) GetContainer(ctx context.Context) error
- func (docker *DockerEnvironment) GetImage(ctx context.Context, imag *configurations.DockerImage) error
- func (docker *DockerEnvironment) ImageExists(ctx context.Context, imag *configurations.DockerImage) (bool, error)
- func (docker *DockerEnvironment) Init(ctx context.Context) error
- func (docker *DockerEnvironment) IsContainerPresent(ctx context.Context) (bool, error)
- func (docker *DockerEnvironment) IsStopped(ctx context.Context) (bool, error)
- func (docker *DockerEnvironment) NewProcess(bin string, args ...string) (Proc, error)
- func (docker *DockerEnvironment) Shutdown(ctx context.Context) error
- func (docker *DockerEnvironment) Stop(ctx context.Context) error
- func (docker *DockerEnvironment) WithCommand(cmd ...string)
- func (docker *DockerEnvironment) WithDir(dir string)
- func (docker *DockerEnvironment) WithEnvironmentVariables(envs ...configurations.EnvironmentVariable)
- func (docker *DockerEnvironment) WithMount(sourceDir string, targetDir string)
- func (docker *DockerEnvironment) WithOutput(logger io.Writer)
- func (docker *DockerEnvironment) WithPause()
- func (docker *DockerEnvironment) WithPort(ctx context.Context, port uint16)
- func (docker *DockerEnvironment) WithPortMapping(ctx context.Context, local uint16, container uint16)
- func (docker *DockerEnvironment) WithWorkDir(dir string)
- type DockerPortMapping
- type DockerProc
- func (docker *DockerProc) Run(ctx context.Context) error
- func (docker *DockerProc) Start(ctx context.Context) error
- func (docker *DockerProc) Stop(ctx context.Context) error
- func (docker *DockerProc) WithEnvironmentVariables(envs ...configurations.EnvironmentVariable)
- func (docker *DockerProc) WithOutput(output io.Writer)
- type DockerPullResponse
- type Event
- type LocalEnvironment
- func (local *LocalEnvironment) Clear(context.Context) error
- func (local *LocalEnvironment) Init(ctx context.Context) error
- func (local *LocalEnvironment) NewProcess(bin string, args ...string) (Proc, error)
- func (local *LocalEnvironment) Shutdown(context.Context) error
- func (local *LocalEnvironment) Stop(context.Context) error
- func (local *LocalEnvironment) WithEnvironmentVariables(envs ...configurations.EnvironmentVariable)
- type LocalProc
- func (proc *LocalProc) Forward(_ context.Context, w io.Reader)
- func (proc *LocalProc) Run(ctx context.Context) error
- func (proc *LocalProc) Start(ctx context.Context) error
- func (proc *LocalProc) Stop(ctx context.Context) error
- func (proc *LocalProc) WithEnvironmentVariables(envs ...configurations.EnvironmentVariable)
- func (proc *LocalProc) WithOutput(output io.Writer)
- type Memory
- type Proc
- type Process
- func (runner *Process) Finish()
- func (runner *Process) Finished() bool
- func (runner *Process) Init(_ context.Context) error
- func (runner *Process) Run(ctx context.Context) error
- func (runner *Process) Start(ctx context.Context) error
- func (runner *Process) Stop() error
- func (runner *Process) Wait() error
- func (runner *Process) WithArguments(args ...string)
- func (runner *Process) WithBin(bin string)
- func (runner *Process) WithDebug(debug bool)
- func (runner *Process) WithDir(dir string)
- func (runner *Process) WithEnvironmentVariables(envs ...configurations.EnvironmentVariable)
- func (runner *Process) WithOutput(w io.Writer)
- type ProcessState
- type ProgressDetail
- type Runner
- type RunnerEnvironment
- type Tracked
- type TrackedProcess
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckForRuntimes ¶
func CheckPythonPath ¶
func ContainerName ¶
func DockerEngineRunning ¶
func ForwardLogs ¶
func IsFreePort ¶
func PrintDownloadPercentage ¶
func PrintDownloadPercentage(reader io.ReadCloser, out io.Writer)
Types ¶
type DockerContainerInstance ¶
type DockerContainerInstance struct {
ID string
}
type DockerEnvironment ¶
type DockerEnvironment struct {
// contains filtered or unexported fields
}
func NewDockerEnvironment ¶
func NewDockerEnvironment(ctx context.Context, image *configurations.DockerImage, dir string, name string) (*DockerEnvironment, error)
NewDockerEnvironment creates a new docker runner
func NewDockerHeadlessEnvironment ¶
func NewDockerHeadlessEnvironment(ctx context.Context, image *configurations.DockerImage, name string) (*DockerEnvironment, error)
NewDockerHeadlessEnvironment creates a new docker runner
func (*DockerEnvironment) ContainerID ¶
func (docker *DockerEnvironment) ContainerID() (string, error)
func (*DockerEnvironment) GetContainer ¶
func (docker *DockerEnvironment) GetContainer(ctx context.Context) error
func (*DockerEnvironment) GetImage ¶
func (docker *DockerEnvironment) GetImage(ctx context.Context, imag *configurations.DockerImage) error
func (*DockerEnvironment) ImageExists ¶
func (docker *DockerEnvironment) ImageExists(ctx context.Context, imag *configurations.DockerImage) (bool, error)
func (*DockerEnvironment) IsContainerPresent ¶
func (docker *DockerEnvironment) IsContainerPresent(ctx context.Context) (bool, error)
func (*DockerEnvironment) IsStopped ¶
func (docker *DockerEnvironment) IsStopped(ctx context.Context) (bool, error)
func (*DockerEnvironment) NewProcess ¶
func (docker *DockerEnvironment) NewProcess(bin string, args ...string) (Proc, error)
func (*DockerEnvironment) Shutdown ¶
func (docker *DockerEnvironment) Shutdown(ctx context.Context) error
func (*DockerEnvironment) WithCommand ¶
func (docker *DockerEnvironment) WithCommand(cmd ...string)
func (*DockerEnvironment) WithDir ¶
func (docker *DockerEnvironment) WithDir(dir string)
func (*DockerEnvironment) WithEnvironmentVariables ¶
func (docker *DockerEnvironment) WithEnvironmentVariables(envs ...configurations.EnvironmentVariable)
func (*DockerEnvironment) WithMount ¶
func (docker *DockerEnvironment) WithMount(sourceDir string, targetDir string)
func (*DockerEnvironment) WithOutput ¶
func (docker *DockerEnvironment) WithOutput(logger io.Writer)
func (*DockerEnvironment) WithPause ¶
func (docker *DockerEnvironment) WithPause()
func (*DockerEnvironment) WithPort ¶
func (docker *DockerEnvironment) WithPort(ctx context.Context, port uint16)
func (*DockerEnvironment) WithPortMapping ¶
func (docker *DockerEnvironment) WithPortMapping(ctx context.Context, local uint16, container uint16)
func (*DockerEnvironment) WithWorkDir ¶
func (docker *DockerEnvironment) WithWorkDir(dir string)
type DockerPortMapping ¶
type DockerProc ¶
type DockerProc struct {
// contains filtered or unexported fields
}
DockerProc is a process running inside a Docker container
func (*DockerProc) WithEnvironmentVariables ¶
func (docker *DockerProc) WithEnvironmentVariables(envs ...configurations.EnvironmentVariable)
func (*DockerProc) WithOutput ¶
func (docker *DockerProc) WithOutput(output io.Writer)
type DockerPullResponse ¶
type DockerPullResponse struct { ID string `json:"id"` Status string `json:"status"` ProgressDetail ProgressDetail `json:"progressDetail"` }
type Event ¶
type Event struct { // Err is the state of error of the service Err error // Status is the state of the service ProcessState // CPU *observabilityv0.CPU // Memory *observabilityv0.Memory }
Event represents data of a **running** service Generic so most fields will be nil
type LocalEnvironment ¶
type LocalEnvironment struct {
// contains filtered or unexported fields
}
func NewLocalEnvironment ¶
func NewLocalEnvironment(ctx context.Context, dir string) (*LocalEnvironment, error)
NewLocalEnvironment creates a new docker runner
func (*LocalEnvironment) NewProcess ¶
func (local *LocalEnvironment) NewProcess(bin string, args ...string) (Proc, error)
func (*LocalEnvironment) WithEnvironmentVariables ¶
func (local *LocalEnvironment) WithEnvironmentVariables(envs ...configurations.EnvironmentVariable)
type LocalProc ¶
type LocalProc struct {
// contains filtered or unexported fields
}
func (*LocalProc) WithEnvironmentVariables ¶
func (proc *LocalProc) WithEnvironmentVariables(envs ...configurations.EnvironmentVariable)
func (*LocalProc) WithOutput ¶
type Process ¶
type Process struct {
// contains filtered or unexported fields
}
func (*Process) WithArguments ¶
func (*Process) WithEnvironmentVariables ¶
func (runner *Process) WithEnvironmentVariables(envs ...configurations.EnvironmentVariable)
func (*Process) WithOutput ¶
type ProcessState ¶
type ProcessState int
const ( Unknown ProcessState = iota NotFound ProcessState = iota Running InterruptibleSleep UninterruptibleSleep Stopped Zombie Dead TracingStop Idle Parked Waking )
func (ProcessState) String ¶
func (ps ProcessState) String() string
type ProgressDetail ¶
type RunnerEnvironment ¶
type RunnerEnvironment interface { // Init setup the environment Init(ctx context.Context) error // Clear removes all resources Clear(ctx context.Context) error // NewProcess creates a new process for the environment NewProcess(bin string, args ...string) (Proc, error) // Stop the environment: can potentially be restarted Stop(ctx context.Context) error // Shutdown the environment: all resources will be deleted Shutdown(ctx context.Context) error // WithEnvironmentVariables sets the environment variables WithEnvironmentVariables(envs ...configurations.EnvironmentVariable) }
A RunnerEnvironment controls running processes. Implementations: - local - docker - kubernetes (future)
type TrackedProcess ¶
func (*TrackedProcess) GetMemory ¶
func (p *TrackedProcess) GetMemory(ctx context.Context) (*Memory, error)
func (*TrackedProcess) GetState ¶
func (p *TrackedProcess) GetState(ctx context.Context) (ProcessState, error)
Click to show internal directories.
Click to hide internal directories.