setup

package
v2.1.7 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ModeCreate is the primary argument to the setup tools container when the task is creating objects.
	ModeCreate = "create"
	// ModeDelete is the primary argument to the setup tools container when the task is deleting objects.
	ModeDelete = "delete"

	// Initializer is used to paused the trial initialization for setup tasks.
	Initializer = "setupInitializer.stormforge.io"
	// Finalizer is used to prevent the trial deletion for setup tasks.
	Finalizer = "setupFinalizer.stormforge.io"
)

Variables

View Source
var (
	// Image is the name of the setuptools image to use.
	Image = "setuptools:latest"
	// ImagePullPolicy controls when the default image should be pulled.
	ImagePullPolicy = string(corev1.PullIfNotPresent)
)

This is overwritten during builds to point to the actual image.

Functions

func AppendAssignmentEnv

func AppendAssignmentEnv(t *optimizev1beta2.Trial, env []corev1.EnvVar) []corev1.EnvVar

AppendAssignmentEnv appends an environment variable for each trial assignment.

func AppendPrometheusEnv

func AppendPrometheusEnv(t *optimizev1beta2.Trial, env []corev1.EnvVar) []corev1.EnvVar

AppendPrometheusEnv appends environment variables to help reference the built in Prometheus.

func AppendStatusEnv added in v2.1.0

func AppendStatusEnv(t *optimizev1beta2.Trial, env []corev1.EnvVar) []corev1.EnvVar

AppendStatusEnv appends the trial status as environment variables.

func GetConditionStatus

func GetConditionStatus(j *batchv1.Job) (corev1.ConditionStatus, string)

GetConditionStatus returns condition True for a finished job or condition False for an job in progress.

func GetTrialConditionType

func GetTrialConditionType(j *batchv1.Job) (optimizev1beta2.TrialConditionType, error)

GetTrialConditionType returns the trial condition type used to report status for the specified job.

func IsPrometheusSetupTask

func IsPrometheusSetupTask(st *optimizev1beta2.SetupTask) bool

IsPrometheusSetupTask checks to see if the supplied setup task is for the built-in Prometheus.

func NewJob

func NewJob(t *optimizev1beta2.Trial, mode string) (*batchv1.Job, error)

NewJob returns a new setup job for either create or delete.

func UpdateStatus

func UpdateStatus(t *optimizev1beta2.Trial, probeTime *metav1.Time) bool

UpdateStatus returns true if there are setup tasks.

Types

This section is empty.

Jump to

Keyboard shortcuts

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