8000 refactor(cli): remove read_only option by hanxiao · Pull Request #2509 · jina-ai/serve · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

refactor(cli): remove read_only option #2509

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

Merged
merged 1 commit into from
May 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/2.0/cookbooks/Executor.md
8000
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ In 2.0rc1, the following fields are valid for `metas` and `runtime_args`:
|||
| --- | --- |
| `.metas` (static values from hard-coded values, YAML config) | `name`, `description`, `py_modules`, `workspace` |
| `.runtime_args` (runtime values from its containers, e.g. `Runtime`, `Pea`, `Pod`) | `name`, `description`, `workspace`, `log_config`, `quiet`, `quiet_error`, `identity`, `port_ctrl`, `ctrl_with_ipc`, `timeout_ctrl`, `ssh_server`, `ssh_keyfile`, `ssh_password`, `uses`, `py_modules`, `port_in`, `port_out`, `host_in`, `host_out`, `socket_in`, `socket_out`, `read_only`, `memory_hwm`, `on_error_strategy`, `num_part`, `uses_internal`, `entrypoint`, `docker_kwargs`, `pull_latest`, `volumes`, `host`, `port_expose`, `quiet_remote_logs`, `upload_files`, `workspace_id`, `daemon`, `runtime_backend`, `runtime_cls`, `timeout_ready`, `env`, `expose_public`, `pea_id`, `pea_role`, `noblock_on_start`, `uses_before`, `uses_after`, `parallel`, `replicas`, `polling`, `scheduling`, `pod_role`, `peas_hosts` |
| `.runtime_args` (runtime values from its containers, e.g. `Runtime`, `Pea`, `Pod`) | `name`, `description`, `workspace`, `log_config`, `quiet`, `quiet_error`, `identity`, `port_ctrl`, `ctrl_with_ipc`, `timeout_ctrl`, `ssh_server`, `ssh_keyfile`, `ssh_password`, `uses`, `py_modules`, `port_in`, `port_out`, `host_in`, `host_out`, `socket_in`, `socket_out`, `memory_hwm`, `on_error_strategy`, `num_part`, `uses_internal`, `entrypoint`, `docker_kwargs`, `pull_latest`, `volumes`, `host`, `port_expose`, `quiet_remote_logs`, `upload_files`, `workspace_id`, `daemon`, `runtime_backend`, `runtime_cls`, `timeout_ready`, `env`, `expose_public`, `pea_id`, `pea_role`, `noblock_on_start`, `uses_before`, `uses_after`, `parallel`, `replicas`, `polling`, `scheduling`, `pod_role`, `peas_hosts` |

Note that the YAML API will ignore `.runtime_args` during save and load as they are not statically stored.

Expand Down
29 changes: 12 additions & 17 deletions cli/autocomplete.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ def _gaa(key, parser):
'--host-out',
'--socket-in',
'--socket-out',
'--read-only',
'--memory-hwm',
'--on-error-strategy',
'--num-part',
Expand All @@ -111,6 +110,7 @@ def _gaa(key, parser):
'--volumes',
'--host',
'--port-expose',
'--proxy',
'--quiet-remote-logs',
'--upload-files',
'--workspace-id',
Expand Down Expand 8000 Up @@ -157,7 +157,6 @@ def _gaa(key, parser):
'--host-out',
'--socket-in',
'--socket-out',
'--read-only',
'--memory-hwm',
'--on-error-strategy',
'--num-part',
Expand All @@ -168,6 +167,7 @@ def _gaa(key, parser):
'--volumes',
'--host',
'--port-expose',
'--proxy',
'--quiet-remote-logs',
'--upload-files',
'--workspace-id',
Expand Down Expand Up @@ -227,21 +227,22 @@ def _gaa(key, parser):
'--host-out',
'--socket-in',
'--socket-out',
'--read-only',
'--memory-hwm',
'--on-error-strategy',
'--num-part',
'--max-message-size',
'--proxy',
'--prefetch',
'--prefetch-on-recv',
'--restful',
'--rest-api',
'--compress',
'--compress-min-bytes',
'--compress-min-ratio',
'--including-default-value-fields',
'--sort-keys',
'--use-integers-for-enums',
'--float-precision',
'--host',
'--port-expose',
'--proxy',
'--daemon',
'--runtime-backend',
'--runtime',
Expand All @@ -252,6 +253,8 @@ def _gaa(key, parser):
'--pea-id',
'--pea-role',
'--noblock-on-start',
'--restful',
'--rest-api',
],
'pea': [
'--help',
Expand All @@ -276,7 +279,6 @@ def _gaa(key, parser):
'--host-out',
'--socket-in',
'--socket-out',
'--read-only',
'--memory-hwm',
'--on-error-strategy',
'--num-part',
Expand All @@ -287,6 +289,7 @@ def _gaa(key, parser):
'--volumes',
'--host',
'--port-expose',
'--proxy',
'--quiet-remote-logs',
'--upload-files',
'--workspace-id',
Expand All @@ -304,20 +307,12 @@ def _gaa(key, parser):
'client': [
'--help',
'--request-size',
'--mime-type',
'--continue-on-error',
'--show-progress',
'--return-results',
'--max-message-size',
'--proxy',
'--prefetch',
'--prefetch-on-recv',
'--restful',
'--rest-api',
'--compress',
'--compress-min-bytes',
'--compress-min-ratio',
'--host',
'--port-expose',
'--proxy',
],
'export-api': ['--help', '--yaml-path', '--json-path', '--schema-path'],
'check': ['--help', '--summary-exec'],
Expand Down
1 change: 0 additions & 1 deletion jina/flow/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ def _add_gateway(self, needs, **kwargs):
dict(
name=pod_name,
ctrl_with_ipc=True, # otherwise ctrl port would be conflicted
read_only=True,
runtime_cls='GRPCRuntime'
if self._cls_client == Client
else 'RESTRuntime',
Expand Down
3 changes: 2 additions & 1 deletion jina/flow/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,9 @@ def _connect_two_nodes(flow: 'Flow', start_node_name: str, end_node_name: str):
def _connect(
first: 'BasePod', second: 'BasePod', first_socket_type: 'SocketType'
) -> None:
"""Connect two Pods
"""Connect two Pods.

This will change the args of the tail Pea of the first, and the args of the head pea of the second.

.. # noqa: DAR401
:param first: the first BasePod
Expand Down
1 change: 0 additions & 1 deletion jina/parsers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ def set_gateway_parser(parser=None):
socket_in=SocketType.PULL_CONNECT, # otherwise there can be only one client at a time
socket_out=SocketType.PUSH_CONNECT,
ctrl_with_ipc=True, # otherwise ctrl port would be conflicted
read_only=True,
runtime_cls='GRPCRuntime',
pod_role=PodRoleType.GATEWAY,
)
Expand Down
8 changes: 0 additions & 8 deletions jina/parsers/peapods/runtimes/zed.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,6 @@ def mixin_zed_runtime_parser(parser):
help='The socket type for output port',
)

gp.add_argument(
'--read-only',
action='store_true',
default=False,
help='If set, do not allow the pod to modify the model, '
'dump_interval will be ignored',
)

gp.add_argument(
'--memory-hwm',
type=int,
Expand Down
0