feat: implement ps scale task#121
Merged
josegonzalez merged 5 commits intomasterfrom Apr 25, 2026
Merged
Conversation
Adds PsScaleTask that manages process scaling for dokku applications, compatible with the upstream ansible-dokku dokku_ps_scale module. Supports idempotent scaling with skip_deploy option. Integration tests deploy dokku/smoke-test-app:dockerfile and verify container counts via docker inspect. Service link test enhanced with docker exec verification of REDIS_URL inside running containers.
… in tests getPsScale() now strips whitespace and splits on colons, matching the upstream ansible module's parsing of dokku ps:scale output format. Integration tests run dokku cleanup before verifying container counts to remove old containers from previous deploy generations.
Dokku renames old containers with a timestamp suffix (app.web.1.TIMESTAMP) and interim containers use an .upcoming- suffix during deploys. These renamed containers may still be running during the wait-to-retire period. Replace dokkuCleanup/getRunningContainers with getActiveContainers that filters docker ps results by container name, only including containers with exactly 3 dot-separated segments (app.process.N) which are the active deployment containers.
Old containers from previous deploys may still be running during the wait-to-retire period (default 60s). Force-retire and cleanup before each container count check to ensure accurate results.
Read container IDs from dokku's internal CONTAINER.process.N files instead of filtering docker ps output. These files are the authoritative source for current deployment containers and are properly updated when scaling down (stale files are removed during deploy). This avoids issues with orphaned containers from previous deployments that may still be running but are no longer part of the current formation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PsScaleTaskimplementingdokku_ps_scale, compatible with the upstream ansible-dokku moduleapp,scale(map of process type to count),skip_deploy, andstate(present only) parametersdokku/smoke-test-app:dockerfileand verify container counts viadocker inspectREDIS_URLinside running container viadocker execgit:from-imagetest to usedokku/smoke-test-app:dockerfileCloses #11