volcano.sh/volcano@v1.9.0/pkg/scheduler/conf/scheduler_conf.go (about)

     1  /*
     2  Copyright 2018 The Kubernetes Authors.
     3  
     4  Licensed under the Apache License, Version 2.0 (the "License");
     5  you may not use this file except in compliance with the License.
     6  You may obtain a copy of the License at
     7  
     8      http://www.apache.org/licenses/LICENSE-2.0
     9  
    10  Unless required by applicable law or agreed to in writing, software
    11  distributed under the License is distributed on an "AS IS" BASIS,
    12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  See the License for the specific language governing permissions and
    14  limitations under the License.
    15  */
    16  
    17  package conf
    18  
    19  // EnabledActionMap check if a action exist in scheduler configmap. If not exist the value is false.
    20  var EnabledActionMap map[string]bool
    21  
    22  // SchedulerConfiguration defines the configuration of scheduler.
    23  type SchedulerConfiguration struct {
    24  	// Actions defines the actions list of scheduler in order
    25  	Actions string `yaml:"actions"`
    26  	// Tiers defines plugins in different tiers
    27  	Tiers []Tier `yaml:"tiers"`
    28  	// Configurations is configuration for actions
    29  	Configurations       []Configuration   `yaml:"configurations"`
    30  	MetricsConfiguration map[string]string `yaml:"metrics"`
    31  }
    32  
    33  // Tier defines plugin tier
    34  type Tier struct {
    35  	Plugins []PluginOption `yaml:"plugins"`
    36  }
    37  
    38  // Configuration is configuration of action
    39  type Configuration struct {
    40  	// Name is name of action
    41  	Name string `yaml:"name"`
    42  	// Arguments defines the different arguments that can be given to specified action
    43  	Arguments map[string]interface{} `yaml:"arguments"`
    44  }
    45  
    46  // PluginOption defines the options of plugin
    47  type PluginOption struct {
    48  	// The name of Plugin
    49  	Name string `yaml:"name"`
    50  	// EnabledJobOrder defines whether jobOrderFn is enabled
    51  	EnabledJobOrder *bool `yaml:"enableJobOrder"`
    52  	// EnabledHierarchy defines whether hierarchical sharing is enabled
    53  	EnabledHierarchy *bool `yaml:"enableHierarchy"`
    54  	// EnabledJobReady defines whether jobReadyFn is enabled
    55  	EnabledJobReady *bool `yaml:"enableJobReady"`
    56  	// EnabledJobPipelined defines whether jobPipelinedFn is enabled
    57  	EnabledJobPipelined *bool `yaml:"enableJobPipelined"`
    58  	// EnabledTaskOrder defines whether taskOrderFn is enabled
    59  	EnabledTaskOrder *bool `yaml:"enableTaskOrder"`
    60  	// EnabledPreemptable defines whether preemptableFn is enabled
    61  	EnabledPreemptable *bool `yaml:"enablePreemptable"`
    62  	// EnabledReclaimable defines whether reclaimableFn is enabled
    63  	EnabledReclaimable *bool `yaml:"enableReclaimable"`
    64  	// EnablePreemptive defines whether preemptiveFn is enabled
    65  	EnablePreemptive *bool `yaml:"enablePreemptive"`
    66  	// EnabledQueueOrder defines whether queueOrderFn is enabled
    67  	EnabledQueueOrder *bool `yaml:"enableQueueOrder"`
    68  	// EnableClusterOrder defines whether clusterOrderFn is enabled
    69  	EnabledClusterOrder *bool `yaml:"EnabledClusterOrder"`
    70  	// EnabledPredicate defines whether predicateFn is enabled
    71  	EnabledPredicate *bool `yaml:"enablePredicate"`
    72  	// EnabledBestNode defines whether bestNodeFn is enabled
    73  	EnabledBestNode *bool `yaml:"enableBestNode"`
    74  	// EnabledNodeOrder defines whether NodeOrderFn is enabled
    75  	EnabledNodeOrder *bool `yaml:"enableNodeOrder"`
    76  	// EnabledTargetJob defines whether targetJobFn is enabled
    77  	EnabledTargetJob *bool `yaml:"enableTargetJob"`
    78  	// EnabledReservedNodes defines whether reservedNodesFn is enabled
    79  	EnabledReservedNodes *bool `yaml:"enableReservedNodes"`
    80  	// EnabledJobEnqueued defines whether jobEnqueuedFn is enabled
    81  	EnabledJobEnqueued *bool `yaml:"enableJobEnqueued"`
    82  	// EnabledVictim defines whether victimsFn is enabled
    83  	EnabledVictim *bool `yaml:"enabledVictim"`
    84  	// EnabledJobStarving defines whether jobStarvingFn is enabled
    85  	EnabledJobStarving *bool `yaml:"enableJobStarving"`
    86  	// EnabledOverused defines whether overusedFn is enabled
    87  	EnabledOverused *bool `yaml:"enabledOverused"`
    88  	// EnabledAllocatable defines whether allocatable is enabled
    89  	EnabledAllocatable *bool `yaml:"enabledAllocatable"`
    90  	// Arguments defines the different arguments that can be given to different plugins
    91  	Arguments map[string]interface{} `yaml:"arguments"`
    92  }