Hot loaded containers? #1225
Replies: 2 comments 3 replies
-
Hi @adameichelkraut , Instead of delegating container warmup to batect, can you try something like mittens? And you can use setup commands to run mittens tasks I hope it helps. |
Beta Was this translation helpful? Give feedback.
-
Sorry for the slow response to this @adameichelkraut. It's another great idea. I'm currently working on some changes (including completely replacing the Docker API client that Batect uses) that should improve some of that overhead, so hopefully that will help mitigate some of this pain. For pre-starting containers, there might be some complications around containers that use images built on the fly - what would you expect Batect to do if you changed the Dockerfile or another file after that image was already built and started for that container? Would you expect it to just ignore it, or restart the containers? Similarly, what would you expect Batect to do if you changed the configuration for those containers in (Not challenging the idea, just trying to understand what you'd expect / assume the behaviour to be as a user.) |
Beta Was this translation helpful? Give feedback.
-
Here's another sneaky idea to think about. The idea of spinning up/down the containers every time adds a non-zero amount of time to any task we plan to do with Batect.
For example, say I have a commit hook that does the following
Typically we would want these to run really quickly to encourage our developers to commit often :) However, it adds maybe an extra ~2-3s to spin up the docker containers per batect task.
What if we were able to tell batect "hey, go ahead and preload these containers in daemon mode -- as I'm going to need them for my development environment". Maybe something akin to
./batect --warm-containers
. Obviously, the sneaky bit here is forgetting that you've warmed these containers and then having your machine run to a crawl eventually after you've preloaded many times.That said, I think the gain is worth the goofs: I'd like to literally run commands at the same speed that I would otherwise be running with batect. Also, prerequisite tasks that use the same container and not need to spin down/spin up the same containers.
Beta Was this translation helpful? Give feedback.
All reactions