common

package
v0.0.0-...-45855b6 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const AppTagNamespace = "namespace"
View Source
const AppTagNamespaceResourceQuota = "namespace.resourcequota"
View Source
const ApplicationDefaultQueue = "root.sandbox"
View Source
const CPU = "vcore"
View Source
const DefaultAppNamespace = "default"
View Source
const DefaultConfigMapName = "yunikorn-configs"

Configuration

View Source
const DefaultNodeAttributeHostNameKey = "si.io/hostname"

Cluster

View Source
const DefaultNodeAttributeRackNameKey = "si.io/rackname"
View Source
const DefaultPartition = "default"
View Source
const DefaultRackName = "/rack-default"
View Source
const LabelApp = "app"

Application

View Source
const LabelApplicationID = "applicationId"
View Source
const LabelQueueName = "queue"
View Source
const Memory = "memory"

Resource

View Source
const SchedulerName = "yunikorn"
View Source
const SparkLabelAppID = "spark-app-selector"

Spark

View Source
const SparkLabelRole = "spark-role"
View Source
const SparkLabelRoleDriver = "driver"

Variables

This section is empty.

Functions

func Add

func Add(left *si.Resource, right *si.Resource) *si.Resource

func CreateReleaseAllocationRequestForTask

func CreateReleaseAllocationRequestForTask(appID, allocUUID, partition string) si.UpdateRequest

func CreateReleaseAskRequestForTask

func CreateReleaseAskRequestForTask(appID, taskId, partition string) si.UpdateRequest

func CreateUpdateRequestForDeleteNode

func CreateUpdateRequestForDeleteNode(node Node) si.UpdateRequest

func CreateUpdateRequestForNewNode

func CreateUpdateRequestForNewNode(node Node) si.UpdateRequest

func CreateUpdateRequestForRemoveApplication

func CreateUpdateRequestForRemoveApplication(appID, partition string) si.UpdateRequest

func CreateUpdateRequestForTask

func CreateUpdateRequestForTask(appID, taskID string, resource *si.Resource, pod *v1.Pod) si.UpdateRequest

func CreateUpdateRequestForUpdatedNode

func CreateUpdateRequestForUpdatedNode(node Node) si.UpdateRequest

func Equals

func Equals(left *si.Resource, right *si.Resource) bool

func GetNodeResource

func GetNodeResource(nodeStatus *v1.NodeStatus) *si.Resource

func GetPodResource

func GetPodResource(pod *v1.Pod) (resource *si.Resource)

Get the resources from a pod's containers and convert that into a internal resource. A pod has two resource parts: Requests and Limits. Based on the values a pod gets a QOS assigned, as per https://kubernetes.io/docs/tasks/configure-pod-container/quality-service-pod/ QOS class Guaranteed and Burstable are supported. However Burstable is scheduled based on the request values, limits are ignored in the current setup. BestEffort pods are scheduled using a minimum resource of 1MB only.

func IsZero

func IsZero(r *si.Resource) bool

func ParseResource

func ParseResource(cpuStr, memStr string) *si.Resource

parse cpu and memory from string to si.Resource, both of them are optional if parse failed with some errors, log the error and return a nil

func Sub

func Sub(left *si.Resource, right *si.Resource) *si.Resource

Types

type Node

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

stores info about what scheduler cares about a node

func CreateFrom

func CreateFrom(node *v1.Node) Node

func CreateFromNodeSpec

func CreateFromNodeSpec(nodeName string, nodeUID string, nodeResource *si.Resource) Node

func NewNode

func NewNode(name, uid string, capacity *si.Resource, occupied *si.Resource) Node

type ResourceBuilder

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

resource builder is a helper struct to construct si resources

func NewResourceBuilder

func NewResourceBuilder() *ResourceBuilder

func (*ResourceBuilder) AddResource

func (w *ResourceBuilder) AddResource(name string, value int64) *ResourceBuilder

func (*ResourceBuilder) Build

func (w *ResourceBuilder) Build() *si.Resource

Directories

Path Synopsis
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.

Jump to

Keyboard shortcuts

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