Skip to content
This repository was archived by the owner on Jan 29, 2025. It is now read-only.

Commit 74c1b99

Browse files
uniemimumadalazar
authored andcommitted
Allow controlling qps and burst
This adds flags for setting burst and qps. The go-code defaults match the old zero-values which resulted in 10 and 5 being used. Deployment default is raised to match new performance enhancements of the gpu plugin. Values are capped to 1000 and negatives are not accepted. Giving zeroes will result in 10 and 5 being used. Signed-off-by: Ukri Niemimuukko <[email protected]>
1 parent 7e482ce commit 74c1b99

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed

gpu-aware-scheduling/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ name |type | description| usage | default|
9999
|enableAllowlist| bool | enable POD-annotation based GPU allowlist feature | --enableAllowlist| false
100100
|enableDenylist| bool | enable POD-annotation based GPU denylist feature | --enableDenylist| false
101101
|balancedResource| string | enable named resource balancing between GPUs | --balancedResource| ""
102+
|burst| int | burst value to use with kube client | --burst| 10
103+
|qps| int | qps value to use with kube client | --qps| 5
102104

103105
Some features are based on the labels put onto pods, for full features list see [usage doc](docs/usage.md)
104106

gpu-aware-scheduling/cmd/gas-scheduler-extender/main.go

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ package main
55

66
import (
77
"flag"
8+
"fmt"
89
"os"
910

1011
"github.com/intel/platform-aware-scheduling/extender"
@@ -22,13 +23,17 @@ var (
2223
)
2324

2425
const (
25-
l1 = klog.Level(1)
26+
l1 = klog.Level(1)
27+
defaultQPS = 5
28+
defaultBurst = 10
29+
maxQPSandBurst = 1000
2630
)
2731

2832
func main() {
2933
var (
3034
kubeConfig, port, certFile, keyFile, caFile, balancedRes string
3135
enableAllowlist, enableDenylist bool
36+
burst, qps uint
3237
)
3338

3439
flag.StringVar(&kubeConfig, "kubeConfig", "/root/.kube/config", "location of kubernetes config file")
@@ -39,12 +44,22 @@ func main() {
3944
flag.BoolVar(&enableAllowlist, "enableAllowlist", false, "enable allowed GPUs annotation (csv list of names)")
4045
flag.BoolVar(&enableDenylist, "enableDenylist", false, "enable denied GPUs annotation (csv list of names)")
4146
flag.StringVar(&balancedRes, "balancedResource", "", "enable resource balacing within a node")
47+
flag.UintVar(&burst, "burst", defaultBurst, fmt.Sprintf("burst value used with kube client (limited to %d)", maxQPSandBurst))
48+
flag.UintVar(&qps, "qps", defaultQPS, fmt.Sprintf("qps value used with kube client (limited to %d)", maxQPSandBurst))
4249
klog.InitFlags(nil)
4350
flag.Parse()
4451

4552
klog.V(l1).Infof("%s built on %s with go %s", version, buildDate, goVersion)
4653

47-
kubeClient, _, err := extender.GetKubeClient(kubeConfig)
54+
for _, ptr := range []*uint{&qps, &burst} {
55+
if *ptr > maxQPSandBurst {
56+
klog.Warningf("Given flag value %d is too high. Limited to %d.", *ptr, maxQPSandBurst)
57+
*ptr = maxQPSandBurst
58+
}
59+
}
60+
61+
kubeClient, _, err := extender.GetKubeClientExt(kubeConfig, int(burst), float32(qps))
62+
4863
if err != nil {
4964
klog.Error("couldn't get kube client, cannot continue: ", err.Error())
5065
os.Exit(1)

gpu-aware-scheduling/deploy/gas-deployment.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ spec:
2323
- "--cert=/gas/cert/tls.crt"
2424
- "--key=/gas/cert/tls.key"
2525
- "--cacert=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt"
26+
- "--burst=100"
27+
- "--qps=50"
2628
- "--v=4"
2729
image: intel/gpu-extender
2830
imagePullPolicy: IfNotPresent

0 commit comments

Comments
 (0)