Skip to content

Commit

Permalink
fix(cli): increase the default timeout-ready (#1893)
Browse files Browse the repository at this point in the history
  • Loading branch information
hanxiao committed Feb 7, 2021
1 parent b967c00 commit 59b4725
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
13 changes: 7 additions & 6 deletions cli/autocomplete.py
Expand Up @@ -32,22 +32,23 @@ def _gaa(key, parser):
_update_autocomplete()

ac_table = {
'commands': ['--help', '--version', '--version-full', 'hello-world', 'pod', 'flow', 'gateway', 'ping', 'check',
'hub', 'pea', 'log', 'client', 'export-api'], 'completions': {
'commands': ['--help', '--version', '--version-full', 'hello-world', 'pod', 'flow', 'optimizer', 'gateway', 'ping',
'check', 'hub', 'pea', 'log', 'client', 'export-api'], 'completions': {
'hello-world': ['--help', '--workdir', '--download-proxy', '--shards', '--parallel', '--uses-index',
'--index-data-url', '--index-labels-url', '--index-request-size', '--uses-query',
'--query-data-url', '--query-labels-url', '--query-request-size', '--num-query', '--top-k'],
'pod': ['--help', '--name', '--log-config', '--identity', '--show-exc-info', '--port-ctrl', '--ctrl-with-ipc',
'pod': ['--help', '--name', '--log-config', '--identity', '--hide-exc-info', '--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', '--dump-interval',
'--read-only', '--memory-hwm', '--on-error-strategy', '--num-part', '--uses-internal', '--entrypoint',
'--docker-kwargs', '--pull-latest', '--volumes', '--host', '--port-expose', '--silent-remote-logs',
'--upload-files', '--workspace-id', '--daemon', '--runtime-backend', '--runtime', '--runtime-cls',
'--timeout-ready', '--env', '--expose-public', '--pea-id', '--pea-role', '--uses-before',
'--uses-after', '--parallel', '--shards', '--polling', '--scheduling', '--pod-role'],
'flow': ['--help', '--name', '--log-config', '--identity', '--show-exc-info', '--uses', '--inspect',
'flow': ['--help', '--name', '--log-config', '--identity', '--hide-exc-info', '--uses', '--inspect',
'--optimize-level'],
'gateway': ['--help', '--name', '--log-config', '--identity', '--show-exc-info', '--port-ctrl',
'optimizer': ['--help', '--name', '--log-config', '--identity', '--hide-exc-info', '--uses', '--output-dir'],
'gateway': ['--help', '--name', '--log-config', '--identity', '--hide-exc-info', '--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',
'--dump-interval', '--read-only', '--memory-hwm', '--on-error-strategy', '--num-part',
Expand All @@ -66,7 +67,7 @@ def _gaa(key, parser):
'hub pull': ['--help', '--username', '--password', '--registry', '--repository', '--no-overwrite'],
'hub list': ['--help', '--name', '--kind', '--keywords', '--type', '--local-only'],
'hub': ['--help', 'login', 'new', 'init', 'create', 'build', 'push', 'pull', 'list'],
'pea': ['--help', '--name', '--log-config', '--identity', '--show-exc-info', '--port-ctrl', '--ctrl-with-ipc',
'pea': ['--help', '--name', '--log-config', '--identity', '--hide-exc-info', '--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', '--dump-interval',
'--read-only', '--memory-hwm', '--on-error-strategy', '--num-part', '--uses-internal', '--entrypoint',
Expand Down
2 changes: 1 addition & 1 deletion jina/parsers/hub/build.py
Expand Up @@ -24,7 +24,7 @@ def mixin_hub_build_parser(parser):
gp.add_argument('--test-level', type=BuildTestLevel.from_string,
choices=list(BuildTestLevel), default=BuildTestLevel.FLOW,
help='If set, the test level when `--test-uses` is set, `NONE` means no test')
gp.add_argument('--timeout-ready', type=int, default=10000,
gp.add_argument('--timeout-ready', type=int, default=60000,
help='The timeout in millisecond to give for the Pod to start before considering a test failed')
gp.add_argument('--host-info', action='store_true', default=False,
help='If set, store the host information during bookkeeping')
Expand Down
2 changes: 1 addition & 1 deletion jina/parsers/peapods/pea.py
Expand Up @@ -24,7 +24,7 @@ def mixin_pea_parser(parser):
gp.add_argument('--runtime-cls', type=str, choices=list_all_runtimes(), default='ZEDRuntime',
help='The runtime class to run inside the Pea')

gp.add_argument('--timeout-ready', type=int, default=10000,
gp.add_argument('--timeout-ready', type=int, default=60000,
help='The timeout in milliseconds of a Pea waits for the runtime to be ready, -1 for waiting '
'forever')

Expand Down
2 changes: 2 additions & 0 deletions jina/peapods/peas/__init__.py
Expand Up @@ -118,6 +118,8 @@ def start(self):
else:
self.logger.success(__ready_msg__)
else:
self.logger.warning(f'{self.runtime!r} timeout after waiting for {self.args.timeout_ready}ms, '
f'if your executor takes time to load, you may increase --timeout-ready')
self.close()
raise TimeoutError(
f'{typename(self)}:{self.name} can not be initialized after {_timeout * 1e3}ms')
Expand Down

0 comments on commit 59b4725

Please sign in to comment.