Repository navigation
fix: allow configure of API binding and workers - #6967
Open
kquinsland01 wants to merge 2 commits into
Open
kquinsland01 wants to merge 2 commits into
kquinsland01 wants to merge 2 commits into
Conversation
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
This branch has not been deployed
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.
The API image hardcodes its bind address and worker count in the Gunicorn command, so deployments must replace the entire command to enable IPv6 or tune process count.
This PR adds a few knobs to change this using env-vars:
0.0.0.0:8080and four workers.KEEP_API_BINDallows opt-in IPv6 (for example[::]:8080); the default bind honorsPORTbut an explicit bind includes its own port.KEEP_API_WORKERSadjusts API worker count;GUNICORN_CMD_ARGSand explicit CLI flags retain their usual higher precedence.The existing entrypoint, Uvicorn worker class, preload, migration/provisioning hooks, and ARQ command remain intact.
Hosts without IPv6 support continue to work with the default configuration and use of IPv6 wildcard listeners will accept IPv4 connections only when the host supports dual-stack sockets.
Validation: nine tests pass against Gunicorn 23.0.0, covering image defaults, environment/CLI precedence, invalid worker counts, hook retention, ARQ/API worker separation, a real IPv4 default listener, and opt-in IPv6 plus host-supported dual-stack connections.
Resolves: #6968