Skip to content
Draft
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
50 changes: 0 additions & 50 deletions .github/PULL_REQUEST_TEMPLATE.md

This file was deleted.

54 changes: 27 additions & 27 deletions .github/workflows/helm.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
name: Releases
on:
push:
tags:
- v*
# name: Releases
# on:
# push:
# tags:
# - v*

jobs:
releases:
runs-on: ubuntu-latest
permissions:
contents: write
if: github.event_name != 'pull_request'
steps:
- uses: actions/checkout@v4
- uses: azure/setup-helm@v3
with:
version: 'latest'
token: ${{ secrets.GITHUB_TOKEN }}
id: install
- name: Package Helm Chart
if: ${{ github.repository == 'kubernetes-sigs/scheduler-plugins' }}
run: |
helm package ./manifests/install/charts/as-a-second-scheduler
- name: Upload to Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: "*.tgz"
# jobs:
# releases:
# runs-on: ubuntu-latest
# permissions:
# contents: write
# if: github.event_name != 'pull_request'
# steps:
# - uses: actions/checkout@v4
# - uses: azure/setup-helm@v3
# with:
# version: 'latest'
# token: ${{ secrets.GITHUB_TOKEN }}
# id: install
# - name: Package Helm Chart
# if: ${{ github.repository == 'kubernetes-sigs/scheduler-plugins' }}
# run: |
# helm package ./manifests/install/charts/as-a-second-scheduler
# - name: Upload to Release
# uses: softprops/action-gh-release@v1
# if: startsWith(github.ref, 'refs/tags/')
# with:
# files: "*.tgz"
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ RELEASE_IMAGE:=kube-scheduler:$(RELEASE_VERSION)
RELEASE_CONTROLLER_IMAGE:=controller:$(RELEASE_VERSION)
GO_BASE_IMAGE?=golang:$(GO_VERSION)
DISTROLESS_BASE_IMAGE?=gcr.io/distroless/static:nonroot
EXTRA_ARGS=""
EXTRA_ARGS?=""

# VERSION is the scheduler's version
#
Expand Down
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{},
&LooseBinPackArgs{},
)
return nil
}
Expand Down
12 changes: 12 additions & 0 deletions apis/config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,3 +298,15 @@ 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

// LooseBinPackArgs holds arguments used to configure LooseBinPack plugin.
type LooseBinPackArgs struct {
metav1.TypeMeta

// CPU Utilization Threshold in percentage (0-100)
CpuThresholdPercent int64
// Memory Utilization Threshold in percentage (0-100)
MemoryThresholdPercent int64
}
13 changes: 13 additions & 0 deletions apis/config/v1/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,3 +250,16 @@ func SetDefaults_SySchedArgs(obj *SySchedArgs) {
obj.DefaultProfileName = &DefaultSySchedProfileName
}
}

// SetDefaults_LooseBinPackArgs sets the default parameters for the LooseBinPack plugin
func SetDefaults_LooseBinPackArgs(obj *LooseBinPackArgs) {
if obj.CpuThresholdPercent == 0 {
defaultCpuThresholdPercent := int64(85)
obj.CpuThresholdPercent = defaultCpuThresholdPercent
}

if obj.MemoryThresholdPercent == 0 {
defaultMemoryThresholdPercent := int64(85)
obj.MemoryThresholdPercent = defaultMemoryThresholdPercent
}
}
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{},
&LooseBinPackArgs{},
)
return nil
}
Expand Down
12 changes: 12 additions & 0 deletions apis/config/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,3 +297,15 @@ 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

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

// CPU Utilization Threshold in percentage (0-100)
CpuThresholdPercent int64 `json:"cpuThresholdPercent,omitempty"`
// Memory Utilization Threshold in percentage (0-100)
MemoryThresholdPercent int64 `json:"memoryThresholdPercent,omitempty"`
}
32 changes: 32 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.

25 changes: 25 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.

5 changes: 5 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.

