plane icon indicating copy to clipboard operation
plane copied to clipboard

Allow a spawn request which does not pull the image

Open paulgb opened this issue 2 years ago • 4 comments

This is something I've wanted to do to reduce cold start times when we know we have the image locally, and has also been requested by @mycaddev via Discord.

paulgb avatar Nov 21 '22 23:11 paulgb

I can do this tom! Should just be matter of putting the pull behind a conditional right? And adding a field to the request.

pretentious7 avatar Nov 21 '22 23:11 pretentious7

I think we should support three pull policies like Kubernetes does:

  • IfNotPresent should be the default. It pulls only if we don't already have the image. We would switch to this for our own use case.
  • Always is the current behavior. Always run a Docker pull, even if the image does not exist.
  • Never never pull the image. If it doesn't exist, the backend status should be ErrorLoading. This would be the pull policy that @MyCADDev would use.

This would become a field on the DockerExecutableConfig rather than the SpawnRequest itself.

paulgb avatar Nov 22 '22 14:11 paulgb

Oops have to add this to the cli before closing.

pretentious7 avatar Nov 23 '22 15:11 pretentious7

Just tried it via NATS API - works like a charm. Thanks @paulgb and @pretentious7

MyCADDev avatar Nov 24 '22 01:11 MyCADDev

@pretentious7 I think it's not necessary for this to be in the cli, but we can discuss if you want to. I'll close this for now because the feature is done.

paulgb avatar Dec 05 '22 17:12 paulgb