Skip to content

feature request: make container startup timeout configurable #61

@jameslamb

Description

@jameslamb

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.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions