Skip to content

Commit

Permalink
Fix: prevent C/R during serves (#755)
Browse files Browse the repository at this point in the history
  • Loading branch information
luke-lombardi authored Dec 4, 2024
1 parent 35df058 commit 70a0e7d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion pkg/abstractions/endpoint/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ func (i *endpointInstance) startContainers(containersToRun int) error {
gpuCount = 1
}

checkpointEnabled := i.StubConfig.CheckpointEnabled
if i.Stub.Type.IsServe() {
checkpointEnabled = false
}

for c := 0; c < containersToRun; c++ {
containerId := i.genContainerId()

Expand All @@ -90,7 +95,7 @@ func (i *endpointInstance) startContainers(containersToRun int) error {
EntryPoint: i.EntryPoint,
Mounts: mounts,
Stub: *i.Stub,
CheckpointEnabled: i.StubConfig.CheckpointEnabled,
CheckpointEnabled: checkpointEnabled,
}

// Set initial keepwarm to prevent rapid spin-up/spin-down of containers
Expand Down
7 changes: 6 additions & 1 deletion pkg/abstractions/taskqueue/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ func (i *taskQueueInstance) startContainers(containersToRun int) error {
gpuCount = 1
}

checkpointEnabled := i.StubConfig.CheckpointEnabled
if i.Stub.Type.IsServe() {
checkpointEnabled = false
}

for c := 0; c < containersToRun; c++ {
runRequest := &types.ContainerRequest{
ContainerId: i.genContainerId(),
Expand All @@ -85,7 +90,7 @@ func (i *taskQueueInstance) startContainers(containersToRun int) error {
EntryPoint: i.EntryPoint,
Mounts: mounts,
Stub: *i.Stub,
CheckpointEnabled: i.StubConfig.CheckpointEnabled,
CheckpointEnabled: checkpointEnabled,
}

err := i.Scheduler.Run(runRequest)
Expand Down

0 comments on commit 70a0e7d

Please sign in to comment.