jina-ai / jina

☁️ Build multimodal AI applications with cloud-native stack
https://docs.jina.ai
Apache License 2.0
20.99k stars 2.22k forks source link

Wrong host ip it served really #5401

Closed wqh17101 closed 1 year ago

wqh17101 commented 1 year ago

Describe the bug I start a service

  f = Flow(port=22456, host_in='127.0.0.1', host='127.0.0.1').add(uses=xxxx)

    with f:
        f.block()

And i use neetstat -ant image It seems that it binds to 0.0.0.0 not 127.0.0.1.Why?

Environment jina 3.10.1 docarray 0.17.0 jcloud 0.0.35 jina-hubble-sdk 0.19.1 jina-proto 0.1.13 protobuf 3.20.0 proto-backend cpp grpcio 1.48.0 pyyaml 5.3.1 python 3.7.0 platform Linux platform-release 3.10.0-862.14.1.5.h442.eulerosv2r7.x86_64 platform-version https://github.com/jina-ai/jina/pull/1 SMP Fri May 15 22:01:58 UTC 2020 architecture x86_64 processor x86_64 uid 171880166524263 session-id 22b0ff44-65b2-11ed-8def-9c52f8450567 uptime 2022-11-16T21:25:27.563941 ci-vendor (unset) internal False JINA_DEFAULT_HOST (unset) JINA_DEFAULT_TIMEOUT_CTRL (unset) JINA_DEPLOYMENT_NAME (unset) JINA_DISABLE_UVLOOP (unset) JINA_EARLY_STOP (unset) JINA_FULL_CLI (unset) JINA_GATEWAY_IMAGE (unset) JINA_GRPC_RECV_BYTES (unset) JINA_GRPC_SEND_BYTES (unset) JINA_HUB_NO_IMAGE_REBUILD (unset) JINA_LOG_CONFIG (unset) JINA_LOG_LEVEL (unset) JINA_LOG_NO_COLOR (unset) JINA_MP_START_METHOD (unset) JINA_OPTOUT_TELEMETRY (unset) JINA_RANDOM_PORT_MAX (unset) JINA_RANDOM_PORT_MIN (unset)

JoanFM commented 1 year ago

Hello @wqh17101 ,

host is a parameter that is not for you to use. After all it binds as local and u will be able to connect using 127.0.0.1 or 0.0.0.0 from the same machine.

We may need to make sure that this parameter is not accepted from Flow API, because it is confusing.