common

package
v0.0.0-...-a69e935 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2019 License: Apache-2.0 Imports: 12 Imported by: 10

Documentation

Index

Constants

View Source
const (
	Preemptible = "preemptible"
	Revocable   = "revocable"
	Preferred   = "preferred"
)

Aurora scheduling tiers.

View Source
const AuroraGpuResourceKey = "udeploy_num_gpus"

AuroraGpuResourceKey is the label set to indicate the number of GPUs to be allocated to the task.

View Source
const BridgeUpdateLabelKey = "aurora_bridge_update"

BridgeUpdateLabelKey is the Peloton pod level label key for triggering a forced PodSpec change.

View Source
const MesosHostAttr = "host"

MesosHostAttr is the Mesos attribute for hostname.

Variables

View Source
var BridgeJobLabel = &peloton.Label{
	Key:   "aurora_bridge",
	Value: "com.uber.peloton.internal.aurorabridge",
}

BridgeJobLabel is the common Peloton job level label for all jobs created by aurora bridge.

View Source
var BridgePodLabel = &peloton.Label{
	Key:   "aurora_bridge_pod",
	Value: "com.uber.peloton.internal.aurorabridge_pod",
}

BridgePodLabel is the common Peloton pod level label for all jobs created by aurora bridge.

Functions

func ConvertTimestampToUnixMS

func ConvertTimestampToUnixMS(timestamp string) (*int64, error)

ConvertTimestampToUnixMS converts Peloton event timestamp string (in seconds) to unix time in milliseconds used by Bridge.

func Hash

func Hash(s string) uint32

Hash creates 32-bit FNV-1a hash for string

func IsPodSpecWithoutBridgeUpdateLabelChanged

func IsPodSpecWithoutBridgeUpdateLabelChanged(
	prevSpec *pod.PodSpec,
	newSpec *pod.PodSpec,
) bool

IsPodSpecWithoutBridgeUpdateLabelChanged check if two PodSpec without "bridge update label" are changed.

func RemoveBridgeUpdateLabel

func RemoveBridgeUpdateLabel(podSpec *pod.PodSpec) string

RemoveBridgeUpdateLabel removes "bridge update label" from pod spec and returns the label value.

Types

type JobUpdateStatusSet

type JobUpdateStatusSet struct {
	// contains filtered or unexported fields
}

JobUpdateStatusSet is an immutable set of JobUpdateStatuses.

func NewJobUpdateStatusSet

func NewJobUpdateStatusSet(statuses ...api.JobUpdateStatus) *JobUpdateStatusSet

NewJobUpdateStatusSet creates a new JobUpdateStatusSet.

func (*JobUpdateStatusSet) Has

Has returns whether x is in s.

func (*JobUpdateStatusSet) String

func (s *JobUpdateStatusSet) String() string

type Random

type Random interface {
	RandomUUID() string
}

Random defines an interface for generating random string.

type RandomImpl

type RandomImpl struct{}

RandomImpl implements Random interface

func (RandomImpl) RandomUUID

func (r RandomImpl) RandomUUID() string

RandomUUID proxies call to uuid.New() function and returns a random UUID string

Jump to

Keyboard shortcuts

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