Skip to content

Commit 1c55db8

Browse files
committed
Sync rekor-tiles protos into protobuf-specs
- sync is by manually running service-protos/sync-rekor-tiles.sh - pull in latest tag (it doesn't do releases) from rekor-tiles - rewrite the go_package to match protobuf specs - ignore protos for grpc service defintions - do NOT put service protos in ./protos because we export those in the service-builder container image - rework language builder to include ./service-protos - include ./service-protos in exported jar - remove jsonschema TODO: - handle rust code gen in the rust codebase? Signed-off-by: Appu Goundan <appu@google.com>
1 parent c5e04c7 commit 1c55db8

File tree

27 files changed

+2134
-33
lines changed

27 files changed

+2134
-33
lines changed

Makefile

Lines changed: 10 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
PROTOC_IMAGE = protoc-base
1717
PROTOC_GO_IMAGE = protoc-go
18-
PROTOC_JSONSCHEMA_IMAGE = protoc-jsonschema
1918
PROTOC_PYTHON_IMAGE = protoc-python
2019
PROTOC_RUBY_IMAGE = protoc-ruby
2120
PROTOC_RUST_IMAGE = protoc-rust
@@ -32,24 +31,24 @@ GID ?= $(shell id -g)
3231
DOCKER_BUILD = docker build --platform ${PLATFORM} --build-arg UID=${UID}
3332
DOCKER_RUN = docker run --platform ${PLATFORM} --user ${UID}:${GID}
3433

35-
PROTOS = $(shell find protos/ -iname "*.proto" | sed 's|^|/defs/|')
34+
PROTOS = $(shell find protos/ service-protos/ -iname "*.proto" | sed 's|^|/defs/|')
35+
PROTO_INCLUDES=-I/opt/include -I/googleapis -I/defs/protos -I/defs/service-protos
3636

3737
include protoc-builder/versions.mk
3838

3939
# generate all language protobuf code
40-
all: go python typescript ruby jsonschema rust
40+
all: go python typescript ruby rust
4141

4242
# generate Go protobuf code
4343
go: base-image-go
4444
@echo "Generating go proto Docker image"
4545
cd protoc-builder && ${DOCKER_BUILD} -t ${PROTOC_GO_IMAGE} -f Dockerfile.go .
4646
@echo "Generating go protobuf files"
47-
${DOCKER_RUN} -v ${PWD}:/defs ${PROTOC_GO_IMAGE} \
48-
-I/opt/include -I/googleapis -I/defs/protos \
47+
${DOCKER_RUN} -v ${PWD}:/defs ${PROTOC_GO_IMAGE} ${PROTO_INCLUDES}\
4948
--go_opt=module=github.com/sigstore/protobuf-specs/gen/pb-go --go_out=/defs/gen/pb-go ${PROTOS}
5049

5150
# an image on ghcr for generating defintions for sigstore services
52-
services-image: go
51+
services-image: base-image-go
5352
@echo "Generating go proto base image"
5453
cd protoc-builder && ${DOCKER_BUILD} -t ${PROTOC_GO_IMAGE} -f Dockerfile.go .
5554
@echo "Generating services Docker image"
@@ -60,34 +59,24 @@ python: base-image-python
6059
@echo "Generating python proto Docker image"
6160
cd protoc-builder && ${DOCKER_BUILD} -t ${PROTOC_PYTHON_IMAGE} -f Dockerfile.python .
6261
@echo "Generating python protobuf files"
63-
${DOCKER_RUN} -v ${PWD}:/defs ${PROTOC_PYTHON_IMAGE} \
64-
-I/opt/include -I/googleapis -I/defs/protos \
62+
${DOCKER_RUN} -v ${PWD}:/defs ${PROTOC_PYTHON_IMAGE} ${PROTO_INCLUDES}\
6563
--python_betterproto_opt=pydantic_dataclasses --python_betterproto_out=/defs/gen/pb-python/sigstore_protobuf_specs ${PROTOS}
6664

6765
typescript: base-image-typescript
6866
@echo "Generating typescript proto Docker image"
6967
cd protoc-builder && ${DOCKER_BUILD} -t ${PROTOC_TYPESCRIPT_IMAGE} -f Dockerfile.typescript .
7068
@echo "Generating javascript protobuf files"
71-
${DOCKER_RUN} -v ${PWD}:/defs ${PROTOC_TYPESCRIPT_IMAGE} \
72-
-I/opt/include -I/googleapis -I/defs/protos \
69+
${DOCKER_RUN} -v ${PWD}:/defs ${PROTOC_TYPESCRIPT_IMAGE} ${PROTO_INCLUDES}\
7370
--ts_proto_out=/defs/gen/pb-typescript/src/__generated__ --ts_proto_opt=oneof=unions,forceLong=string,env=node,exportCommonSymbols=false,outputPartialMethods=false,outputEncodeMethods=false,unrecognizedEnum=false ${PROTOS}
7471

7572
ruby: base-image-ruby
7673
@echo "Generating ruby proto Docker image"
7774
cd protoc-builder && ${DOCKER_BUILD} -t ${PROTOC_RUBY_IMAGE} -f Dockerfile.ruby .
7875
@echo "Generating ruby protobuf files"
79-
${DOCKER_RUN} -v ${PWD}:/defs ${PROTOC_RUBY_IMAGE} \
80-
-I/opt/include -I/googleapis -I/defs/protos --ruby_out=/defs/gen/pb-ruby/lib ${PROTOS}
81-
82-
jsonschema: base-image-jsonschema
83-
@echo "Generating jsonschema proto Docker image"
84-
cd protoc-builder && ${DOCKER_BUILD} -t ${PROTOC_JSONSCHEMA_IMAGE} -f Dockerfile.jsonschema .
85-
@echo "Generating JSON schema files"
86-
mkdir -p gen/jsonschema/schemas
87-
${DOCKER_RUN} -v ${PWD}:/defs ${PROTOC_JSONSCHEMA_IMAGE} \
88-
-I/opt/include -I/googleapis -I/defs/protos \
89-
--jsonschema_out=/defs/gen/jsonschema/schemas --jsonschema_opt=disallow_additional_properties --jsonschema_opt=enforce_oneof --jsonschema_opt=enums_as_strings_only --jsonschema_opt=file_extension=schema.json --jsonschema_opt=json_fieldnames ${PROTOS}
76+
${DOCKER_RUN} -v ${PWD}:/defs ${PROTOC_RUBY_IMAGE} ${PROTO_INCLUDES}\
77+
--ruby_out=/defs/gen/pb-ruby/lib ${PROTOS}
9078

79+
# TODO: serivce-proto code gen for rust
9180
rust: base-image-rust
9281
@echo "Generating rust proto Docker image"
9382
cd protoc-builder && ${DOCKER_BUILD} -t ${PROTOC_RUST_IMAGE} -f Dockerfile.rust .
@@ -103,14 +92,6 @@ base-image-go:
10392
--build-arg PROTOC_CHECKSUM=${GO_PROTOC_CHECKSUM} \
10493
--build-arg GOOGLEAPIS_COMMIT=${GO_GOOGLEAPIS_COMMIT} .
10594

106-
.PHONY: base-image-jsonschema
107-
base-image-jsonschema:
108-
@echo "Building base docker image for jsonschema"
109-
cd protoc-builder && ${DOCKER_BUILD} ${DOCKER_CACHE} -t ${PROTOC_IMAGE}:jsonschema -f Dockerfile.protoc \
110-
--build-arg PROTOC_VERSION=${JSONSCHEMA_PROTOC_VERSION} \
111-
--build-arg PROTOC_CHECKSUM=${JSONSCHEMA_PROTOC_CHECKSUM} \
112-
--build-arg GOOGLEAPIS_COMMIT=${JSONSCHEMA_GOOGLEAPIS_COMMIT} .
113-
11495
.PHONY: base-image-python
11596
base-image-python:
11697
@echo "Building base docker image for Python"
@@ -150,7 +131,6 @@ base-image-typescript:
150131
base-image-no-cache:
151132
@echo "Building development docker images with disabled cache"
152133
@DOCKER_CACHE="--no-cache" make base-image-go
153-
@DOCKER_CACHE="--no-cache" make base-image-jsonschema
154134
@DOCKER_CACHE="--no-cache" make base-image-python
155135
@DOCKER_CACHE="--no-cache" make base-image-ruby
156136
@DOCKER_CACHE="--no-cache" make base-image-rust
@@ -163,9 +143,7 @@ clean:
163143
gen/pb-python/sigstore_protobuf_specs/dev \
164144
gen/pb-python/sigstore_protobuf_specs/io \
165145
gen/pb-rust/target \
166-
gen/jsonschema/schemas
167146
docker rmi -f ${PROTOC_IMAGE}:go ${PROTOC_GO_IMAGE} \
168-
${PROTOC_IMAGE}:jsonschema ${PROTOC_JSONSCHEMA_IMAGE} \
169147
${PROTOC_IMAGE}:python ${PROTOC_PYTHON_IMAGE} \
170148
${PROTOC_IMAGE}:ruby ${PROTOC_RUBY_IMAGE} \
171149
${PROTOC_IMAGE}:rust ${PROTOC_RUST_IMAGE} \

gen/pb-go/rekor/v2/dsse.pb.go

Lines changed: 248 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)