Add gRPC server inference SSH example - #582
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new inference-ssh/grpc-server example demonstrating an in-container edit/restart loop over SSH for a Python gRPC server on Baseten, including a walkthrough and a self-contained uv project with generated protobuf stubs.
Changes:
- Add a new
grpc-serverinference-SSH example with full README walkthrough, Trussconfig.yaml, and a simple Greeter + gRPC health-check server. - Add a
uv-managed Python project (grpc_greeter) including client, codegen script, and checked-in generated stubs. - Link the new example from the
inference-sshindex README.
Reviewed changes
Copilot reviewed 10 out of 12 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| inference-ssh/README.md | Adds link to the new grpc-server SSH dev-loop example. |
| inference-ssh/grpc-server/README.md | Step-by-step deployment, calling, SSH editing, and restart walkthrough. |
| inference-ssh/grpc-server/config.yaml | Truss config to run an opaque gRPC docker_server with remote_ssh and entr restarts. |
| inference-ssh/grpc-server/project/pyproject.toml | Defines the uv project, runtime deps, and uv run scripts for client/codegen. |
| inference-ssh/grpc-server/project/uv.lock | Locks Python dependencies for the example project. |
| inference-ssh/grpc-server/project/greeter.proto | Proto contract for the Greeter service. |
| inference-ssh/grpc-server/project/src/grpc_greeter/init.py | Package marker/docstring for grpc_greeter. |
| inference-ssh/grpc-server/project/src/grpc_greeter/server.py | gRPC server implementation including gRPC health-check registration. |
| inference-ssh/grpc-server/project/src/grpc_greeter/client.py | Client for calling the deployed model over gRPC with Baseten metadata. |
| inference-ssh/grpc-server/project/src/grpc_greeter/codegen.py | Script to regenerate protobuf/gRPC Python stubs via grpc_tools.protoc. |
| inference-ssh/grpc-server/project/src/grpc_greeter/greeter_pb2.py | Checked-in generated protobuf Python stub. |
| inference-ssh/grpc-server/project/src/grpc_greeter/greeter_pb2_grpc.py | Checked-in generated gRPC Python stub. |
Files not reviewed (1)
- inference-ssh/grpc-server/project/src/grpc_greeter/greeter_pb2.py: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
|
|
||
| class GreeterServicer(greeter_pb2_grpc.GreeterServicer): | ||
| def SayHello(self, request, context): |
There was a problem hiding this comment.
Nit: add request type, I assume this is HelloRequest?.
| @@ -0,0 +1,117 @@ | |||
| # gRPC server dev loop over SSH | |||
There was a problem hiding this comment.
We have already another SSH example. Is the point of this one to show how to do gRPC + SSH in combination specifically? Is SSH with gRPC different than with the vllm example? I'm a bit confused with of the two topics SSH and gRPC is the focus point of this one here .
There was a problem hiding this comment.
Is SSH with gRPC different than with the vllm example?
No, not much different and I agree it may not deserve its own sample, but this was an explicit request by @squidarth to be a separate sample regardless.
What changed
README.mdwalking through how to use it (manually tested).inference-ssh/grpc-server, an inference-SSH example that deploys a Python gRPC server and shows editing its code on a running replica and restarting it in place, no redeploy.Greeterservice plus the standard gRPC health check service (how Baseten judges gRPC health), packaged asgrpc_greeterin a self-contained uv project underproject/.config.yamlruns it as an opaquedocker_serveroverruntime.transport.kind: grpcon port 50051, CPU-only, withremote_sshenabled: stockpython:3.12-slim,external_package_dirsships the project into/packages,uv sync --frozen --no-devinstalls locked runtime deps editable, andentrrestarts the server on any package-file change.uv run grpc-greeter-codegento regenerate them, and auv run grpc-greeter-clientthat calls the deployed model over gRPC.inference-ssh/README.md.