common

package
v0.16.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2023 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// DefaultPollInterval is the default value for interval between running processes check
	DefaultPollInterval = time.Second
	// DefaultTimeout is the default value for timeout before invoke error during running processes check
	// To run without timeout set value to 0
	DefaultTimeout = 0
	// DefaultWaitAll is the default value whether wait for all other main process of container exiting
	DefaultWaitAllProcesses = "true"
	// TrainingCompleted is the job finished marker in $$$$.pid file when main training process is completed
	TrainingCompleted = "completed"

	// TrainingEarlyStopped is the job finished marker in $$$$.pid file when main training process is early stopped
	TrainingEarlyStopped = "early-stopped"

	// DefaultFilter is the default metrics collector filter to parse the metrics.
	// Metrics must be printed this way
	// loss=0.3
	// accuracy=.98
	// Score=-7.53e-05
	// Score=-7.53e+05
	// Score=1E0
	// Score=1.23E10
	DefaultFilter = `([\w|-]+)\s*=\s*([+-]?\d*(\.\d+)?([Ee][+-]?\d+)?)`

	TimeStampJsonKey = "timestamp"

	// TODO (andreyvelich): Do we need to maintain 2 names? Should we leave only 1?
	MetricCollectorContainerName       = "metrics-collector"
	MetricLoggerCollectorContainerName = "metrics-logger-and-collector"
)

Variables

Functions

func GetMainProcesses added in v0.10.0

func GetMainProcesses(completedMarkedDirPath string) (map[int]bool, int, error)

GetMainProcesses returns array with all running processes pids and main process pid which metrics collector is waiting.

func WaitMainProcesses added in v0.10.0

func WaitMainProcesses(opts WaitPidsOpts) error

WaitMainProcesses holds metrics collector parser until required pids are finished.

func WaitPIDs added in v0.10.0

func WaitPIDs(pids map[int]bool, mainPid int, opts WaitPidsOpts) error

WaitPIDs waits until all pids are finished. If waitAll == false WaitPIDs waits until main process is finished.

Types

type WaitPidsOpts

type WaitPidsOpts struct {
	PollInterval           time.Duration
	Timeout                time.Duration
	WaitAll                bool
	CompletedMarkedDirPath string
}

WaitPidsOpts is the input options for metrics collector

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL