diff --git a/BUILD.bazel b/BUILD.bazel index 9aa85258..750dcaad 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -5,7 +5,7 @@ load("@gazelle//:def.bzl", "gazelle") # Resolve protobuf import ambiguities - use the actual protopb packages, not the proto aliases # gazelle:resolve go github.com/uber/submitqueue/gateway/protopb //gateway/protopb # gazelle:resolve go github.com/uber/submitqueue/orchestrator/protopb //orchestrator/protopb -# gazelle:resolve go github.com/uber/submitqueue/stovepipe/protopb //stovepipe/protopb +# gazelle:resolve go github.com/uber/submitqueue/stovepipe/gateway/protopb //stovepipe/gateway/protopb # Export marker files for test data dependencies (used by FindRepoRoot in tests) exports_files( diff --git a/Makefile b/Makefile index 4fb97bb0..930b6948 100644 --- a/Makefile +++ b/Makefile @@ -91,7 +91,7 @@ clean-proto: ## Clean generated proto files @echo "Cleaning generated proto files..." @rm -rf gateway/protopb/*.pb.go @rm -rf orchestrator/protopb/*.pb.go - @rm -rf stovepipe/protopb/*.pb.go + @rm -rf stovepipe/gateway/protopb/*.pb.go @echo "Proto clean complete!" deps: tidy-go ## Download and tidy Go dependencies @@ -287,10 +287,10 @@ proto: ## Generate protobuf files from .proto definitions --go-grpc_out=orchestrator/protopb --go-grpc_opt=paths=source_relative \ --yarpc-go_out=orchestrator/protopb --yarpc-go_opt=paths=source_relative \ --proto_path=orchestrator/proto orchestrator/proto/orchestrator.proto - @protoc --go_out=stovepipe/protopb --go_opt=paths=source_relative \ - --go-grpc_out=stovepipe/protopb --go-grpc_opt=paths=source_relative \ - --yarpc-go_out=stovepipe/protopb --yarpc-go_opt=paths=source_relative \ - --proto_path=stovepipe/proto stovepipe/proto/stovepipe.proto + @protoc --go_out=stovepipe/gateway/protopb --go_opt=paths=source_relative \ + --go-grpc_out=stovepipe/gateway/protopb --go-grpc_opt=paths=source_relative \ + --yarpc-go_out=stovepipe/gateway/protopb --yarpc-go_opt=paths=source_relative \ + --proto_path=stovepipe/gateway/proto stovepipe/gateway/proto/stovepipe.proto @echo "Protobuf files generated successfully!" # Bazel query helpers diff --git a/core/extension/BUILD.bazel b/core/extension/BUILD.bazel new file mode 100644 index 00000000..7bdf58c7 --- /dev/null +++ b/core/extension/BUILD.bazel @@ -0,0 +1,8 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "extension", + srcs = ["doc.go"], + importpath = "github.com/uber/submitqueue/core/extension", + visibility = ["//visibility:public"], +) diff --git a/core/extension/doc.go b/core/extension/doc.go new file mode 100644 index 00000000..30d38196 --- /dev/null +++ b/core/extension/doc.go @@ -0,0 +1,17 @@ +// Copyright (c) 2025 Uber Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Package extension holds extension interfaces and implementations shared +// across SubmitQueue, Stovepipe, and other repo-local services. +package extension diff --git a/example/client/stovepipe/BUILD.bazel b/example/client/stovepipe/BUILD.bazel index eed30fd1..93ced621 100644 --- a/example/client/stovepipe/BUILD.bazel +++ b/example/client/stovepipe/BUILD.bazel @@ -6,7 +6,7 @@ go_library( importpath = "github.com/uber/submitqueue/example/client/stovepipe", visibility = ["//visibility:private"], deps = [ - "//stovepipe/protopb", + "//stovepipe/gateway/protopb", "@org_golang_google_grpc//:grpc", "@org_golang_google_grpc//credentials/insecure", ], diff --git a/example/client/stovepipe/main.go b/example/client/stovepipe/main.go index 69bb35d3..76e4cdab 100644 --- a/example/client/stovepipe/main.go +++ b/example/client/stovepipe/main.go @@ -21,7 +21,7 @@ import ( "os" "time" - pb "github.com/uber/submitqueue/stovepipe/protopb" + pb "github.com/uber/submitqueue/stovepipe/gateway/protopb" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" ) diff --git a/example/server/stovepipe/BUILD.bazel b/example/server/stovepipe/BUILD.bazel index a8c8b830..0a37d8a5 100644 --- a/example/server/stovepipe/BUILD.bazel +++ b/example/server/stovepipe/BUILD.bazel @@ -11,8 +11,8 @@ go_library( importpath = "github.com/uber/submitqueue/example/server/stovepipe", visibility = ["//visibility:private"], deps = [ - "//stovepipe/controller", - "//stovepipe/protopb", + "//stovepipe/gateway/controller", + "//stovepipe/gateway/protopb", "@com_github_uber_go_tally_v4//:tally", "@org_golang_google_grpc//:grpc", "@org_golang_google_grpc//reflection", diff --git a/example/server/stovepipe/main.go b/example/server/stovepipe/main.go index 8cdbb9e1..e784d4dd 100644 --- a/example/server/stovepipe/main.go +++ b/example/server/stovepipe/main.go @@ -26,8 +26,8 @@ import ( "time" "github.com/uber-go/tally/v4" - "github.com/uber/submitqueue/stovepipe/controller" - pb "github.com/uber/submitqueue/stovepipe/protopb" + "github.com/uber/submitqueue/stovepipe/gateway/controller" + pb "github.com/uber/submitqueue/stovepipe/gateway/protopb" "go.uber.org/zap" "google.golang.org/grpc" "google.golang.org/grpc/reflection" diff --git a/stovepipe/README.md b/stovepipe/README.md index fb922823..afe91ac6 100644 --- a/stovepipe/README.md +++ b/stovepipe/README.md @@ -1 +1,8 @@ -SubmitQueue Stovepipe +# Stovepipe + +Stovepipe service layout: + +- `gateway/` — RPC surface, gateway controllers, and generated protobufs +- `orchestrator/` — reserved for the future Stovepipe orchestrator binary +- `extension/` — Stovepipe-specific extension implementations +- `entity/` — Stovepipe-specific domain entities diff --git a/stovepipe/entity/BUILD.bazel b/stovepipe/entity/BUILD.bazel new file mode 100644 index 00000000..cd91ad23 --- /dev/null +++ b/stovepipe/entity/BUILD.bazel @@ -0,0 +1,8 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "entity", + srcs = ["doc.go"], + importpath = "github.com/uber/submitqueue/stovepipe/entity", + visibility = ["//visibility:public"], +) diff --git a/stovepipe/entity/doc.go b/stovepipe/entity/doc.go new file mode 100644 index 00000000..15ac8680 --- /dev/null +++ b/stovepipe/entity/doc.go @@ -0,0 +1,16 @@ +// Copyright (c) 2025 Uber Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Package entity holds Stovepipe-specific domain types (distinct from shared repo entity/). +package entity diff --git a/stovepipe/extension/BUILD.bazel b/stovepipe/extension/BUILD.bazel new file mode 100644 index 00000000..d53b1a74 --- /dev/null +++ b/stovepipe/extension/BUILD.bazel @@ -0,0 +1,8 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "extension", + srcs = ["doc.go"], + importpath = "github.com/uber/submitqueue/stovepipe/extension", + visibility = ["//visibility:public"], +) diff --git a/stovepipe/extension/doc.go b/stovepipe/extension/doc.go new file mode 100644 index 00000000..92d4bcea --- /dev/null +++ b/stovepipe/extension/doc.go @@ -0,0 +1,16 @@ +// Copyright (c) 2025 Uber Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Package extension holds Stovepipe-specific extension implementations. +package extension diff --git a/stovepipe/controller/BUILD.bazel b/stovepipe/gateway/controller/BUILD.bazel similarity index 79% rename from stovepipe/controller/BUILD.bazel rename to stovepipe/gateway/controller/BUILD.bazel index 685b0c20..1fed7fd4 100644 --- a/stovepipe/controller/BUILD.bazel +++ b/stovepipe/gateway/controller/BUILD.bazel @@ -3,11 +3,11 @@ load("@rules_go//go:def.bzl", "go_library", "go_test") go_library( name = "controller", srcs = ["ping.go"], - importpath = "github.com/uber/submitqueue/stovepipe/controller", + importpath = "github.com/uber/submitqueue/stovepipe/gateway/controller", visibility = ["//visibility:public"], deps = [ "//core/metrics", - "//stovepipe/protopb", + "//stovepipe/gateway/protopb", "@com_github_uber_go_tally_v4//:tally", "@org_uber_go_zap//:zap", ], @@ -18,7 +18,7 @@ go_test( srcs = ["ping_test.go"], embed = [":controller"], deps = [ - "//stovepipe/protopb", + "//stovepipe/gateway/protopb", "@com_github_stretchr_testify//assert", "@com_github_stretchr_testify//require", "@com_github_uber_go_tally_v4//:tally", diff --git a/stovepipe/controller/ping.go b/stovepipe/gateway/controller/ping.go similarity index 96% rename from stovepipe/controller/ping.go rename to stovepipe/gateway/controller/ping.go index 41d216d4..afa80f02 100644 --- a/stovepipe/controller/ping.go +++ b/stovepipe/gateway/controller/ping.go @@ -21,7 +21,7 @@ import ( "github.com/uber-go/tally/v4" "github.com/uber/submitqueue/core/metrics" - pb "github.com/uber/submitqueue/stovepipe/protopb" + pb "github.com/uber/submitqueue/stovepipe/gateway/protopb" "go.uber.org/zap" ) diff --git a/stovepipe/controller/ping_test.go b/stovepipe/gateway/controller/ping_test.go similarity index 97% rename from stovepipe/controller/ping_test.go rename to stovepipe/gateway/controller/ping_test.go index ee628c27..37f938e3 100644 --- a/stovepipe/controller/ping_test.go +++ b/stovepipe/gateway/controller/ping_test.go @@ -22,7 +22,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/uber-go/tally/v4" - pb "github.com/uber/submitqueue/stovepipe/protopb" + pb "github.com/uber/submitqueue/stovepipe/gateway/protopb" "go.uber.org/zap" ) diff --git a/stovepipe/proto/BUILD.bazel b/stovepipe/gateway/proto/BUILD.bazel similarity index 67% rename from stovepipe/proto/BUILD.bazel rename to stovepipe/gateway/proto/BUILD.bazel index 6d93c5c3..24826221 100644 --- a/stovepipe/proto/BUILD.bazel +++ b/stovepipe/gateway/proto/BUILD.bazel @@ -15,21 +15,14 @@ go_proto_library( "@rules_go//proto:go_proto", "@rules_go//proto:go_grpc_v2", ], - importpath = "github.com/uber/submitqueue/stovepipe/proto", + importpath = "github.com/uber/submitqueue/stovepipe/gateway/proto", proto = ":stovepipepb_proto", visibility = ["//visibility:public"], ) -go_library( - name = "proto", - embed = [":stovepipepb_go_proto"], - importpath = "github.com/uber/submitqueue/stovepipe/proto", - visibility = ["//visibility:public"], -) - go_library( name = "protopb", embed = [":stovepipepb_go_proto"], - importpath = "github.com/uber/submitqueue/stovepipe/protopb", + importpath = "github.com/uber/submitqueue/stovepipe/gateway/protopb", visibility = ["//visibility:public"], ) diff --git a/stovepipe/proto/stovepipe.proto b/stovepipe/gateway/proto/stovepipe.proto similarity index 95% rename from stovepipe/proto/stovepipe.proto rename to stovepipe/gateway/proto/stovepipe.proto index 3b8eec71..47e3d830 100644 --- a/stovepipe/proto/stovepipe.proto +++ b/stovepipe/gateway/proto/stovepipe.proto @@ -16,7 +16,7 @@ syntax = "proto3"; package uber.submitqueue.stovepipe; -option go_package = "github.com/uber/submitqueue/stovepipe/protopb"; +option go_package = "github.com/uber/submitqueue/stovepipe/gateway/protopb"; option java_multiple_files = true; option java_outer_classname = "StovepipeProto"; option java_package = "com.uber.submitqueue.stovepipe"; diff --git a/stovepipe/protopb/BUILD.bazel b/stovepipe/gateway/protopb/BUILD.bazel similarity index 50% rename from stovepipe/protopb/BUILD.bazel rename to stovepipe/gateway/protopb/BUILD.bazel index aca68418..01af58d6 100644 --- a/stovepipe/protopb/BUILD.bazel +++ b/stovepipe/gateway/protopb/BUILD.bazel @@ -4,24 +4,15 @@ go_library( name = "protopb", srcs = [ "stovepipe.pb.go", - "stovepipe.pb.yarpc.go", "stovepipe_grpc.pb.go", ], - importpath = "github.com/uber/submitqueue/stovepipe/protopb", + importpath = "github.com/uber/submitqueue/stovepipe/gateway/protopb", visibility = ["//visibility:public"], deps = [ - "@com_github_gogo_protobuf//jsonpb", - "@com_github_gogo_protobuf//proto", "@org_golang_google_grpc//:grpc", "@org_golang_google_grpc//codes", "@org_golang_google_grpc//status", "@org_golang_google_protobuf//reflect/protoreflect", "@org_golang_google_protobuf//runtime/protoimpl", - "@org_uber_go_fx//:fx", - "@org_uber_go_yarpc//:yarpc", - "@org_uber_go_yarpc//api/transport", - "@org_uber_go_yarpc//api/x/restriction", - "@org_uber_go_yarpc//encoding/protobuf", - "@org_uber_go_yarpc//encoding/protobuf/reflection", ], ) diff --git a/stovepipe/protopb/stovepipe.pb.go b/stovepipe/gateway/protopb/stovepipe.pb.go similarity index 59% rename from stovepipe/protopb/stovepipe.pb.go rename to stovepipe/gateway/protopb/stovepipe.pb.go index 16b936d6..1df26cea 100644 --- a/stovepipe/protopb/stovepipe.pb.go +++ b/stovepipe/gateway/protopb/stovepipe.pb.go @@ -15,8 +15,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.10 -// protoc v5.29.3 -// source: stovepipe.proto +// protoc v5.27.3 +// source: stovepipe/gateway/proto/stovepipe.proto package protopb @@ -36,18 +36,16 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// PingRequest is the request for the Ping method type PingRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Optional message to include in the ping - Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *PingRequest) Reset() { *x = PingRequest{} - mi := &file_stovepipe_proto_msgTypes[0] + mi := &file_stovepipe_gateway_proto_stovepipe_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -59,7 +57,7 @@ func (x *PingRequest) String() string { func (*PingRequest) ProtoMessage() {} func (x *PingRequest) ProtoReflect() protoreflect.Message { - mi := &file_stovepipe_proto_msgTypes[0] + mi := &file_stovepipe_gateway_proto_stovepipe_proto_msgTypes[0] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -72,7 +70,7 @@ func (x *PingRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use PingRequest.ProtoReflect.Descriptor instead. func (*PingRequest) Descriptor() ([]byte, []int) { - return file_stovepipe_proto_rawDescGZIP(), []int{0} + return file_stovepipe_gateway_proto_stovepipe_proto_rawDescGZIP(), []int{0} } func (x *PingRequest) GetMessage() string { @@ -82,24 +80,19 @@ func (x *PingRequest) GetMessage() string { return "" } -// PingResponse is the response for the Ping method type PingResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // The response message - Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` - // The service name that handled the request - ServiceName string `protobuf:"bytes,2,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` - // Timestamp of when the ping was received - Timestamp int64 `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - // Hostname of the server that handled the request - Hostname string `protobuf:"bytes,4,opt,name=hostname,proto3" json:"hostname,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` + ServiceName string `protobuf:"bytes,2,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` + Timestamp int64 `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Hostname string `protobuf:"bytes,4,opt,name=hostname,proto3" json:"hostname,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *PingResponse) Reset() { *x = PingResponse{} - mi := &file_stovepipe_proto_msgTypes[1] + mi := &file_stovepipe_gateway_proto_stovepipe_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -111,7 +104,7 @@ func (x *PingResponse) String() string { func (*PingResponse) ProtoMessage() {} func (x *PingResponse) ProtoReflect() protoreflect.Message { - mi := &file_stovepipe_proto_msgTypes[1] + mi := &file_stovepipe_gateway_proto_stovepipe_proto_msgTypes[1] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -124,7 +117,7 @@ func (x *PingResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use PingResponse.ProtoReflect.Descriptor instead. func (*PingResponse) Descriptor() ([]byte, []int) { - return file_stovepipe_proto_rawDescGZIP(), []int{1} + return file_stovepipe_gateway_proto_stovepipe_proto_rawDescGZIP(), []int{1} } func (x *PingResponse) GetMessage() string { @@ -155,11 +148,11 @@ func (x *PingResponse) GetHostname() string { return "" } -var File_stovepipe_proto protoreflect.FileDescriptor +var File_stovepipe_gateway_proto_stovepipe_proto protoreflect.FileDescriptor -const file_stovepipe_proto_rawDesc = "" + +const file_stovepipe_gateway_proto_stovepipe_proto_rawDesc = "" + "\n" + - "\x0fstovepipe.proto\x12\x1auber.submitqueue.stovepipe\"'\n" + + "'stovepipe/gateway/proto/stovepipe.proto\x12\x1auber.submitqueue.stovepipe\"'\n" + "\vPingRequest\x12\x18\n" + "\amessage\x18\x01 \x01(\tR\amessage\"\x85\x01\n" + "\fPingResponse\x12\x18\n" + @@ -168,27 +161,27 @@ const file_stovepipe_proto_rawDesc = "" + "\ttimestamp\x18\x03 \x01(\x03R\ttimestamp\x12\x1a\n" + "\bhostname\x18\x04 \x01(\tR\bhostname2s\n" + "\x14SubmitQueueStovepipe\x12[\n" + - "\x04Ping\x12'.uber.submitqueue.stovepipe.PingRequest\x1a(.uber.submitqueue.stovepipe.PingResponse\"\x00Ba\n" + - "\x1ecom.uber.submitqueue.stovepipeB\x0eStovepipeProtoP\x01Z-github.com/uber/submitqueue/stovepipe/protopbb\x06proto3" + "\x04Ping\x12'.uber.submitqueue.stovepipe.PingRequest\x1a(.uber.submitqueue.stovepipe.PingResponse\"\x00Bi\n" + + "\x1ecom.uber.submitqueue.stovepipeB\x0eStovepipeProtoP\x01Z5github.com/uber/submitqueue/stovepipe/gateway/protopbb\x06proto3" var ( - file_stovepipe_proto_rawDescOnce sync.Once - file_stovepipe_proto_rawDescData []byte + file_stovepipe_gateway_proto_stovepipe_proto_rawDescOnce sync.Once + file_stovepipe_gateway_proto_stovepipe_proto_rawDescData []byte ) -func file_stovepipe_proto_rawDescGZIP() []byte { - file_stovepipe_proto_rawDescOnce.Do(func() { - file_stovepipe_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_stovepipe_proto_rawDesc), len(file_stovepipe_proto_rawDesc))) +func file_stovepipe_gateway_proto_stovepipe_proto_rawDescGZIP() []byte { + file_stovepipe_gateway_proto_stovepipe_proto_rawDescOnce.Do(func() { + file_stovepipe_gateway_proto_stovepipe_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_stovepipe_gateway_proto_stovepipe_proto_rawDesc), len(file_stovepipe_gateway_proto_stovepipe_proto_rawDesc))) }) - return file_stovepipe_proto_rawDescData + return file_stovepipe_gateway_proto_stovepipe_proto_rawDescData } -var file_stovepipe_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_stovepipe_proto_goTypes = []any{ +var file_stovepipe_gateway_proto_stovepipe_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_stovepipe_gateway_proto_stovepipe_proto_goTypes = []any{ (*PingRequest)(nil), // 0: uber.submitqueue.stovepipe.PingRequest (*PingResponse)(nil), // 1: uber.submitqueue.stovepipe.PingResponse } -var file_stovepipe_proto_depIdxs = []int32{ +var file_stovepipe_gateway_proto_stovepipe_proto_depIdxs = []int32{ 0, // 0: uber.submitqueue.stovepipe.SubmitQueueStovepipe.Ping:input_type -> uber.submitqueue.stovepipe.PingRequest 1, // 1: uber.submitqueue.stovepipe.SubmitQueueStovepipe.Ping:output_type -> uber.submitqueue.stovepipe.PingResponse 1, // [1:2] is the sub-list for method output_type @@ -198,26 +191,26 @@ var file_stovepipe_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for field type_name } -func init() { file_stovepipe_proto_init() } -func file_stovepipe_proto_init() { - if File_stovepipe_proto != nil { +func init() { file_stovepipe_gateway_proto_stovepipe_proto_init() } +func file_stovepipe_gateway_proto_stovepipe_proto_init() { + if File_stovepipe_gateway_proto_stovepipe_proto != nil { return } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_stovepipe_proto_rawDesc), len(file_stovepipe_proto_rawDesc)), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_stovepipe_gateway_proto_stovepipe_proto_rawDesc), len(file_stovepipe_gateway_proto_stovepipe_proto_rawDesc)), NumEnums: 0, NumMessages: 2, NumExtensions: 0, NumServices: 1, }, - GoTypes: file_stovepipe_proto_goTypes, - DependencyIndexes: file_stovepipe_proto_depIdxs, - MessageInfos: file_stovepipe_proto_msgTypes, + GoTypes: file_stovepipe_gateway_proto_stovepipe_proto_goTypes, + DependencyIndexes: file_stovepipe_gateway_proto_stovepipe_proto_depIdxs, + MessageInfos: file_stovepipe_gateway_proto_stovepipe_proto_msgTypes, }.Build() - File_stovepipe_proto = out.File - file_stovepipe_proto_goTypes = nil - file_stovepipe_proto_depIdxs = nil + File_stovepipe_gateway_proto_stovepipe_proto = out.File + file_stovepipe_gateway_proto_stovepipe_proto_goTypes = nil + file_stovepipe_gateway_proto_stovepipe_proto_depIdxs = nil } diff --git a/stovepipe/protopb/stovepipe_grpc.pb.go b/stovepipe/gateway/protopb/stovepipe_grpc.pb.go similarity index 88% rename from stovepipe/protopb/stovepipe_grpc.pb.go rename to stovepipe/gateway/protopb/stovepipe_grpc.pb.go index 2bbce1bc..f5a486bb 100644 --- a/stovepipe/protopb/stovepipe_grpc.pb.go +++ b/stovepipe/gateway/protopb/stovepipe_grpc.pb.go @@ -15,8 +15,8 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.5.1 -// - protoc v5.29.3 -// source: stovepipe.proto +// - protoc v5.27.3 +// source: stovepipe/gateway/proto/stovepipe.proto package protopb @@ -40,10 +40,7 @@ const ( // SubmitQueueStovepipeClient is the client API for SubmitQueueStovepipe service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// SubmitQueueStovepipe provides the stovepipe API type SubmitQueueStovepipeClient interface { - // Ping returns a response indicating the service is alive Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error) } @@ -66,17 +63,13 @@ func (c *submitQueueStovepipeClient) Ping(ctx context.Context, in *PingRequest, } // SubmitQueueStovepipeServer is the server API for SubmitQueueStovepipe service. -// All implementations must embed UnimplementedSubmitQueueStovepipeServer +// All implementations should embed UnimplementedSubmitQueueStovepipeServer // for forward compatibility. -// -// SubmitQueueStovepipe provides the stovepipe API type SubmitQueueStovepipeServer interface { - // Ping returns a response indicating the service is alive Ping(context.Context, *PingRequest) (*PingResponse, error) - mustEmbedUnimplementedSubmitQueueStovepipeServer() } -// UnimplementedSubmitQueueStovepipeServer must be embedded to have +// UnimplementedSubmitQueueStovepipeServer should be embedded to have // forward compatible implementations. // // NOTE: this should be embedded by value instead of pointer to avoid a nil @@ -86,8 +79,7 @@ type UnimplementedSubmitQueueStovepipeServer struct{} func (UnimplementedSubmitQueueStovepipeServer) Ping(context.Context, *PingRequest) (*PingResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented") } -func (UnimplementedSubmitQueueStovepipeServer) mustEmbedUnimplementedSubmitQueueStovepipeServer() {} -func (UnimplementedSubmitQueueStovepipeServer) testEmbeddedByValue() {} +func (UnimplementedSubmitQueueStovepipeServer) testEmbeddedByValue() {} // UnsafeSubmitQueueStovepipeServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to SubmitQueueStovepipeServer will @@ -138,5 +130,5 @@ var SubmitQueueStovepipe_ServiceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "stovepipe.proto", + Metadata: "stovepipe/gateway/proto/stovepipe.proto", } diff --git a/stovepipe/orchestrator/BUILD.bazel b/stovepipe/orchestrator/BUILD.bazel new file mode 100644 index 00000000..d920ae4f --- /dev/null +++ b/stovepipe/orchestrator/BUILD.bazel @@ -0,0 +1,8 @@ +load("@rules_go//go:def.bzl", "go_library") + +go_library( + name = "orchestrator", + srcs = ["doc.go"], + importpath = "github.com/uber/submitqueue/stovepipe/orchestrator", + visibility = ["//visibility:public"], +) diff --git a/stovepipe/orchestrator/doc.go b/stovepipe/orchestrator/doc.go new file mode 100644 index 00000000..53be22ca --- /dev/null +++ b/stovepipe/orchestrator/doc.go @@ -0,0 +1,16 @@ +// Copyright (c) 2025 Uber Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Package orchestrator is reserved for the future Stovepipe orchestrator service. +package orchestrator diff --git a/stovepipe/protopb/stovepipe.pb.yarpc.go b/stovepipe/protopb/stovepipe.pb.yarpc.go deleted file mode 100644 index 795ba9cf..00000000 --- a/stovepipe/protopb/stovepipe.pb.yarpc.go +++ /dev/null @@ -1,261 +0,0 @@ -// Code generated by protoc-gen-yarpc-go. DO NOT EDIT. -// source: stovepipe.proto - -package protopb - -import ( - "context" - "io/ioutil" - "reflect" - - "github.com/gogo/protobuf/jsonpb" - "github.com/gogo/protobuf/proto" - "go.uber.org/fx" - "go.uber.org/yarpc" - "go.uber.org/yarpc/api/transport" - "go.uber.org/yarpc/api/x/restriction" - "go.uber.org/yarpc/encoding/protobuf" - "go.uber.org/yarpc/encoding/protobuf/reflection" -) - -var _ = ioutil.NopCloser - -// SubmitQueueStovepipeYARPCClient is the YARPC client-side interface for the SubmitQueueStovepipe service. -type SubmitQueueStovepipeYARPCClient interface { - Ping(context.Context, *PingRequest, ...yarpc.CallOption) (*PingResponse, error) -} - -func newSubmitQueueStovepipeYARPCClient(clientConfig transport.ClientConfig, anyResolver jsonpb.AnyResolver, options ...protobuf.ClientOption) SubmitQueueStovepipeYARPCClient { - return &_SubmitQueueStovepipeYARPCCaller{protobuf.NewStreamClient( - protobuf.ClientParams{ - ServiceName: "uber.submitqueue.stovepipe.SubmitQueueStovepipe", - ClientConfig: clientConfig, - AnyResolver: anyResolver, - Options: options, - }, - )} -} - -// NewSubmitQueueStovepipeYARPCClient builds a new YARPC client for the SubmitQueueStovepipe service. -func NewSubmitQueueStovepipeYARPCClient(clientConfig transport.ClientConfig, options ...protobuf.ClientOption) SubmitQueueStovepipeYARPCClient { - return newSubmitQueueStovepipeYARPCClient(clientConfig, nil, options...) -} - -// SubmitQueueStovepipeYARPCServer is the YARPC server-side interface for the SubmitQueueStovepipe service. -type SubmitQueueStovepipeYARPCServer interface { - Ping(context.Context, *PingRequest) (*PingResponse, error) -} - -type buildSubmitQueueStovepipeYARPCProceduresParams struct { - Server SubmitQueueStovepipeYARPCServer - AnyResolver jsonpb.AnyResolver -} - -func buildSubmitQueueStovepipeYARPCProcedures(params buildSubmitQueueStovepipeYARPCProceduresParams) []transport.Procedure { - handler := &_SubmitQueueStovepipeYARPCHandler{params.Server} - return protobuf.BuildProcedures( - protobuf.BuildProceduresParams{ - ServiceName: "uber.submitqueue.stovepipe.SubmitQueueStovepipe", - UnaryHandlerParams: []protobuf.BuildProceduresUnaryHandlerParams{ - { - MethodName: "Ping", - Handler: protobuf.NewUnaryHandler( - protobuf.UnaryHandlerParams{ - Handle: handler.Ping, - NewRequest: newSubmitQueueStovepipeServicePingYARPCRequest, - AnyResolver: params.AnyResolver, - }, - ), - }, - }, - OnewayHandlerParams: []protobuf.BuildProceduresOnewayHandlerParams{}, - StreamHandlerParams: []protobuf.BuildProceduresStreamHandlerParams{}, - }, - ) -} - -// BuildSubmitQueueStovepipeYARPCProcedures prepares an implementation of the SubmitQueueStovepipe service for YARPC registration. -func BuildSubmitQueueStovepipeYARPCProcedures(server SubmitQueueStovepipeYARPCServer) []transport.Procedure { - return buildSubmitQueueStovepipeYARPCProcedures(buildSubmitQueueStovepipeYARPCProceduresParams{Server: server}) -} - -// FxSubmitQueueStovepipeYARPCClientParams defines the input -// for NewFxSubmitQueueStovepipeYARPCClient. It provides the -// paramaters to get a SubmitQueueStovepipeYARPCClient in an -// Fx application. -type FxSubmitQueueStovepipeYARPCClientParams struct { - fx.In - - Provider yarpc.ClientConfig - AnyResolver jsonpb.AnyResolver `name:"yarpcfx" optional:"true"` - Restriction restriction.Checker `optional:"true"` -} - -// FxSubmitQueueStovepipeYARPCClientResult defines the output -// of NewFxSubmitQueueStovepipeYARPCClient. It provides a -// SubmitQueueStovepipeYARPCClient to an Fx application. -type FxSubmitQueueStovepipeYARPCClientResult struct { - fx.Out - - Client SubmitQueueStovepipeYARPCClient - - // We are using an fx.Out struct here instead of just returning a client - // so that we can add more values or add named versions of the client in - // the future without breaking any existing code. -} - -// NewFxSubmitQueueStovepipeYARPCClient provides a SubmitQueueStovepipeYARPCClient -// to an Fx application using the given name for routing. -// -// fx.Provide( -// protopb.NewFxSubmitQueueStovepipeYARPCClient("service-name"), -// ... -// ) -func NewFxSubmitQueueStovepipeYARPCClient(name string, options ...protobuf.ClientOption) interface{} { - return func(params FxSubmitQueueStovepipeYARPCClientParams) FxSubmitQueueStovepipeYARPCClientResult { - cc := params.Provider.ClientConfig(name) - - if params.Restriction != nil { - if namer, ok := cc.GetUnaryOutbound().(transport.Namer); ok { - if err := params.Restriction.Check(protobuf.Encoding, namer.TransportName()); err != nil { - panic(err.Error()) - } - } - } - - return FxSubmitQueueStovepipeYARPCClientResult{ - Client: newSubmitQueueStovepipeYARPCClient(cc, params.AnyResolver, options...), - } - } -} - -// FxSubmitQueueStovepipeYARPCProceduresParams defines the input -// for NewFxSubmitQueueStovepipeYARPCProcedures. It provides the -// paramaters to get SubmitQueueStovepipeYARPCServer procedures in an -// Fx application. -type FxSubmitQueueStovepipeYARPCProceduresParams struct { - fx.In - - Server SubmitQueueStovepipeYARPCServer - AnyResolver jsonpb.AnyResolver `name:"yarpcfx" optional:"true"` -} - -// FxSubmitQueueStovepipeYARPCProceduresResult defines the output -// of NewFxSubmitQueueStovepipeYARPCProcedures. It provides -// SubmitQueueStovepipeYARPCServer procedures to an Fx application. -// -// The procedures are provided to the "yarpcfx" value group. -// Dig 1.2 or newer must be used for this feature to work. -type FxSubmitQueueStovepipeYARPCProceduresResult struct { - fx.Out - - Procedures []transport.Procedure `group:"yarpcfx"` - ReflectionMeta reflection.ServerMeta `group:"yarpcfx"` -} - -// NewFxSubmitQueueStovepipeYARPCProcedures provides SubmitQueueStovepipeYARPCServer procedures to an Fx application. -// It expects a SubmitQueueStovepipeYARPCServer to be present in the container. -// -// fx.Provide( -// protopb.NewFxSubmitQueueStovepipeYARPCProcedures(), -// ... -// ) -func NewFxSubmitQueueStovepipeYARPCProcedures() interface{} { - return func(params FxSubmitQueueStovepipeYARPCProceduresParams) FxSubmitQueueStovepipeYARPCProceduresResult { - return FxSubmitQueueStovepipeYARPCProceduresResult{ - Procedures: buildSubmitQueueStovepipeYARPCProcedures(buildSubmitQueueStovepipeYARPCProceduresParams{ - Server: params.Server, - AnyResolver: params.AnyResolver, - }), - ReflectionMeta: SubmitQueueStovepipeReflectionMeta, - } - } -} - -// SubmitQueueStovepipeReflectionMeta is the reflection server metadata -// required for using the gRPC reflection protocol with YARPC. -// -// See https://github.com/grpc/grpc/blob/master/doc/server-reflection.md. -var SubmitQueueStovepipeReflectionMeta = reflection.ServerMeta{ - ServiceName: "uber.submitqueue.stovepipe.SubmitQueueStovepipe", - FileDescriptors: yarpcFileDescriptorClosurefabdb6b3c0b09022, -} - -type _SubmitQueueStovepipeYARPCCaller struct { - streamClient protobuf.StreamClient -} - -func (c *_SubmitQueueStovepipeYARPCCaller) Ping(ctx context.Context, request *PingRequest, options ...yarpc.CallOption) (*PingResponse, error) { - responseMessage, err := c.streamClient.Call(ctx, "Ping", request, newSubmitQueueStovepipeServicePingYARPCResponse, options...) - if responseMessage == nil { - return nil, err - } - response, ok := responseMessage.(*PingResponse) - if !ok { - return nil, protobuf.CastError(emptySubmitQueueStovepipeServicePingYARPCResponse, responseMessage) - } - return response, err -} - -type _SubmitQueueStovepipeYARPCHandler struct { - server SubmitQueueStovepipeYARPCServer -} - -func (h *_SubmitQueueStovepipeYARPCHandler) Ping(ctx context.Context, requestMessage proto.Message) (proto.Message, error) { - var request *PingRequest - var ok bool - if requestMessage != nil { - request, ok = requestMessage.(*PingRequest) - if !ok { - return nil, protobuf.CastError(emptySubmitQueueStovepipeServicePingYARPCRequest, requestMessage) - } - } - response, err := h.server.Ping(ctx, request) - if response == nil { - return nil, err - } - return response, err -} - -func newSubmitQueueStovepipeServicePingYARPCRequest() proto.Message { - return &PingRequest{} -} - -func newSubmitQueueStovepipeServicePingYARPCResponse() proto.Message { - return &PingResponse{} -} - -var ( - emptySubmitQueueStovepipeServicePingYARPCRequest = &PingRequest{} - emptySubmitQueueStovepipeServicePingYARPCResponse = &PingResponse{} -) - -var yarpcFileDescriptorClosurefabdb6b3c0b09022 = [][]byte{ - // stovepipe.proto - []byte{ - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x91, 0xb1, 0x4e, 0xc3, 0x30, - 0x10, 0x86, 0x31, 0xad, 0x80, 0x5e, 0x2b, 0x90, 0x2c, 0x86, 0x28, 0x42, 0xa8, 0x64, 0x69, 0x16, - 0x1c, 0x09, 0xde, 0xa0, 0x0f, 0x80, 0x42, 0xba, 0xc1, 0x80, 0xec, 0xe8, 0x94, 0x7a, 0x70, 0xec, - 0xe6, 0xec, 0xbe, 0x01, 0xef, 0x8d, 0xe2, 0xd2, 0xd0, 0x25, 0x74, 0xf3, 0x9d, 0xff, 0x4f, 0xfa, - 0x3f, 0x1b, 0xee, 0xc8, 0xdb, 0x3d, 0x3a, 0xed, 0x50, 0xb8, 0xce, 0x7a, 0xcb, 0xd3, 0xa0, 0xb0, - 0x13, 0x14, 0x94, 0xd1, 0x7e, 0x17, 0x30, 0xa0, 0x18, 0x12, 0xd9, 0x0a, 0xe6, 0xa5, 0x6e, 0x9b, - 0x0a, 0x77, 0x01, 0xc9, 0xf3, 0x04, 0xae, 0x0d, 0x12, 0xc9, 0x06, 0x13, 0xb6, 0x64, 0xf9, 0xac, - 0x3a, 0x8e, 0xd9, 0x37, 0x83, 0xc5, 0x21, 0x49, 0xce, 0xb6, 0x84, 0xe3, 0x51, 0xfe, 0x04, 0x0b, - 0xc2, 0x6e, 0xaf, 0x6b, 0xfc, 0x6a, 0xa5, 0xc1, 0xe4, 0x32, 0x5e, 0xcf, 0x7f, 0x77, 0x6f, 0xd2, - 0x20, 0x7f, 0x80, 0x99, 0xd7, 0x06, 0xc9, 0x4b, 0xe3, 0x92, 0xc9, 0x92, 0xe5, 0x93, 0xea, 0x6f, - 0xc1, 0x53, 0xb8, 0xd9, 0x5a, 0xf2, 0x11, 0x9e, 0x46, 0x78, 0x98, 0x5f, 0x08, 0xee, 0x37, 0xd1, - 0xe4, 0xbd, 0x37, 0xd9, 0x1c, 0x45, 0xf8, 0x27, 0x4c, 0xfb, 0x7a, 0x7c, 0x25, 0xc6, 0x6d, 0xc5, - 0x89, 0x6a, 0x9a, 0x9f, 0x0f, 0x1e, 0x4c, 0xb3, 0x8b, 0xb5, 0x84, 0xc7, 0xda, 0x9a, 0x7f, 0x80, - 0xf5, 0xed, 0xd0, 0xa4, 0xec, 0xdf, 0xbc, 0x64, 0x1f, 0xcf, 0x8d, 0xf6, 0xdb, 0xa0, 0x44, 0x6d, - 0x4d, 0xd1, 0x83, 0xc5, 0x09, 0x58, 0x0c, 0x60, 0x11, 0xbf, 0xc8, 0x29, 0x75, 0x15, 0x0f, 0xaf, - 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x5c, 0xd3, 0x2a, 0x7a, 0xbe, 0x01, 0x00, 0x00, - }, -} - -func init() { - yarpc.RegisterClientBuilder( - func(clientConfig transport.ClientConfig, structField reflect.StructField) SubmitQueueStovepipeYARPCClient { - return NewSubmitQueueStovepipeYARPCClient(clientConfig, protobuf.ClientBuilderOptions(clientConfig, structField)...) - }, - ) -} diff --git a/test/integration/stovepipe/BUILD.bazel b/test/integration/stovepipe/BUILD.bazel index 3121c0b0..5487d4d2 100644 --- a/test/integration/stovepipe/BUILD.bazel +++ b/test/integration/stovepipe/BUILD.bazel @@ -10,7 +10,7 @@ go_test( ], tags = ["integration"], deps = [ - "//stovepipe/protopb", + "//stovepipe/gateway/protopb", "//test/testutil", "@com_github_stretchr_testify//assert", "@com_github_stretchr_testify//require", diff --git a/test/integration/stovepipe/suite_test.go b/test/integration/stovepipe/suite_test.go index 262f2502..397e86bc 100644 --- a/test/integration/stovepipe/suite_test.go +++ b/test/integration/stovepipe/suite_test.go @@ -30,7 +30,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - pb "github.com/uber/submitqueue/stovepipe/protopb" + pb "github.com/uber/submitqueue/stovepipe/gateway/protopb" "github.com/uber/submitqueue/test/testutil" "google.golang.org/grpc" )