-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: Add min_containers to QueueDepthAutoscaler and instance controller for loading and reloading instances #846
Feat: Add min_containers to QueueDepthAutoscaler and instance controller for loading and reloading instances #846
Conversation
pkg/abstractions/common/instance.go
Outdated
} | ||
|
||
func (ic *InstanceController) reload(stubId, stubType string) error { | ||
if stubType != types.StubTypeEndpointDeployment && stubType != types.StubTypeASGIDeployment { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you remind me why we have this check? isn't this used for taskqueues as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is wrong. I didnt remove this piece of code when consolidating the logic.
endpointInstances *common.SafeMap[*endpointInstance] | ||
tailscale *network.Tailscale | ||
taskDispatcher *task.Dispatcher | ||
instanceController *abstractions.InstanceController |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we just call it controller?
}}, | ||
) | ||
go eventBus.ReceiveEvents(ctx) | ||
es.instanceController = abstractions.NewInstanceController(ctx, es.InstanceFactory, []string{types.StubTypeEndpointDeployment, types.StubTypeASGIDeployment}, es.backendRepo, es.rdb) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment as above
queueClient *taskQueueClient | ||
tailscale *network.Tailscale | ||
eventRepo repository.EventRepository | ||
instanceController *abstractions.InstanceController |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment
stubId := e.Args["stub_id"].(string) | ||
stubType := e.Args["stub_type"].(string) | ||
|
||
if stubType != types.StubTypeTaskQueueDeployment { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jsun-m the place where you're doing the correctStub
check, you need to return true I think or else it will resend the event
Add min_containers field that allows users to set a the minimum amount of containers to keep warm when there is no activity.
Follow up: