Skip to content
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

feature request: make container startup timeout configurable #61

Closed
jameslamb opened this issue May 28, 2024 · 1 comment · Fixed by #65
Closed

feature request: make container startup timeout configurable #61

jameslamb opened this issue May 28, 2024 · 1 comment · Fixed by #65
Assignees
Labels
enhancement New feature or request

Comments

@jameslamb
Copy link
Member

Description

canary validate fails if the container takes more than 10 seconds to start up.

That 10 second threshold is currently hard-coded.

if time.Since(startTime) > (time.Second * 10) {
err := c.Remove()
if err != nil {
return err
}
return errors.New("container failed to start after 10 seconds")
}

That timeout should be configurable.

Benefits of this work

Would allow the use of canary validate with images that take longer than 10 seconds to start up, for example:

  • containers that do some heavy work on startup, like starting a process and polling until it passes health checks)
  • docker daemon that is running slowly, e.g. because it's performing I/O on a network filesystem or is in some other way resource-constrainted

Acceptance Criteria

  • it's possible to modify, via command-line argument(s), how long canary validate waits for a container to start up before timing out

Approach

Modify this

if time.Since(startTime) > (time.Second * 10) {
err := c.Remove()
if err != nil {
return err
}
return errors.New("container failed to start after 10 seconds")
}

such that that 10 second timeout can be altered via configuration.

For example, I'd like to be able to run the following:

canary validate \
   --file ./checks.yaml \
   --startup-timeout 30 \
   ${IMAGE_URI}

Notes

Created this after observing this exact timeout while testing RAPIDS images over in rapidsai/docker#670.

@jameslamb jameslamb added the enhancement New feature or request label May 28, 2024
@jacobtomlinson
Copy link
Member

Yup this sounds great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants