Skip to content

Commit d649c32

Browse files
kk-minypwong99
authored andcommitted
feat: Add support for GCR startup CPU boost
1 parent a910222 commit d649c32

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/setup/extract-configuration.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ type SubExperiment struct {
6464
Handler string `json:"Handler"`
6565
Runtime string `json:"Runtime"`
6666
SnapStartEnabled bool `json:"SnapStartEnabled"`
67+
CPUBoostEnabled bool `json:"CPUBoostEnabled"`
6768
PackagePattern string `json:"PackagePattern"`
6869
// All of the below are computed after reading the configuration
6970
BusySpinIncrements []int64 `json:"BusySpinIncrements"`

src/setup/serverless-config.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,13 @@ func (s *Serverless) DeployGCRContainerService(subex *SubExperiment, index int,
435435
name := fmt.Sprintf("%s-%s", randomTag, createName(subex, index, i))
436436
providerFunctionNames["gcr"] = append(providerFunctionNames["gcr"], name) // Used for function removal
437437

438-
gcrDeployCommand := exec.Command("gcloud", "run", "deploy", name, "--image", imageLink, "--allow-unauthenticated", "--region", region)
438+
var gcrDeployCommand *exec.Cmd
439+
if subex.CPUBoostEnabled {
440+
gcrDeployCommand = exec.Command("gcloud", "run", "deploy", name, "--image", imageLink, "--allow-unauthenticated", "--region", region, "--cpu-boost")
441+
} else {
442+
gcrDeployCommand = exec.Command("gcloud", "run", "deploy", name, "--image", imageLink, "--allow-unauthenticated", "--region", region)
443+
}
444+
439445
deployMessage := util.RunCommandAndLog(gcrDeployCommand)
440446
subex.Endpoints = append(subex.Endpoints, EndpointInfo{ID: GetGCREndpointID(deployMessage)})
441447
subex.AddRoute("")

0 commit comments

Comments
 (0)