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
feat: allow multiple port and protocols for gateway #5378
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5378 +/- ##
==========================================
- Coverage 86.99% 86.93% -0.07%
==========================================
Files 101 101
Lines 6606 6667 +61
==========================================
+ Hits 5747 5796 +49
- Misses 859 871 +12
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
fc20396
to
50ecbcc
Compare
'--port', '--port-in', type=str, default=str(helper.random_port()), help=port_description | ||
) | ||
else: | ||
gp.add_argument( |
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.
can u show me a CLI example of how does this work?
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.
jina gateway --port 12345 12345
or
jina gateway --port 12345
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.
why didn't we do like this in the past for other cases?
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.
not sure, probably we were just fine with the comma separated list of values format
|
||
parser.add_argument( | ||
'--protocol', | ||
nargs='+', |
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.
we need to have a plural alias
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.
What happens if I pass a single one?
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.
It will be read as a list of protocls with 1 element. You can check the behavior here
tests/unit/parsers/peapods/runtimes/test_port_protocol_parser.py
) | ||
else: | ||
gp.add_argument( | ||
'--port', |
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.
we need a plural alias for gateway
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.
I believe with an action we can make sure that these are passed as int to the Python objects so that the code is much cleaner afterwards
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.
Add ports
plural alias
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.
done
50ecbcc
to
28e232f
Compare
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
1 similar comment
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
62d1393
to
740fc21
Compare
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
8068c08
to
6e5f744
Compare
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
This reverts commit c8280dd.
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
📝 Docs are deployed on https://feat-gateway-ports--jina-docs.netlify.app 🎉 |
This PR adds support for multiple ports and protocols for the gateway runtime.
__init__
andconfig_gateway
can receive multiple or single value. Flow.port and Flow.protocol return single or multiple valuesapply the same principle for port_monitoringTBD in a separate PR: bug: list-like args passed as string #5352follow up: refactor: refactor deployment and pod classes to avoid implementing different behavior inside
if self.args.pod_role == PodRoleType.TYPE
checks #5393closes: Customize the output when using custom gateway #5345, make port argument support multiple ports #5343