-
Notifications
You must be signed in to change notification settings - Fork 83
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
Support proxy_url and ssl_ca_certs options for gRPC #341
Conversation
The PineconeGRPC client does not currently honor the proxy_url and ssl_ca_certs arguments - they are accepted but silently ignored. This means the gRPC client cannot be used in enviroments which require a proxy to access the Pinecone service. Address by wiring up these two config options to the corresponding options in the underlying grpc library - in addition to them still being passed to the HTTP-based control-plane connections. Usage is very similar to the non-gRPC client - for example: pc = PineconeGRPC(my_api_key, proxy_url="http://localhost:8080", ssl_ca_certs="/path/to/my/ca-cert.pem")
ad94eee
to
2380c6a
Compare
I note that the proxy tests are not currently run via CI. I re-ran them manually (for In non-GRPC mode all tests pass (as before), in GRPC-mode all tests which are supported pass (gRPC doesn't support https:// proxies or proxy auth):
|
Thanks for following up with this. I previously put a lot of effort into trying to get tests with mitmproxy running in CI and ultimately had to bail due to time and other urgent things coming up. You can of course run a docker container in github actions, but I kept running into permissions issues when trying to mount a directory as a volume on the mitmproxy container so I could get the generated cert for testing. Details are a bit vague in my memory now, but I think docker was creating files as root that the test processing outside the container could not access. One day I'll get back to it because it's not great having these tests that don't run automtically. |
Thanks @jhamon. Note we probably don't actually need mitmproxy inside a container for this use-case, we could just download and install directly into the GitHub worker (it's a simple tgz containing just 3 binaries - mitmproxy plus the web and dump variants), or it looks like you can even install via pipx: https://docs.mitmproxy.org/stable/overview-installation/ |
* 'main' of github.com:pinecone-io/pinecone-python-client: [skip ci] Bump version to v4.1.0 Bump tqdm from 4.66.1 to 4.66.3 (pinecone-io#344) Bump idna from 3.4 to 3.7 (pinecone-io#345) Bump jinja2 from 3.1.3 to 3.1.4 (pinecone-io#343) Add better error messages for mistaken `from_texts` and `from_documents` (pinecone-io#342) Support proxy_url and ssl_ca_certs options for gRPC (pinecone-io#341) Remove serverless public preview warnings (pinecone-io#340) [skip ci] Bump version to v4.0.0 Improve upsert throughput by 3x (pinecone-io#334) Remove `merge` workflow and update `build-and-publish-docs` workflow to be manually runnable (pinecone-io#335) [skip ci] Bump version to v3.2.2 [Fix] openapi_config deprecation warning incorrectly shown (pinecone-io#327) Add grpc unit test run, expand testing of VectorFactory (pinecone-io#326) [skip ci] Bump version to v3.2.1 Allow clients to tag requests with a source_tag (pinecone-io#324) [skip ci] Bump version to v3.2.0 Revise proxy configuration, add integration testing (pinecone-io#325) [Fix] Configuring SSL proxy via openapi_config object (pinecone-io#321) Update README.md (pinecone-io#323)
Problem
The PineconeGRPC client does not currently honor the proxy_url and ssl_ca_certs arguments - they are accepted but silently ignored.
This means the gRPC client cannot be used in enviroments which require a proxy to access the Pinecone service.
Solution
Address by wiring up these two config options to the corresponding options in the underlying grpc library - in addition to them still being passed to the HTTP-based control-plane connections.
Usage is very similar to the non-gRPC client - for example:
Type of Change
Test Plan
Proxy tests expanded to also test PineconeGRPC