50 changes: 19 additions & 31 deletions cmd/scheduler/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,46 +24,34 @@ import (
_ "k8s.io/component-base/metrics/prometheus/version" // for version metric registration
"k8s.io/kubernetes/cmd/kube-scheduler/app"

"sigs.k8s.io/scheduler-plugins/pkg/capacityscheduling"
"sigs.k8s.io/scheduler-plugins/pkg/coscheduling"
"sigs.k8s.io/scheduler-plugins/pkg/networkaware/networkoverhead"
"sigs.k8s.io/scheduler-plugins/pkg/networkaware/topologicalsort"
"sigs.k8s.io/scheduler-plugins/pkg/noderesources"
"sigs.k8s.io/scheduler-plugins/pkg/noderesourcetopology"
"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/sysched"
"sigs.k8s.io/scheduler-plugins/pkg/trimaran/loadvariationriskbalancing"
"sigs.k8s.io/scheduler-plugins/pkg/trimaran/lowriskovercommitment"
"sigs.k8s.io/scheduler-plugins/pkg/trimaran/peaks"
"sigs.k8s.io/scheduler-plugins/pkg/trimaran/targetloadpacking"

// Ensure scheme package is initialized.
_ "sigs.k8s.io/scheduler-plugins/apis/config/scheme"
"sigs.k8s.io/scheduler-plugins/pkg/loosebinpack"
)

func main() {
// Register custom plugins to the scheduler framework.
// Later they can consist of scheduler profile(s) and hence
// used by various kinds of workloads.
command := app.NewSchedulerCommand(
app.WithPlugin(capacityscheduling.Name, capacityscheduling.New),
app.WithPlugin(coscheduling.Name, coscheduling.New),
app.WithPlugin(loadvariationriskbalancing.Name, loadvariationriskbalancing.New),
app.WithPlugin(networkoverhead.Name, networkoverhead.New),
app.WithPlugin(topologicalsort.Name, topologicalsort.New),
app.WithPlugin(noderesources.AllocatableName, noderesources.NewAllocatable),
app.WithPlugin(noderesourcetopology.Name, noderesourcetopology.New),
app.WithPlugin(preemptiontoleration.Name, preemptiontoleration.New),
app.WithPlugin(targetloadpacking.Name, targetloadpacking.New),
app.WithPlugin(lowriskovercommitment.Name, lowriskovercommitment.New),
app.WithPlugin(sysched.Name, sysched.New),
app.WithPlugin(peaks.Name, peaks.New),
// Sample plugins below.
// app.WithPlugin(crossnodepreemption.Name, crossnodepreemption.New),
app.WithPlugin(podstate.Name, podstate.New),
app.WithPlugin(qos.Name, qos.New),
// app.WithPlugin(capacityscheduling.Name, capacityscheduling.New),
// app.WithPlugin(coscheduling.Name, coscheduling.New),
// app.WithPlugin(loadvariationriskbalancing.Name, loadvariationriskbalancing.New),
// app.WithPlugin(networkoverhead.Name, networkoverhead.New),
// app.WithPlugin(topologicalsort.Name, topologicalsort.New),
// app.WithPlugin(noderesources.AllocatableName, noderesources.NewAllocatable),
// app.WithPlugin(noderesourcetopology.Name, noderesourcetopology.New),
// app.WithPlugin(preemptiontoleration.Name, preemptiontoleration.New),
// app.WithPlugin(targetloadpacking.Name, targetloadpacking.New),
// app.WithPlugin(lowriskovercommitment.Name, lowriskovercommitment.New),
// app.WithPlugin(sysched.Name, sysched.New),
// app.WithPlugin(peaks.Name, peaks.New),
// // Sample plugins below.
// // app.WithPlugin(crossnodepreemption.Name, crossnodepreemption.New),
// app.WithPlugin(podstate.Name, podstate.New),
// app.WithPlugin(qos.Name, qos.New),
Comment on lines +37 to +52

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we commenting these out?

If we don't need them, should we just delete?


app.WithPlugin(loosebinpack.Name, loosebinpack.New),
)

code := cli.Run(command)
Expand Down
Loading
Loading