Skip to content

image search doesn't work if milvus has a certificate/ssl enabled #264

@cdingIBM

Description

@cdingIBM

When we tried to run the sample code, we keep seeing the following error.

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
File <timed exec>:17

File ~/.pyenv/versions/3.10.0/lib/python3.10/site-packages/towhee/runtime/pipeline.py:101, in Pipeline.output(self, *output_schema)
     [98](https://file+.vscode-resource.vscode-cdn.net/Users/cding/workspace/git/ocp/watsonx/examples/image/text_image_search/~/.pyenv/versions/3.10.0/lib/python3.10/site-packages/towhee/runtime/pipeline.py:98) dag_dict[self._clo_node]['next_nodes'].append(uid)
    [100](https://file+.vscode-resource.vscode-cdn.net/Users/cding/workspace/git/ocp/watsonx/examples/image/text_image_search/~/.pyenv/versions/3.10.0/lib/python3.10/site-packages/towhee/runtime/pipeline.py:100) run_pipe = RuntimePipeline(dag_dict)
--> [101](https://file+.vscode-resource.vscode-cdn.net/Users/cding/workspace/git/ocp/watsonx/examples/image/text_image_search/~/.pyenv/versions/3.10.0/lib/python3.10/site-packages/towhee/runtime/pipeline.py:101) run_pipe.preload()
    [102](https://file+.vscode-resource.vscode-cdn.net/Users/cding/workspace/git/ocp/watsonx/examples/image/text_image_search/~/.pyenv/versions/3.10.0/lib/python3.10/site-packages/towhee/runtime/pipeline.py:102) return run_pipe

File ~/.pyenv/versions/3.10.0/lib/python3.10/site-packages/towhee/runtime/runtime_pipeline.py:153, in RuntimePipeline.preload(self)
    [149](https://file+.vscode-resource.vscode-cdn.net/Users/cding/workspace/git/ocp/watsonx/examples/image/text_image_search/~/.pyenv/versions/3.10.0/lib/python3.10/site-packages/towhee/runtime/runtime_pipeline.py:149) def preload(self):
    [150](https://file+.vscode-resource.vscode-cdn.net/Users/cding/workspace/git/ocp/watsonx/examples/image/text_image_search/~/.pyenv/versions/3.10.0/lib/python3.10/site-packages/towhee/runtime/runtime_pipeline.py:150)     """
    [151](https://file+.vscode-resource.vscode-cdn.net/Users/cding/workspace/git/ocp/watsonx/examples/image/text_image_search/~/.pyenv/versions/3.10.0/lib/python3.10/site-packages/towhee/runtime/runtime_pipeline.py:151)     Preload the operators.
    [152](https://file+.vscode-resource.vscode-cdn.net/Users/cding/workspace/git/ocp/watsonx/examples/image/text_image_search/~/.pyenv/versions/3.10.0/lib/python3.10/site-packages/towhee/runtime/runtime_pipeline.py:152)     """
--> [153](https://file+.vscode-resource.vscode-cdn.net/Users/cding/workspace/git/ocp/watsonx/examples/image/text_image_search/~/.pyenv/versions/3.10.0/lib/python3.10/site-packages/towhee/runtime/runtime_pipeline.py:153)     return _Graph(self._dag_repr.nodes, self._dag_repr.edges, self._operator_pool, self._thread_pool, TimeProfiler(False))

File ~/.pyenv/versions/3.10.0/lib/python3.10/site-packages/towhee/runtime/runtime_pipeline.py:67, in _Graph.__init__(self, nodes, edges, operator_pool, thread_pool, time_profiler, trace_edges)
     [65](https://file+.vscode-resource.vscode-cdn.net/Users/cding/workspace/git/ocp/watsonx/examples/image/text_image_search/~/.pyenv/versions/3.10.0/lib/python3.10/site-packages/towhee/runtime/runtime_pipeline.py:65) self.features = None
     [66](https://file+.vscode-resource.vscode-cdn.net/Users/cding/workspace/git/ocp/watsonx/examples/image/text_image_search/~/.pyenv/versions/3.10.0/lib/python3.10/site-packages/towhee/runtime/runtime_pipeline.py:66) self._time_profiler.record(Event.pipe_name, Event.pipe_in)
---> [67](https://file+.vscode-resource.vscode-cdn.net/Users/cding/workspace/git/ocp/watsonx/examples/image/text_image_search/~/.pyenv/versions/3.10.0/lib/python3.10/site-packages/towhee/runtime/runtime_pipeline.py:67) self._initialize()
     [68](https://file+.vscode-resource.vscode-cdn.net/Users/cding/workspace/git/ocp/watsonx/examples/image/text_image_search/~/.pyenv/versions/3.10.0/lib/python3.10/site-packages/towhee/runtime/runtime_pipeline.py:68) self._input_queue = self._data_queues[0]

File ~/.pyenv/versions/3.10.0/lib/python3.10/site-packages/towhee/runtime/runtime_pipeline.py:83, in _Graph._initialize(self)
     [81](https://file+.vscode-resource.vscode-cdn.net/Users/cding/workspace/git/ocp/watsonx/examples/image/text_image_search/~/.pyenv/versions/3.10.0/lib/python3.10/site-packages/towhee/runtime/runtime_pipeline.py:81) node = create_node(self._nodes[name], self._operator_pool, in_queues, out_queues, self._time_profiler)
...
    :return dict:
  File "/Users/cding/.pyenv/versions/3.10.0/lib/python3.10/site-packages/pymilvus/client/grpc_handler.py", line 150, in _wait_for_channel_ready
    def _setup_db_interceptor(self, db_name):
pymilvus.exceptions.MilvusException: <MilvusException: (code=2, message=Fail connecting to server on na4.services.cloud.techzone.ibm.com:45338, illegal connection params or server unavailable)>
Output is truncated. View as a [scrollable element](command:cellOutput.enableScrolling?6a3ebbd4-2f65-40f8-8ff8-b0085b9545bf) or open in a [text editor](command:workbench.action.openLargeOutput?6a3ebbd4-2f65-40f8-8ff8-b0085b9545bf). Adjust cell output [settings](command:workbench.action.openSettings?%5B%22%40tag%3AnotebookOutputLayout%22%5D)...

Our milvus instance requires a certificate/ssl and we can use connections.connect with the following command. But the towhee pipeline uses milvus_client doesn't allow specifying certificate or security=True as seen below. Is there any way to allow SSL/cert enabled milvus work with Towhee?

 connections.connect(alias='default', secure=True, server_pem_path="/Users/cding/workspace/git/ocp/watsonx/milvus/milvus_grpc_2.cert", server_name=HOST, host=HOST, port=PORT, user=USER, password=PASSWORD)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions