Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement sakkara scheduler plugin #877

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apis/config/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ func addKnownTypes(scheme *runtime.Scheme) error {
&NetworkOverheadArgs{},
&SySchedArgs{},
&PeaksArgs{},
&ClusterTopologyPlacementGroupArgs{},
)
return nil
}
Expand Down
10 changes: 10 additions & 0 deletions apis/config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,3 +298,13 @@ type PowerModel struct {
// Power = K0 + K1 * e ^(K2 * x) : where x is utilisation
// Idle power of node will be K0 + K1
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// ClusterTopologyPlacementGroupArgs holds arguments used to configure ClusterTopologyPlacementGroup plugin.
type ClusterTopologyPlacementGroupArgs struct {
metav1.TypeMeta

// Namespace where the cluster topology configmap is deployed
TopologyConfigMapNameSpace string
}
10 changes: 10 additions & 0 deletions apis/config/v1/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ var (
DefaultSySchedProfileNamespace = "default"
// DefaultSySchedProfileName is the name of the default syscall profile CR for SySched plugin
DefaultSySchedProfileName = "all-syscalls"

// DefaultTopologyConfigMapNameSpace is the default namespace for the cluster topology configmap
DefaultTopologyConfigMapNameSpace = "default"
)

// SetDefaults_CoschedulingArgs sets the default parameters for Coscheduling plugin.
Expand Down Expand Up @@ -250,3 +253,10 @@ func SetDefaults_SySchedArgs(obj *SySchedArgs) {
obj.DefaultProfileName = &DefaultSySchedProfileName
}
}

// SetDefaults_ClusterTopologyPlacementGroupArgs sets the default parameters for ClusterTopologyPlacementGroup plugin
func SetDefaults_ClusterTopologyPlacementGroupArgs(args *ClusterTopologyPlacementGroupArgs) {
if args.TopologyConfigMapNameSpace == nil {
args.TopologyConfigMapNameSpace = &DefaultTopologyConfigMapNameSpace
}
}
1 change: 1 addition & 0 deletions apis/config/v1/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ func addKnownTypes(scheme *runtime.Scheme) error {
&NetworkOverheadArgs{},
&SySchedArgs{},
&PeaksArgs{},
&ClusterTopologyPlacementGroupArgs{},
)
return nil
}
Expand Down
11 changes: 11 additions & 0 deletions apis/config/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,3 +297,14 @@ type PowerModel struct {
// Power = K0 + K1 * e ^(K2 * x) : where x is utilisation
// Idle power of node will be K0 + K1
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +k8s:defaulter-gen=true

// ClusterTopologyPlacementGroupArgs holds arguments used to configure ClusterTopologyPlacementGroup plugin.
type ClusterTopologyPlacementGroupArgs struct {
metav1.TypeMeta `json:",inline"`

// Namespace where the cluster topology configmap is deployed
TopologyConfigMapNameSpace *string `json:"topologyConfigMapNameSpace,omitempty"`
}
34 changes: 34 additions & 0 deletions apis/config/v1/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions apis/config/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions apis/config/v1/zz_generated.defaults.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions apis/config/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions cmd/scheduler/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import (
"sigs.k8s.io/scheduler-plugins/pkg/podstate"
"sigs.k8s.io/scheduler-plugins/pkg/preemptiontoleration"
"sigs.k8s.io/scheduler-plugins/pkg/qos"
"sigs.k8s.io/scheduler-plugins/pkg/sakkara"
"sigs.k8s.io/scheduler-plugins/pkg/sysched"
"sigs.k8s.io/scheduler-plugins/pkg/trimaran/loadvariationriskbalancing"
"sigs.k8s.io/scheduler-plugins/pkg/trimaran/lowriskovercommitment"
Expand Down Expand Up @@ -64,6 +65,7 @@ func main() {
// app.WithPlugin(crossnodepreemption.Name, crossnodepreemption.New),
app.WithPlugin(podstate.Name, podstate.New),
app.WithPlugin(qos.Name, qos.New),
app.WithPlugin(sakkara.Name, sakkara.New),
)

code := cli.Run(command)
Expand Down
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ require (
github.com/dustin/go-humanize v1.0.1
github.com/go-logr/logr v1.4.2
github.com/google/go-cmp v0.6.0
github.com/ibm/chic-sched v0.0.0-20241119203507-1a05686d6d72
github.com/k8stopologyawareschedwg/noderesourcetopology-api v0.1.2
github.com/k8stopologyawareschedwg/podfingerprint v0.2.2
github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/paypal/load-watcher v0.2.4
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.9.0
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842
gonum.org/v1/gonum v0.12.0
k8s.io/api v0.31.2
k8s.io/apimachinery v0.31.2
Expand Down Expand Up @@ -112,7 +114,6 @@ require (
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.26.0 // indirect
golang.org/x/crypto v0.31.0 // indirect
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/net v0.33.0 // indirect
golang.org/x/oauth2 v0.21.0 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2060,6 +2060,8 @@ github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/ianlancetaylor/demangle v0.0.0-20220319035150-800ac71e25c2/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w=
github.com/ianlancetaylor/demangle v0.0.0-20240312041847-bd984b5ce465/go.mod h1:gx7rwoVhcfuVKG5uya9Hs3Sxj7EIvldVofAWIUtGouw=
github.com/ibm/chic-sched v0.0.0-20241119203507-1a05686d6d72 h1:bi8I4P8wkyqmGIzUf9MhPGJ3NAc+Qkxml3Xra38gpj0=
github.com/ibm/chic-sched v0.0.0-20241119203507-1a05686d6d72/go.mod h1:aoGxO2hjXOu5ljdxMwYIS8n6hZXyF4pWhCp51kHm6Yo=
github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
Expand Down
2 changes: 1 addition & 1 deletion manifests/install/charts/as-a-second-scheduler/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ controller:
# as they need extra RBAC privileges on metrics.k8s.io.

plugins:
enabled: ["Coscheduling","CapacityScheduling","NodeResourceTopologyMatch","NodeResourcesAllocatable"]
enabled: ["Coscheduling","CapacityScheduling","NodeResourceTopologyMatch","NodeResourcesAllocatable","ClusterTopologyPlacementGroup"]
disabled: ["PrioritySort"] # only in-tree plugins need to be defined here

# Customize the enabled plugins' config.
Expand Down
26 changes: 26 additions & 0 deletions manifests/sakkara/cluster-topology.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: cluster-topology
namespace: sakkara-scheduler
labels:
"sakkara.topology": ""
data:
name: "cluster-tree"
resource-names: |
[ "cpu", "memory", "nvidia.com/gpu" ]
level-names: |
[ "rack", "node" ]
tree: |
{
"rack-0": {
"node-0": {},
"node-1": {},
"node-2": {}
},
"rack-1": {
"node-3": {},
"node-4": {},
"node-5": {}
}
}
Loading