-
Notifications
You must be signed in to change notification settings - Fork 889
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: honour server port when coming from config #1105
base: main
Are you sure you want to change the base?
Conversation
I would like to add unit test for this, but given the current structure of the test, I'm seeking some guidance on where the right place should be. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you.
8d4b81f
to
bb8cc99
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly, I don't know if we need to support this much complexity here at all. What if we just allowed two ways to specify a port?
config.server.port
is obviously the most reasonable path and is choice number one- followed by
--port
which takes precedence if specified
We should kill the environment variable use of LLAMA_STACK_PORT
The environment variable is quite common in my opinion. CLI tools like Click, for example, support it natively. I don’t have a strong preference, but environment variables can be very useful. @ashwinb I don't mind removing the env support though, what's the final decision? Thanks! |
Ensure that the options follow the correct priority order: 1. Environment variable (eg: `LLAMA_STACK_PORT`) takes the highest precedence. 2. CLI flag (`--port`) is considered only if the env variable is unset. 3. Config file value (`config.server.port`) is used as a fallback. 4. Default port (`8321`) is the last resort. Closes: meta-llama#1076 Signed-off-by: Sébastien Han <[email protected]>
FWIW environment variables are extremely common in Kubernetes environments for configuring the way things run. I would agree that supporting ENV is valuable. |
What does this PR do?
Ensure that the options follow the correct priority order:
LLAMA_STACK_PORT
) takes the highest precedence.--port
) is considered only if the env variable is unset.config.server.port
) is used as a fallback.8321
) is the last resort.Closes: #1076
Test Plan
Unit tests need #1004 to run properly.