eventutil

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: May 17, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApiJobFromLogSubmitJob

func ApiJobFromLogSubmitJob(ownerId string, groups []string, queueName string, jobSetName string, time time.Time, e *armadaevents.SubmitJob) (*api.Job, error)

ApiJobFromLogSubmitJob converts a SubmitJob log message into an api.Job struct, which is used by Armada internally.

func ApiJobsFromLogSubmitJobs

func ApiJobsFromLogSubmitJobs(userId string, groups []string, queueName string, jobSetName string, time time.Time, es []*armadaevents.SubmitJob) ([]*api.Job, error)

ApiJobsFromLogSubmitJobs converts a slice of log jobs to API jobs.

func K8sObjectMetaFromLogObjectMeta

func K8sObjectMetaFromLogObjectMeta(meta *armadaevents.ObjectMeta) *metav1.ObjectMeta

func K8sServicesIngressesFromApiJob

func K8sServicesIngressesFromApiJob(job *api.Job, ingressConfig *configuration.IngressConfiguration) ([]*v1.Service, []*networking.Ingress, error)

K8sServicesIngressesFromApiJob converts job.Services and job.Ingress to k8s services and ingresses.

func LogObjectMetaFromK8sObjectMeta

func LogObjectMetaFromK8sObjectMeta(meta *metav1.ObjectMeta) *armadaevents.ObjectMeta

func LogSubmitJobFromApiJob

func LogSubmitJobFromApiJob(job *api.Job) (*armadaevents.SubmitJob, error)

LogSubmitJobFromApiJob converts an API job to a log job. Note that PopulateK8sServicesIngresses must be called first if job.Services and job.Ingress is to be included in the resulting log job, since the log job can only include k8s objects (i.e., not the API-specific job.Services or job.Ingress).

func LogSubmitObjectsFromApiJob

func LogSubmitObjectsFromApiJob(job *api.Job) (*armadaevents.KubernetesMainObject, []*armadaevents.KubernetesObject, error)

LogSubmitObjectsFromApiJob extracts all objects from an API job for inclusion in a log job.

To extract services and ingresses, PopulateK8sServicesIngresses must be called on the job first to convert API-specific job objects to proper K8s objects.

func LogSubmitPriorityFromApiPriority

func LogSubmitPriorityFromApiPriority(priority float64) (uint32, error)

LogSubmitPriorityFromApiPriority returns the uint32 representation of the priority included with a submitted job, or an error if the conversion fails.

func PopulateK8sServicesIngresses

func PopulateK8sServicesIngresses(job *api.Job, ingressConfig *configuration.IngressConfiguration) error

PopulateK8sServicesIngresses converts the API-specific service and ingress object into K8s objects and stores those in the job object.

func ShortSequenceString added in v0.3.2

func ShortSequenceString(sequence *armadaevents.EventSequence) string

ShortSequenceString returns a short string representation of an events sequence. To be used for logging, for example.

func UnmarshalEventSequence

func UnmarshalEventSequence(ctx context.Context, payload []byte) (*armadaevents.EventSequence, error)

UnmarshalEventSequence returns an EventSequence object contained in a byte buffer after validating that the resulting EventSequence is valid.

Types

This section is empty.

Jump to

Keyboard shortcuts

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