Skip to content

Commit 899d58d

Browse files
Support newly added option for GPUs in Dirigent.
Signed-off-by: Luka Simić <git@kocka.tech>
1 parent 233ddb9 commit 899d58d

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

pkg/config/parser.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ type LoaderConfiguration struct {
6060
RpsImage string `json:"RpsImage"`
6161
RpsRuntimeMs int `json:"RpsRuntimeMs"`
6262
RpsMemoryMB int `json:"RpsMemoryMB"`
63+
RpsRequestedGpu int `json:"RpsRequestedGpu"`
6364
RpsIterationMultiplier int `json:"RpsIterationMultiplier"`
6465
RpsDataSizeMB float64 `json:"RpsDataSizeMB"`
6566
RpsFile string `json:"RpsFile"`

pkg/driver/deployment/dirigent.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ package deployment
22

33
import (
44
"fmt"
5-
log "github.com/sirupsen/logrus"
6-
"github.com/vhive-serverless/loader/pkg/common"
7-
"github.com/vhive-serverless/loader/pkg/config"
85
"io"
96
"math/rand"
107
"net"
@@ -14,6 +11,10 @@ import (
1411
"strings"
1512
"sync"
1613
"time"
14+
15+
log "github.com/sirupsen/logrus"
16+
"github.com/vhive-serverless/loader/pkg/common"
17+
"github.com/vhive-serverless/loader/pkg/config"
1718
)
1819

1920
type dirigentDeployer struct{}
@@ -47,6 +48,7 @@ func (*dirigentDeployer) Deploy(cfg *config.Configuration) {
4748
dirigentConfig.RegistrationServer,
4849
cfg.LoaderConfiguration.BusyLoopOnSandboxStartup,
4950
cfg.LoaderConfiguration.PrepullMode,
51+
cfg.LoaderConfiguration.RpsRequestedGpu,
5052
)
5153
}(i)
5254
}
@@ -80,7 +82,7 @@ var checkClient = &http.Client{
8082
},
8183
}
8284

83-
func deployDirigent(function *common.Function, controlPlaneAddress string, busyLoopOnColdStart bool, prepullMode string) {
85+
func deployDirigent(function *common.Function, controlPlaneAddress string, busyLoopOnColdStart bool, prepullMode string, requestedGpu int) {
8486
metadata := function.DirigentMetadata
8587

8688
if metadata == nil {
@@ -95,6 +97,7 @@ func deployDirigent(function *common.Function, controlPlaneAddress string, busyL
9597
"scaling_lower_bound": {strconv.Itoa(metadata.ScalingLowerBound)},
9698
"requested_cpu": {strconv.Itoa(function.CPURequestsMilli)},
9799
"requested_memory": {strconv.Itoa(function.MemoryRequestsMiB)},
100+
"requested_gpu": {strconv.Itoa(requestedGpu)},
98101
"env_vars": metadata.EnvVars, // FORMAT: arg1=value1 arg2=value2 ...
99102
"program_args": metadata.ProgramArgs, // FORMAT: arg1 arg2 ...
100103
"prepull_mode": {prepullMode},

0 commit comments

Comments
 (0)