opensearch-protobufs
This repository stores the Protobufs and generated code used for client <> server GRPC APIs.
The opensearch-api-specification repo will continue to be the source of truth, and these protobufs will mostly be a downstream consumer of the spec.
This repository will also include a variety of tooling and CI, linters and validators, and generated code, which is described in more detail below.
Releases
Each OpenSearch Protobufs release includes:
- Java Archive:
opensearch-protobufs-java.tar.gz- Maven-compatible JAR files for Java/Gradle projects - Protobuf ZIP:
opensearch-protobufs-{version}.zip- Raw.protofiles for generating client libraries in any language
Download the latest release from the GitHub Releases page.
Using Raw Proto Files
-
Download
opensearch-protobufs-{version}.zipfrom releases to get just the.protofiles: -
Extract the zip:
unzip opensearch-protobufs-{version}.zip
cd opensearch-protobufs-{version}
- Follow latest documentation on https://protobuf.dev/reference/ to generate client libraries for different languages.
Generated Code Usage
Go
import (
"github.com/opensearch-project/opensearch-protobufs/go/opensearchpb"
"github.com/opensearch-project/opensearch-protobufs/go/services"
)
// Use generated message types
request := &opensearchpb.SearchRequest{
Query: "elasticsearch",
Size: 10,
}
// Use generated gRPC clients
client := services.NewSearchServiceClient(conn)
response, err := client.Search(ctx, request)
Java
import org.opensearch.protobufs.SearchRequest;
import org.opensearch.protobufs.services.SearchServiceGrpc;
// Use generated message types
SearchRequest request = SearchRequest.newBuilder()
.setQuery("elasticsearch")
.setSize(10)
.build();
// Use generated gRPC clients
SearchServiceGrpc.SearchServiceBlockingStub client =
SearchServiceGrpc.newBlockingStub(channel);
SearchResponse response = client.search(request);
Python
from opensearch.protobufs.schemas import SearchRequest, BulkRequest, IndexDocumentRequest
from opensearch.protobufs.services import SearchServiceStub
# Use generated message types
request = SearchRequest()
request.query = "elasticsearch"
request.size = 10
# Use generated gRPC clients
client = SearchServiceStub(channel)
response = client.Search(request)
Generated Code Locations
After building, find generated code in:
# Go
bazel-bin/protos/schemas/*_go_proto_pb/protos/schemas/*.pb.go
bazel-bin/protos/services/*_go_proto_pb/protos/services/*.pb.go
# Java
bazel-bin/libjava_protos_all.jar
# Python
bazel-bin/opensearch/protobufs/schemas/
bazel-bin/opensearch/protobufs/services/
Intended usage of the repo
The repo will consist of:
-
Protobufs
- Raw
*.protofiles based on the API spec - Build files/tooling to compile the protobufs
- Raw
-
Generated code:
- The generated code for Java/Go/Python/etc languages, which can be imported as jars/packages into the downstream repos that need them. Having already packaged generated protobuf code makes it easy to import into the various repos (e.g.
OpenSearchcore,opensearch-java-client,opensearch-python,opensearch-benchmark, etc) and avoids duplicate efforts to regenerate them in every single repository.
- The generated code for Java/Go/Python/etc languages, which can be imported as jars/packages into the downstream repos that need them. Having already packaged generated protobuf code makes it easy to import into the various repos (e.g.
-
Tooling and CI
- Tooling to auto generate the
*.protofiles from theopensearch-api-specificationand GHAs to trigger the conversion scripts - Tooling (i.e Bazel files / scripts) to produce the protobuf generated code using
protoc, and CI to trigger it automatically upon.protofile changes
- Tooling to auto generate the
-
Linters/Validators (TBD)
- Tooling to validate and lint the generated
*.protofiles, to ensure they conform to Google's protobuf best practices, as well as conventions established within the OpenSearch org (more important for any portions that are hand-rolled)
- Tooling to validate and lint the generated
Development
For development documentation, see DEVELOPER_GUIDE.md.
CI/CD
GitHub Actions workflows automatically validate protobuf builds:
build-protobufs-java.yml- Validates Java protobuf generationbuild-protobufs-python.yml- Validates Python protobuf generationbuild-protobufs-go.yml- Validates Go protobuf generation
Contributing
See CONTRIBUTING.md for contribution guidelines.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file opensearch_protobufs-1.7.0-py3-none-any.whl.
File metadata
- Download URL: opensearch_protobufs-1.7.0-py3-none-any.whl
- Upload date:
- Size: 69.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dee981d8ba1588f8827e1da6ba567e8b49042bce73421dc6360890c122617d7c
|
|
| MD5 |
2cbc008e0d1b403abc7fb8fff55f28be
|
|
| BLAKE2b-256 |
fd1a79a310e54c87116ddce6d82f111fc2bbd6f5da6643d57acc823cd8b61208
|
Provenance
The following attestation bundles were made for opensearch_protobufs-1.7.0-py3-none-any.whl:
Publisher:
publish-release.yml on opensearch-project/opensearch-protobufs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
opensearch_protobufs-1.7.0-py3-none-any.whl -
Subject digest:
dee981d8ba1588f8827e1da6ba567e8b49042bce73421dc6360890c122617d7c - Sigstore transparency entry: 2468799259
- Sigstore integration time:
-
Permalink:
opensearch-project/opensearch-protobufs@204aa027c717d90d1dacce79086ab08d1cf0b661 -
Branch / Tag:
refs/tags/1.7.0 - Owner: https://github.com/opensearch-project
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-release.yml@204aa027c717d90d1dacce79086ab08d1cf0b661 -
Trigger Event:
push
-
Statement type: