-
Notifications
You must be signed in to change notification settings - Fork 35
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
Fix: Add a TTL on build containers for cleanup #819
base: main
Are you sure you want to change the base?
Fix: Add a TTL on build containers for cleanup #819
Conversation
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.
Two small comments, otherwise LGTM
case <-done: | ||
return | ||
case <-ticker.C: | ||
b.rdb.Set(ctx, Keys.imageContainerTTL(containerId), "1", time.Duration(imageContainerTtlS)*time.Second).Err() |
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.
Should this be called imageBuildContainerTTL? I know it's technically the "image" service, but the prefix on containers is build-
@@ -194,3 +245,15 @@ func convertBuildSteps(buildSteps []*pb.BuildStep) []BuildStep { | |||
} | |||
return steps | |||
} | |||
|
|||
var ( | |||
imageContainerTTL string = "image:container_ttl:%s" |
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.
maybe call this image:build_container_ttl
and var imageBuildContainerTTL
} | ||
|
||
const containerKeepAliveIntervalS int = 30 |
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.
Var names could be improved here. Maybe buildContainerKeepAliveIntervalS
and imageBuildContainerTtlS
Added a key event manager to image service with a imageContainerTTL key to identified expired build containers