Documentation ¶
Index ¶
- Constants
- func Add(left *si.Resource, right *si.Resource) *si.Resource
- func CreateReleaseAllocationRequestForTask(appID, allocUUID, partition string) si.UpdateRequest
- func CreateReleaseAskRequestForTask(appID, taskId, partition string) si.UpdateRequest
- func CreateUpdateRequestForDeleteNode(node Node) si.UpdateRequest
- func CreateUpdateRequestForNewNode(node Node) si.UpdateRequest
- func CreateUpdateRequestForRemoveApplication(appID, partition string) si.UpdateRequest
- func CreateUpdateRequestForTask(appID, taskID string, resource *si.Resource, pod *v1.Pod) si.UpdateRequest
- func CreateUpdateRequestForUpdatedNode(node Node) si.UpdateRequest
- func Equals(left *si.Resource, right *si.Resource) bool
- func GetNodeResource(nodeStatus *v1.NodeStatus) *si.Resource
- func GetPodResource(pod *v1.Pod) (resource *si.Resource)
- func IsZero(r *si.Resource) bool
- func ParseResource(cpuStr, memStr string) *si.Resource
- func Sub(left *si.Resource, right *si.Resource) *si.Resource
- type Node
- type ResourceBuilder
Constants ¶
const AppTagNamespace = "namespace"
const AppTagNamespaceResourceQuota = "namespace.resourcequota"
const ApplicationDefaultQueue = "root.sandbox"
const CPU = "vcore"
const DefaultAppNamespace = "default"
const DefaultConfigMapName = "yunikorn-configs"
Configuration
const DefaultNodeAttributeHostNameKey = "si.io/hostname"
Cluster
const DefaultNodeAttributeRackNameKey = "si.io/rackname"
const DefaultPartition = "default"
const DefaultRackName = "/rack-default"
const LabelApp = "app"
Application
const LabelApplicationID = "applicationId"
const LabelQueueName = "queue"
const Memory = "memory"
Resource
const SchedulerName = "yunikorn"
const SparkLabelAppID = "spark-app-selector"
Spark
const SparkLabelRole = "spark-role"
const SparkLabelRoleDriver = "driver"
Variables ¶
This section is empty.
Functions ¶
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 CreateUpdateRequestForUpdatedNode ¶
func CreateUpdateRequestForUpdatedNode(node Node) si.UpdateRequest
func GetNodeResource ¶
func GetNodeResource(nodeStatus *v1.NodeStatus) *si.Resource
func GetPodResource ¶
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 ParseResource ¶
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
Types ¶
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
stores info about what scheduler cares about a node
func CreateFrom ¶
func CreateFromNodeSpec ¶
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