feat(docker): add docker pause strategy #755
Conversation
|
There was a problem hiding this comment.
Pull request overview
This PR adds a pause strategy option for the Docker provider, allowing containers to be paused instead of stopped when they become idle. This provides faster resume times as container state remains in memory, though at the cost of higher system resource usage.
Key Changes:
- Added a configurable
strategyfield to the Docker provider configuration (options:stoporpause) - Implemented pause/unpause functionality alongside existing stop/start behavior
- Added comprehensive test coverage and validation for the new strategy option
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
.tool-versions |
Specifies Go version 1.25.4 (invalid version - see critical issue) |
sablier.sample.yaml |
Adds docker strategy configuration example |
pkg/config/provider.go |
Adds Docker config struct with strategy field and validation logic |
pkg/config/provider_test.go |
Adds comprehensive tests for Docker strategy validation |
pkg/sabliercmd/root.go |
Registers new CLI flag for docker strategy configuration |
pkg/sabliercmd/provider.go |
Passes strategy parameter to Docker provider initialization |
pkg/sabliercmd/cmd_test.go |
Updates test to include new strategy parameter |
pkg/sabliercmd/testdata/* |
Updates test fixtures with Docker strategy configuration |
pkg/provider/docker/docker.go |
Accepts and stores strategy parameter in provider |
pkg/provider/docker/container_stop.go |
Implements strategy-based routing between stop and pause operations |
pkg/provider/docker/container_start.go |
Implements strategy-based routing between start and unpause operations |
pkg/provider/docker/*_test.go |
Updates all tests to pass strategy parameter and adds new pause/unpause tests |
docs/providers/docker.md |
Documents both stop and pause strategies with configuration examples |
docs/configuration.md |
Adds docker strategy to configuration documentation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
|
Hello @ylecuyer ! Thanks for the pull request! I'm not really sure about the strategy parameter. I've seen that using "strategies" often confuse people instead of using some dedicated configuration such as "use-pause". But I also like it because I might implement the checkpoint feature. |
Codecov Report❌ Patch coverage is
|
|
Nice work @ylecuyer ! I think that's a pretty nice implementation overall! How did you find the testing experience using testcontainers ? I need to enhance the configuration a lot so that it is generated instead. |
|
@acouvreur Thanks for merging the PR
It was good, all transparent I didn't have to worry about anything |
* add tmp test * add strategy config * strategy config * pause / unpause strategy impl * Fix tests * fix compilation * add pause / unpause tests * add doc * add config test * start if not paused * remove test files


Resolves #212
A bit similar to #618
Adds a strategy for the docker provider, either
stoporpause(stopby default for backward compatibility)Stop strategy (unchanged):
stop_strategy.mp4
Pause strategy:
pause_strategy.mp4