Repository navigation
feat(golangGRPCgolang gRPC client code package #873
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,116 @@ | ||||||||||||||||||||||||||||||||||||||
| name: Release gRPC goLang packages | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||||||||
| push: | ||||||||||||||||||||||||||||||||||||||
| branches: [main] | ||||||||||||||||||||||||||||||||||||||
| paths: | ||||||||||||||||||||||||||||||||||||||
| - 'crates/grpc_client/go/**' | ||||||||||||||||||||||||||||||||||||||
| - 'crates/grpc_client/proto/**' | ||||||||||||||||||||||||||||||||||||||
| pull_request: | ||||||||||||||||||||||||||||||||||||||
| branches: [main] | ||||||||||||||||||||||||||||||||||||||
| paths: | ||||||||||||||||||||||||||||||||||||||
| - 'crates/grpc_client/go/**' | ||||||||||||||||||||||||||||||||||||||
| - 'crates/grpc_client/proto/**' | ||||||||||||||||||||||||||||||||||||||
| workflow_dispatch: | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| permissions: | ||||||||||||||||||||||||||||||||||||||
| contents: write | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||||||||
| test: | ||||||||||||||||||||||||||||||||||||||
| name: Test Go Client | ||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||
| - uses: actions/checkout@v6 | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| - name: Set up Go | ||||||||||||||||||||||||||||||||||||||
| uses: actions/setup-go@v5 | ||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||
| go-version: '1.25' | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| - name: Install protoc | ||||||||||||||||||||||||||||||||||||||
| uses: arduino/setup-protoc@v3 | ||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||
| repo-token: ${{ github.token }} | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| - name: Install protoc-gen-go | ||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||
| go install google.golang.org/protobuf/cmd/protoc-gen-go@latest | ||||||||||||||||||||||||||||||||||||||
| go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| - name: Generate Code | ||||||||||||||||||||||||||||||||||||||
| run: bash crates/grpc_client/go/generate.sh | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| # Generated files are ignored, so we don't need to verify clean git tree here. | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| - name: Test | ||||||||||||||||||||||||||||||||||||||
| run: cd crates/grpc_client/go && go test ./... | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| release: | ||||||||||||||||||||||||||||||||||||||
| name: Tag Release | ||||||||||||||||||||||||||||||||||||||
| needs: test | ||||||||||||||||||||||||||||||||||||||
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | ||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||
| - uses: actions/checkout@v6 | ||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||
| fetch-depth: 0 | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| - name: Set up Go | ||||||||||||||||||||||||||||||||||||||
| uses: actions/setup-go@v5 | ||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||
| go-version: '1.25' | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| - name: Install protoc | ||||||||||||||||||||||||||||||||||||||
| uses: arduino/setup-protoc@v3 | ||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||
| repo-token: ${{ github.token }} | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| - name: Install protoc-gen-go | ||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||
| go install google.golang.org/protobuf/cmd/protoc-gen-go@latest | ||||||||||||||||||||||||||||||||||||||
| go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| - name: Generate Code | ||||||||||||||||||||||||||||||||||||||
| run: bash crates/grpc_client/go/generate.sh | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| - name: Commit Generated Code | ||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||
| git config user.name "github-actions[bot]" | ||||||||||||||||||||||||||||||||||||||
| git config user.email "github-actions[bot]@users.noreply.github.com" | ||||||||||||||||||||||||||||||||||||||
| git add -f crates/grpc_client/go/generated | ||||||||||||||||||||||||||||||||||||||
| if [ -d "crates/grpc_client/go/proto" ]; then | ||||||||||||||||||||||||||||||||||||||
| git add -f crates/grpc_client/go/proto | ||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||
| if ! git diff --cached --quiet; then | ||||||||||||||||||||||||||||||||||||||
| git commit -m "chore: include generated code for release [skip ci]" | ||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| - name: Read Version | ||||||||||||||||||||||||||||||||||||||
| id: version | ||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||
| if [ ! -f crates/grpc_client/go/VERSION ]; then | ||||||||||||||||||||||||||||||||||||||
| echo "Error: VERSION file missing" | ||||||||||||||||||||||||||||||||||||||
| exit 1 | ||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||
| VERSION=$(cat crates/grpc_client/go/VERSION | tr -d '[:space:]') | ||||||||||||||||||||||||||||||||||||||
| echo "version=$VERSION" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+89
to
+97
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Quote variable to prevent word splitting (SC2086). The ♻️ Suggested fix - name: Read Version
id: version
run: |
if [ ! -f crates/grpc_client/go/VERSION ]; then
echo "Error: VERSION file missing"
exit 1
fi
- VERSION=$(cat crates/grpc_client/go/VERSION | tr -d '[:space:]')
+ VERSION="$(cat crates/grpc_client/go/VERSION | tr -d '[:space:]')"
echo "version=$VERSION" >> $GITHUB_OUTPUT📝 Committable suggestion
Suggested change
🧰 Tools🪛 actionlint (1.7.11)[error] 91-91: shellcheck reported issue in this script: SC2086:info:6:28: Double quote to prevent globbing and word splitting (shellcheck) 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| - name: Check if tag exists | ||||||||||||||||||||||||||||||||||||||
| id: check_tag | ||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||
| TAG="crates/grpc_client/go/v${{ steps.version.outputs.version }}" | ||||||||||||||||||||||||||||||||||||||
| if git rev-parse "$TAG" >/dev/null 2>&1; then | ||||||||||||||||||||||||||||||||||||||
| echo "exists=true" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||||||||||
| echo "exists=false" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+99
to
+107
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Quote variable expansion in tag check (SC2086). The ♻️ Suggested fix - name: Check if tag exists
id: check_tag
run: |
- TAG="crates/grpc_client/go/v${{ steps.version.outputs.version }}"
+ TAG="crates/grpc_client/go/v${{ steps.version.outputs.version }}"
if git rev-parse "$TAG" >/dev/null 2>&1; then
- echo "exists=true" >> $GITHUB_OUTPUT
+ echo "exists=true" >> "$GITHUB_OUTPUT"
else
- echo "exists=false" >> $GITHUB_OUTPUT
+ echo "exists=false" >> "$GITHUB_OUTPUT"
fi🧰 Tools🪛 actionlint (1.7.11)[error] 101-101: shellcheck reported issue in this script: SC2086:info:3:25: Double quote to prevent globbing and word splitting (shellcheck) [error] 101-101: shellcheck reported issue in this script: SC2086:info:5:26: Double quote to prevent globbing and word splitting (shellcheck) 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| - name: Create and Push Tag | ||||||||||||||||||||||||||||||||||||||
| if: steps.check_tag.outputs.exists == 'false' | ||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||
| TAG="crates/grpc_client/go/v${{ steps.version.outputs.version }}" | ||||||||||||||||||||||||||||||||||||||
| git config user.name "github-actions[bot]" | ||||||||||||||||||||||||||||||||||||||
| git config user.email "github-actions[bot]@users.noreply.github.com" | ||||||||||||||||||||||||||||||||||||||
| git tag "$TAG" | ||||||||||||||||||||||||||||||||||||||
| git push origin "$TAG" | ||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # Generated files | ||
| generated/ | ||
| proto/ |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,45 @@ | ||||||||||||||||||||||
| # SMG gRPC Client (Go) | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| This module contains auto-generated Go gRPC code for Shepherd Model Gateway services (SGLang, vLLM, TRT-LLM). | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ## Installation | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| To use this module in your Go project: | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ```bash | ||||||||||||||||||||||
| go get github.com/lightseek/smg/crates/grpc_client/go | ||||||||||||||||||||||
| ``` | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ## Package Structure | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| The generated code is divided into packages under the `generated` directory: | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| - `generated/common`: Common types (e.g., KV Events) | ||||||||||||||||||||||
| - `generated/sglang_encoder`: SGLang Encoder service | ||||||||||||||||||||||
| - `generated/sglang_scheduler`: SGLang Scheduler service | ||||||||||||||||||||||
| - `generated/trtllm`: TensorRT-LLM Service | ||||||||||||||||||||||
| - `generated/vllm`: vLLM Engine service | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ## Generation | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| To regenerate the code from `.proto` files: | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| 1. Install prerequisites: | ||||||||||||||||||||||
| ```bash | ||||||||||||||||||||||
| go install google.golang.org/protobuf/cmd/protoc-gen-go@latest | ||||||||||||||||||||||
| go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest | ||||||||||||||||||||||
| ``` | ||||||||||||||||||||||
| 2. Run the generation script: | ||||||||||||||||||||||
| ```bash | ||||||||||||||||||||||
| bash generate.sh | ||||||||||||||||||||||
| ``` | ||||||||||||||||||||||
|
Comment on lines
+27
to
+35
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Add blank lines around fenced code blocks for markdown compliance. The fenced code blocks within the numbered list items should be surrounded by blank lines per markdown standards (MD031). ♻️ Suggested fix 1. Install prerequisites:
+
```bash
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
```
+
2. Run the generation script:
+
```bash
bash generate.sh
```📝 Committable suggestion
Suggested change
🧰 Tools🪛 markdownlint-cli2 (0.21.0)[warning] 28-28: Fenced code blocks should be surrounded by blank lines (MD031, blanks-around-fences) [warning] 31-31: Fenced code blocks should be surrounded by blank lines (MD031, blanks-around-fences) [warning] 33-33: Fenced code blocks should be surrounded by blank lines (MD031, blanks-around-fences) 🤖 Prompt for AI Agents |
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| The generated code is committed to **Git release tags** automatically by the CI pipeline for convenience. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| > [!IMPORTANT] | ||||||||||||||||||||||
| > When consuming this module in external projects, you **must** specify a version tag (e.g., `@v1.0.0`). Consuming the `main` branch directly will result in missing generated files due to full-tree `.gitignore`. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ## Release | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Releases are created automatically when the version in the `VERSION` file is updated and merged into `main`. It will create a Git tag: `crates/grpc_client/go/v<VERSION>`. | ||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 0.1.0 |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,3 @@ | ||||||||||||||||||||||||||
| // Package go_client is used to trigger code generation. | ||||||||||||||||||||||||||
| //go:generate bash ./generate.sh | ||||||||||||||||||||||||||
| package go_client | ||||||||||||||||||||||||||
|
Comment on lines
+1
to
+3
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The package name
Suggested change
Comment on lines
+1
to
+3
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Non-idiomatic Go package name. Go package names should be lowercase without underscores. Consider renaming ♻️ Suggested fix-// Package go_client is used to trigger code generation.
+// Package goclient is used to trigger code generation.
//go:generate bash ./generate.sh
-package go_client
+package goclient📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,114 @@ | ||
| #!/bin/bash | ||
| set -e | ||
|
|
||
| # Paths | ||
| SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| PROTO_SOURCE_DIR="$SCRIPT_DIR/../proto" | ||
| GO_PROTO_DIR="$SCRIPT_DIR/proto" | ||
| OUTPUT_DIR="$SCRIPT_DIR/generated" | ||
|
|
||
| # Ensure directories exist | ||
| mkdir -p "$GO_PROTO_DIR" | ||
| rm -rf "$OUTPUT_DIR" | ||
| mkdir -p "$OUTPUT_DIR/common" | ||
| mkdir -p "$OUTPUT_DIR/sglang_encoder" | ||
| mkdir -p "$OUTPUT_DIR/sglang_scheduler" | ||
| mkdir -p "$OUTPUT_DIR/trtllm" | ||
| mkdir -p "$OUTPUT_DIR/vllm" | ||
|
|
||
| # Copy proto files | ||
| echo "Copying proto files..." | ||
| cp "$PROTO_SOURCE_DIR"/*.proto "$GO_PROTO_DIR"/ | ||
|
|
||
| # Find tools in PATH or GOPATH | ||
| PROTOC_GEN_GO=$(which protoc-gen-go || echo "$(go env GOPATH)/bin/protoc-gen-go") | ||
| PROTOC_GEN_GO_GRPC=$(which protoc-gen-go-grpc || echo "$(go env GOPATH)/bin/protoc-gen-go-grpc") | ||
|
|
||
| if [ ! -f "$PROTOC_GEN_GO" ]; then | ||
| echo "Error: protoc-gen-go not found. Please install with: go install google.golang.org/protobuf/cmd/protoc-gen-go@latest" | ||
| exit 1 | ||
| fi | ||
|
|
||
| if [ ! -f "$PROTOC_GEN_GO_GRPC" ]; then | ||
| echo "Error: protoc-gen-go-grpc not found. Please install with: go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Common mappings for imports | ||
| MAPPINGS="--go_opt=Mcommon.proto=github.com/lightseek/smg/crates/grpc_client/go/generated/common" | ||
| MAPPINGS_GRPC="--go-grpc_opt=Mcommon.proto=github.com/lightseek/smg/crates/grpc_client/go/generated/common" | ||
|
|
||
| echo "Generating Go code..." | ||
|
|
||
| cd "$GO_PROTO_DIR" | ||
|
|
||
| # Common | ||
| protoc \ | ||
| --plugin=protoc-gen-go="$PROTOC_GEN_GO" \ | ||
| --proto_path=. \ | ||
| --go_out="$OUTPUT_DIR/common" \ | ||
| --go_opt=paths=source_relative \ | ||
| --go_opt=Mcommon.proto=github.com/lightseek/smg/crates/grpc_client/go/generated/common \ | ||
| common.proto | ||
|
|
||
| # SGLang Encoder | ||
| protoc \ | ||
| --plugin=protoc-gen-go="$PROTOC_GEN_GO" \ | ||
| --plugin=protoc-gen-go-grpc="$PROTOC_GEN_GO_GRPC" \ | ||
| --proto_path=. \ | ||
| --go_out="$OUTPUT_DIR/sglang_encoder" \ | ||
| --go_opt=paths=source_relative \ | ||
| $MAPPINGS \ | ||
| --go_opt=Msglang_encoder.proto=github.com/lightseek/smg/crates/grpc_client/go/generated/sglang_encoder \ | ||
| --go-grpc_out="$OUTPUT_DIR/sglang_encoder" \ | ||
| --go-grpc_opt=paths=source_relative \ | ||
| $MAPPINGS_GRPC \ | ||
| --go-grpc_opt=Msglang_encoder.proto=github.com/lightseek/smg/crates/grpc_client/go/generated/sglang_encoder \ | ||
| sglang_encoder.proto | ||
|
|
||
| # SGLang Scheduler | ||
| protoc \ | ||
| --plugin=protoc-gen-go="$PROTOC_GEN_GO" \ | ||
| --plugin=protoc-gen-go-grpc="$PROTOC_GEN_GO_GRPC" \ | ||
| --proto_path=. \ | ||
| --go_out="$OUTPUT_DIR/sglang_scheduler" \ | ||
| --go_opt=paths=source_relative \ | ||
| $MAPPINGS \ | ||
| --go_opt=Msglang_scheduler.proto=github.com/lightseek/smg/crates/grpc_client/go/generated/sglang_scheduler \ | ||
| --go-grpc_out="$OUTPUT_DIR/sglang_scheduler" \ | ||
| --go-grpc_opt=paths=source_relative \ | ||
| $MAPPINGS_GRPC \ | ||
| --go-grpc_opt=Msglang_scheduler.proto=github.com/lightseek/smg/crates/grpc_client/go/generated/sglang_scheduler \ | ||
| sglang_scheduler.proto | ||
|
|
||
| # TRT-LLM Service | ||
| protoc \ | ||
| --plugin=protoc-gen-go="$PROTOC_GEN_GO" \ | ||
| --plugin=protoc-gen-go-grpc="$PROTOC_GEN_GO_GRPC" \ | ||
| --proto_path=. \ | ||
| --go_out="$OUTPUT_DIR/trtllm" \ | ||
| --go_opt=paths=source_relative \ | ||
| $MAPPINGS \ | ||
| --go_opt=Mtrtllm_service.proto=github.com/lightseek/smg/crates/grpc_client/go/generated/trtllm \ | ||
| --go-grpc_out="$OUTPUT_DIR/trtllm" \ | ||
| --go-grpc_opt=paths=source_relative \ | ||
| $MAPPINGS_GRPC \ | ||
| --go-grpc_opt=Mtrtllm_service.proto=github.com/lightseek/smg/crates/grpc_client/go/generated/trtllm \ | ||
| trtllm_service.proto | ||
|
|
||
| # vLLM Engine | ||
| protoc \ | ||
| --plugin=protoc-gen-go="$PROTOC_GEN_GO" \ | ||
| --plugin=protoc-gen-go-grpc="$PROTOC_GEN_GO_GRPC" \ | ||
| --proto_path=. \ | ||
| --go_out="$OUTPUT_DIR/vllm" \ | ||
| --go_opt=paths=source_relative \ | ||
| $MAPPINGS \ | ||
| --go_opt=Mvllm_engine.proto=github.com/lightseek/smg/crates/grpc_client/go/generated/vllm \ | ||
| --go-grpc_out="$OUTPUT_DIR/vllm" \ | ||
| --go-grpc_opt=paths=source_relative \ | ||
| $MAPPINGS_GRPC \ | ||
| --go-grpc_opt=Mvllm_engine.proto=github.com/lightseek/smg/crates/grpc_client/go/generated/vllm \ | ||
| vllm_engine.proto | ||
|
Comment on lines
+54
to
+112
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The For example, you could define a function: generate_service() {
local service_name="$1"
local proto_file="$2"
local output_dir="$OUTPUT_DIR/$service_name"
echo "Generating for $service_name..."
protoc \
--plugin=protoc-gen-go="$PROTOC_GEN_GO" \
--plugin=protoc-gen-go-grpc="$PROTOC_GEN_GO_GRPC" \
--proto_path=. \
--go_out="$output_dir" \
--go_opt=paths=source_relative \
$MAPPINGS \
--go_opt=M${proto_file}=github.com/lightseek/smg/crates/grpc_client/go/generated/${service_name} \
--go-grpc_out="$output_dir" \
--go-grpc_opt=paths=source_relative \
$MAPPINGS_GRPC \
--go-grpc_opt=M${proto_file}=github.com/lightseek/smg/crates/grpc_client/go/generated/${service_name} \
"$proto_file"
}And then call it for each service: generate_service "sglang_encoder" "sglang_encoder.proto"
generate_service "sglang_scheduler" "sglang_scheduler.proto"
generate_service "trtllm" "trtllm_service.proto"
generate_service "vllm" "vllm_engine.proto"This would make the script cleaner and easier to extend with new services. |
||
|
|
||
| echo "Generation complete!" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| module github.com/lightseek/smg/crates/grpc_client/go | ||
|
|
||
| go 1.25.0 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial 🧩 Analysis chain🌐 Web query:
💡 Result: The latest stable version of the Go programming language is 1.26.1. Citations:
Go 1.25.0 is a released version. It is stable and supported. If desired, consider updating to Go 1.26.1, the current latest stable version. 🤖 Prompt for AI Agents |
||
|
|
||
| require ( | ||
| google.golang.org/grpc v1.79.3 | ||
| google.golang.org/protobuf v1.36.11 | ||
| ) | ||
|
Comment on lines
+1
to
+8
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Check if bindings/golang module exists and what it provides
echo "=== Checking existing Go module at bindings/golang ==="
if [ -f "bindings/golang/go.mod" ]; then
cat bindings/golang/go.mod
echo ""
echo "=== Directory structure ==="
tree bindings/golang -L 3 2>/dev/null || find bindings/golang -type f -name "*.go" | head -20
fiRepository: lightseekorg/smg Length of output: 1788 🏁 Script executed: #!/bin/bash
# Check if crates/grpc_client/go exists and what it contains
echo "=== Checking crates/grpc_client/go ==="
if [ -d "crates/grpc_client/go" ]; then
echo "Directory exists. Contents:"
find crates/grpc_client/go -type f -name "*.pb.go" -o -name "*.proto" | head -30
echo ""
echo "=== Directory tree ==="
tree crates/grpc_client/go -L 3 2>/dev/null || find crates/grpc_client/go -type f | head -30
else
echo "Directory does not exist"
fi
echo ""
echo "=== Checking what protos are used by bindings/golang ==="
# Check if there are other proto generated files in bindings/golang
find bindings/golang -type f \( -name "*.pb.go" -o -name "*.proto" \) 2>/dev/null
echo ""
echo "=== Checking grpc_client directory structure ==="
# Check what's in the grpc_client directory
if [ -d "crates/grpc_client" ]; then
find crates/grpc_client -maxdepth 2 -type d
fiRepository: lightseekorg/smg Length of output: 651 🏁 Script executed: #!/bin/bash
# Check what the generate scripts do
echo "=== generate.sh ==="
cat crates/grpc_client/go/generate.sh
echo ""
echo "=== generate.go ==="
cat crates/grpc_client/go/generate.go
echo ""
echo "=== README.md ==="
cat crates/grpc_client/go/README.mdRepository: lightseekorg/smg Length of output: 5626 Duplicate sglang_scheduler generation with different import paths. This module generates Go code for While these modules serve different purposes (raw auto-generated bindings vs. higher-level wrapper SDK), consider documenting which module consumers should prefer, or ensuring the two modules target different subsets of services to avoid overlap. 🤖 Prompt for AI Agents |
||
|
|
||
| require ( | ||
| golang.org/x/net v0.48.0 // indirect | ||
| golang.org/x/sys v0.39.0 // indirect | ||
| golang.org/x/text v0.32.0 // indirect | ||
| google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect | ||
| ) | ||
|
Comment on lines
+1
to
+15
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
Please run References
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= | ||
| github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= | ||
| github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= | ||
| github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= | ||
| github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= | ||
| github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= | ||
| github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= | ||
| github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= | ||
| github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= | ||
| github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= | ||
| github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= | ||
| github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= | ||
| go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= | ||
| go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= | ||
| go.opentelemetry.io/otel v1.39.0 h1:8yPrr/S0ND9QEfTfdP9V+SiwT4E0G7Y5MO7p85nis48= | ||
| go.opentelemetry.io/otel v1.39.0/go.mod h1:kLlFTywNWrFyEdH0oj2xK0bFYZtHRYUdv1NklR/tgc8= | ||
| go.opentelemetry.io/otel/metric v1.39.0 h1:d1UzonvEZriVfpNKEVmHXbdf909uGTOQjA0HF0Ls5Q0= | ||
| go.opentelemetry.io/otel/metric v1.39.0/go.mod h1:jrZSWL33sD7bBxg1xjrqyDjnuzTUB0x1nBERXd7Ftcs= | ||
| go.opentelemetry.io/otel/sdk v1.39.0 h1:nMLYcjVsvdui1B/4FRkwjzoRVsMK8uL/cj0OyhKzt18= | ||
| go.opentelemetry.io/otel/sdk v1.39.0/go.mod h1:vDojkC4/jsTJsE+kh+LXYQlbL8CgrEcwmt1ENZszdJE= | ||
| go.opentelemetry.io/otel/sdk/metric v1.39.0 h1:cXMVVFVgsIf2YL6QkRF4Urbr/aMInf+2WKg+sEJTtB8= | ||
| go.opentelemetry.io/otel/sdk/metric v1.39.0/go.mod h1:xq9HEVH7qeX69/JnwEfp6fVq5wosJsY1mt4lLfYdVew= | ||
| go.opentelemetry.io/otel/trace v1.39.0 h1:2d2vfpEDmCJ5zVYz7ijaJdOF59xLomrvj7bjt6/qCJI= | ||
| go.opentelemetry.io/otel/trace v1.39.0/go.mod h1:88w4/PnZSazkGzz/w84VHpQafiU4EtqqlVdxWy+rNOA= | ||
| golang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU= | ||
| golang.org/x/net v0.48.0/go.mod h1:+ndRgGjkh8FGtu1w1FGbEC31if4VrNVMuKTgcAAnQRY= | ||
| golang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk= | ||
| golang.org/x/sys v0.39.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= | ||
| golang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU= | ||
| golang.org/x/text v0.32.0/go.mod h1:o/rUWzghvpD5TXrTIBuJU77MTaN0ljMWE47kxGJQ7jY= | ||
| gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= | ||
| gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E= | ||
| google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 h1:gRkg/vSppuSQoDjxyiGfN4Upv/h/DQmIR10ZU8dh4Ww= | ||
| google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217/go.mod h1:7i2o+ce6H/6BluujYR+kqX3GKH+dChPTQU19wjRPiGk= | ||
| google.golang.org/grpc v1.79.3 h1:sybAEdRIEtvcD68Gx7dmnwjZKlyfuc61Dyo9pGXXkKE= | ||
| google.golang.org/grpc v1.79.3/go.mod h1:KmT0Kjez+0dde/v2j9vzwoAScgEPx/Bw1CYChhHLrHQ= | ||
| google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= | ||
| google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Release commit is created but not pushed before tagging.
The workflow commits generated code locally but doesn't push the commit before creating the tag. The tag will be created on the local commit (with generated code), but this commit won't be pushed to the
mainbranch. This means:mainmainIf this is intentional (tags are orphaned commits with generated code), consider documenting this behavior. Otherwise, you may want to push to a release branch or reconsider the release strategy.
🤖 Prompt for AI Agents