mirror of
https://github.com/googleforgames/open-match.git
synced 2025-03-14 10:08:44 +00:00
Rename Mmlogic to Queryservice (#1055)
Resolved #996. Manually rename the file name under internal/app/mmlogic and cmd/mmlogic from mmlogic.go to query.go to keep the image name consistent with our backend and frontend naming. TODO: Rename backend and frontend API to BackendService and FrontendService instead.
This commit is contained in:
@ -116,7 +116,7 @@ creds.json
|
||||
# Open Match Binaries
|
||||
cmd/backend/backend
|
||||
cmd/frontend/frontend
|
||||
cmd/mmlogic/mmlogic
|
||||
cmd/query/query
|
||||
cmd/synchronizer/synchronizer
|
||||
cmd/minimatch/minimatch
|
||||
cmd/swaggerui/swaggerui
|
||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -112,7 +112,7 @@ creds.json
|
||||
# Open Match Binaries
|
||||
cmd/backend/backend
|
||||
cmd/frontend/frontend
|
||||
cmd/mmlogic/mmlogic
|
||||
cmd/query/query
|
||||
cmd/synchronizer/synchronizer
|
||||
cmd/minimatch/minimatch
|
||||
cmd/swaggerui/swaggerui
|
||||
|
38
Makefile
38
Makefile
@ -106,7 +106,7 @@ JAEGER_QUERY_PORT = 16686
|
||||
GRAFANA_PORT = 3000
|
||||
FRONTEND_PORT = 51504
|
||||
BACKEND_PORT = 51505
|
||||
MMLOGIC_PORT = 51503
|
||||
QUERY_PORT = 51503
|
||||
SYNCHRONIZER_PORT = 51506
|
||||
DEMO_PORT = 51507
|
||||
PROTOC := $(TOOLCHAIN_BIN)/protoc$(EXE_EXTENSION)
|
||||
@ -190,11 +190,11 @@ else
|
||||
endif
|
||||
endif
|
||||
|
||||
GOLANG_PROTOS = pkg/pb/backend.pb.go pkg/pb/frontend.pb.go pkg/pb/matchfunction.pb.go pkg/pb/mmlogic.pb.go pkg/pb/messages.pb.go pkg/pb/extensions.pb.go pkg/pb/evaluator.pb.go internal/ipb/synchronizer.pb.go pkg/pb/backend.pb.gw.go pkg/pb/frontend.pb.gw.go pkg/pb/matchfunction.pb.gw.go pkg/pb/mmlogic.pb.gw.go pkg/pb/evaluator.pb.gw.go
|
||||
GOLANG_PROTOS = pkg/pb/backend.pb.go pkg/pb/frontend.pb.go pkg/pb/matchfunction.pb.go pkg/pb/query.pb.go pkg/pb/messages.pb.go pkg/pb/extensions.pb.go pkg/pb/evaluator.pb.go internal/ipb/synchronizer.pb.go pkg/pb/backend.pb.gw.go pkg/pb/frontend.pb.gw.go pkg/pb/matchfunction.pb.gw.go pkg/pb/query.pb.gw.go pkg/pb/evaluator.pb.gw.go
|
||||
|
||||
CSHARP_PROTOS = csharp/OpenMatch/Backend.cs csharp/OpenMatch/Frontend.cs csharp/OpenMatch/Evaluator.cs csharp/OpenMatch/Matchfunction.cs csharp/OpenMatch/Messages.cs csharp/OpenMatch/Mmlogic.cs
|
||||
CSHARP_PROTOS = csharp/OpenMatch/Backend.cs csharp/OpenMatch/Frontend.cs csharp/OpenMatch/Evaluator.cs csharp/OpenMatch/Matchfunction.cs csharp/OpenMatch/Messages.cs csharp/OpenMatch/Query.cs
|
||||
|
||||
SWAGGER_JSON_DOCS = api/frontend.swagger.json api/backend.swagger.json api/mmlogic.swagger.json api/matchfunction.swagger.json api/evaluator.swagger.json
|
||||
SWAGGER_JSON_DOCS = api/frontend.swagger.json api/backend.swagger.json api/query.swagger.json api/matchfunction.swagger.json api/evaluator.swagger.json
|
||||
|
||||
# Comment out CSHARP_PROTOS build since it requires setting up dotnet dependencies and plugins.
|
||||
# I'll manually update the csharp protos for now, and
|
||||
@ -378,7 +378,7 @@ install-ci-chart: install-chart-prerequisite build/toolchain/bin/helm$(EXE_EXTEN
|
||||
--set open-match-customize.function.enabled=true \
|
||||
--set open-match-customize.evaluator.enabled=true \
|
||||
--set open-match-customize.function.image=openmatch-mmf-go-pool \
|
||||
--set mmlogic.replicas=1,frontend.replicas=1,backend.replicas=1,open-match-customize.evaluator.replicas=1,open-match-customize.function.replicas=1 \
|
||||
--set query.replicas=1,frontend.replicas=1,backend.replicas=1,open-match-customize.evaluator.replicas=1,open-match-customize.function.replicas=1 \
|
||||
--set redis.master.resources.requests.cpu=0.6,redis.master.resources.requests.memory=300Mi \
|
||||
--set ci=true
|
||||
|
||||
@ -701,7 +701,7 @@ description: \
|
||||
pkg/pb/backend.pb.go: pkg/pb/messages.pb.go
|
||||
pkg/pb/frontend.pb.go: pkg/pb/messages.pb.go
|
||||
pkg/pb/matchfunction.pb.go: pkg/pb/messages.pb.go
|
||||
pkg/pb/mmlogic.pb.go: pkg/pb/messages.pb.go
|
||||
pkg/pb/query.pb.go: pkg/pb/messages.pb.go
|
||||
pkg/pb/evaluator.pb.go: pkg/pb/messages.pb.go
|
||||
internal/ipb/synchronizer.pb.go: pkg/pb/messages.pb.go
|
||||
|
||||
@ -760,16 +760,16 @@ all: service-binaries example-binaries tools-binaries
|
||||
|
||||
service-binaries: cmd/minimatch/minimatch$(EXE_EXTENSION) cmd/swaggerui/swaggerui$(EXE_EXTENSION)
|
||||
service-binaries: cmd/backend/backend$(EXE_EXTENSION) cmd/frontend/frontend$(EXE_EXTENSION)
|
||||
service-binaries: cmd/mmlogic/mmlogic$(EXE_EXTENSION) cmd/synchronizer/synchronizer$(EXE_EXTENSION)
|
||||
service-binaries: cmd/query/query$(EXE_EXTENSION) cmd/synchronizer/synchronizer$(EXE_EXTENSION)
|
||||
|
||||
example-binaries: example-mmf-binaries example-evaluator-binaries
|
||||
example-mmf-binaries: examples/functions/golang/soloduel/soloduel$(EXE_EXTENSION)
|
||||
example-evaluator-binaries: test/evaluator/evaluator$(EXE_EXTENSION)
|
||||
|
||||
examples/functions/golang/soloduel/soloduel$(EXE_EXTENSION): pkg/pb/mmlogic.pb.go pkg/pb/mmlogic.pb.gw.go api/mmlogic.swagger.json pkg/pb/matchfunction.pb.go pkg/pb/matchfunction.pb.gw.go api/matchfunction.swagger.json
|
||||
examples/functions/golang/soloduel/soloduel$(EXE_EXTENSION): pkg/pb/query.pb.go pkg/pb/query.pb.gw.go api/query.swagger.json pkg/pb/matchfunction.pb.go pkg/pb/matchfunction.pb.gw.go api/matchfunction.swagger.json
|
||||
cd $(REPOSITORY_ROOT)/examples/functions/golang/soloduel; $(GO_BUILD_COMMAND)
|
||||
|
||||
test/matchfunction/matchfunction$(EXE_EXTENSION): pkg/pb/mmlogic.pb.go pkg/pb/mmlogic.pb.gw.go api/mmlogic.swagger.json pkg/pb/matchfunction.pb.go pkg/pb/matchfunction.pb.gw.go api/matchfunction.swagger.json
|
||||
test/matchfunction/matchfunction$(EXE_EXTENSION): pkg/pb/query.pb.go pkg/pb/query.pb.gw.go api/query.swagger.json pkg/pb/matchfunction.pb.go pkg/pb/matchfunction.pb.gw.go api/matchfunction.swagger.json
|
||||
cd $(REPOSITORY_ROOT)/test/matchfunction; $(GO_BUILD_COMMAND)
|
||||
|
||||
test/evaluator/evaluator$(EXE_EXTENSION): pkg/pb/evaluator.pb.go pkg/pb/evaluator.pb.gw.go api/evaluator.swagger.json
|
||||
@ -783,8 +783,8 @@ cmd/backend/backend$(EXE_EXTENSION): pkg/pb/backend.pb.go pkg/pb/backend.pb.gw.g
|
||||
cmd/frontend/frontend$(EXE_EXTENSION): pkg/pb/frontend.pb.go pkg/pb/frontend.pb.gw.go api/frontend.swagger.json
|
||||
cd $(REPOSITORY_ROOT)/cmd/frontend; $(GO_BUILD_COMMAND)
|
||||
|
||||
cmd/mmlogic/mmlogic$(EXE_EXTENSION): pkg/pb/mmlogic.pb.go pkg/pb/mmlogic.pb.gw.go api/mmlogic.swagger.json
|
||||
cd $(REPOSITORY_ROOT)/cmd/mmlogic; $(GO_BUILD_COMMAND)
|
||||
cmd/query/query$(EXE_EXTENSION): pkg/pb/query.pb.go pkg/pb/query.pb.gw.go api/query.swagger.json
|
||||
cd $(REPOSITORY_ROOT)/cmd/query; $(GO_BUILD_COMMAND)
|
||||
|
||||
cmd/synchronizer/synchronizer$(EXE_EXTENSION): internal/ipb/synchronizer.pb.go
|
||||
cd $(REPOSITORY_ROOT)/cmd/synchronizer; $(GO_BUILD_COMMAND)
|
||||
@ -792,7 +792,7 @@ cmd/synchronizer/synchronizer$(EXE_EXTENSION): internal/ipb/synchronizer.pb.go
|
||||
# Note: This list of dependencies is long but only add file references here. If you add a .PHONY dependency make will always rebuild it.
|
||||
cmd/minimatch/minimatch$(EXE_EXTENSION): pkg/pb/backend.pb.go pkg/pb/backend.pb.gw.go api/backend.swagger.json
|
||||
cmd/minimatch/minimatch$(EXE_EXTENSION): pkg/pb/frontend.pb.go pkg/pb/frontend.pb.gw.go api/frontend.swagger.json
|
||||
cmd/minimatch/minimatch$(EXE_EXTENSION): pkg/pb/mmlogic.pb.go pkg/pb/mmlogic.pb.gw.go api/mmlogic.swagger.json
|
||||
cmd/minimatch/minimatch$(EXE_EXTENSION): pkg/pb/query.pb.go pkg/pb/query.pb.gw.go api/query.swagger.json
|
||||
cmd/minimatch/minimatch$(EXE_EXTENSION): pkg/pb/evaluator.pb.go pkg/pb/evaluator.pb.gw.go api/evaluator.swagger.json
|
||||
cmd/minimatch/minimatch$(EXE_EXTENSION): pkg/pb/matchfunction.pb.go pkg/pb/matchfunction.pb.gw.go api/matchfunction.swagger.json
|
||||
cmd/minimatch/minimatch$(EXE_EXTENSION): pkg/pb/messages.pb.go
|
||||
@ -903,7 +903,7 @@ clean-binaries:
|
||||
rm -rf $(REPOSITORY_ROOT)/cmd/backend/backend$(EXE_EXTENSION)
|
||||
rm -rf $(REPOSITORY_ROOT)/cmd/synchronizer/synchronizer$(EXE_EXTENSION)
|
||||
rm -rf $(REPOSITORY_ROOT)/cmd/frontend/frontend$(EXE_EXTENSION)
|
||||
rm -rf $(REPOSITORY_ROOT)/cmd/mmlogic/mmlogic$(EXE_EXTENSION)
|
||||
rm -rf $(REPOSITORY_ROOT)/cmd/query/query$(EXE_EXTENSION)
|
||||
rm -rf $(REPOSITORY_ROOT)/cmd/minimatch/minimatch$(EXE_EXTENSION)
|
||||
rm -rf $(REPOSITORY_ROOT)/examples/functions/golang/soloduel/soloduel$(EXE_EXTENSION)
|
||||
rm -rf $(REPOSITORY_ROOT)/test/matchfunction/matchfunction$(EXE_EXTENSION)
|
||||
@ -950,11 +950,11 @@ proxy-backend: build/toolchain/bin/kubectl$(EXE_EXTENSION)
|
||||
@echo "Backend Trace: http://localhost:$(BACKEND_PORT)/debug/tracez"
|
||||
$(KUBECTL) port-forward --namespace $(OPEN_MATCH_KUBERNETES_NAMESPACE) $(shell $(KUBECTL) get pod --namespace $(OPEN_MATCH_KUBERNETES_NAMESPACE) --selector="app=open-match,component=backend,release=$(OPEN_MATCH_HELM_NAME)" --output jsonpath='{.items[0].metadata.name}') $(BACKEND_PORT):51505 $(PORT_FORWARD_ADDRESS_FLAG)
|
||||
|
||||
proxy-mmlogic: build/toolchain/bin/kubectl$(EXE_EXTENSION)
|
||||
@echo "MmLogic Health: http://localhost:$(MMLOGIC_PORT)/healthz"
|
||||
@echo "MmLogic RPC: http://localhost:$(MMLOGIC_PORT)/debug/rpcz"
|
||||
@echo "MmLogic Trace: http://localhost:$(MMLOGIC_PORT)/debug/tracez"
|
||||
$(KUBECTL) port-forward --namespace $(OPEN_MATCH_KUBERNETES_NAMESPACE) $(shell $(KUBECTL) get pod --namespace $(OPEN_MATCH_KUBERNETES_NAMESPACE) --selector="app=open-match,component=mmlogic,release=$(OPEN_MATCH_HELM_NAME)" --output jsonpath='{.items[0].metadata.name}') $(MMLOGIC_PORT):51503 $(PORT_FORWARD_ADDRESS_FLAG)
|
||||
proxy-query: build/toolchain/bin/kubectl$(EXE_EXTENSION)
|
||||
@echo "QueryService Health: http://localhost:$(QUERY_PORT)/healthz"
|
||||
@echo "QueryService RPC: http://localhost:$(QUERY_PORT)/debug/rpcz"
|
||||
@echo "QueryService Trace: http://localhost:$(QUERY_PORT)/debug/tracez"
|
||||
$(KUBECTL) port-forward --namespace $(OPEN_MATCH_KUBERNETES_NAMESPACE) $(shell $(KUBECTL) get pod --namespace $(OPEN_MATCH_KUBERNETES_NAMESPACE) --selector="app=open-match,component=query,release=$(OPEN_MATCH_HELM_NAME)" --output jsonpath='{.items[0].metadata.name}') $(QUERY_PORT):51503 $(PORT_FORWARD_ADDRESS_FLAG)
|
||||
|
||||
proxy-synchronizer: build/toolchain/bin/kubectl$(EXE_EXTENSION)
|
||||
@echo "Synchronizer Health: http://localhost:$(SYNCHRONIZER_PORT)/healthz"
|
||||
@ -987,7 +987,7 @@ proxy-demo: build/toolchain/bin/kubectl$(EXE_EXTENSION)
|
||||
|
||||
# Run `make proxy` instead to run everything at the same time.
|
||||
# If you run this directly it will just run each proxy sequentially.
|
||||
proxy-all: proxy-frontend proxy-backend proxy-mmlogic proxy-grafana proxy-prometheus proxy-jaeger proxy-synchronizer proxy-ui proxy-dashboard proxy-demo
|
||||
proxy-all: proxy-frontend proxy-backend proxy-query proxy-grafana proxy-prometheus proxy-jaeger proxy-synchronizer proxy-ui proxy-dashboard proxy-demo
|
||||
|
||||
proxy:
|
||||
# This is an exception case where we'll call recursive make.
|
||||
|
@ -411,11 +411,11 @@
|
||||
"code": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"description": "The status code, which should be an enum value of\n[google.rpc.Code][google.rpc.Code]."
|
||||
"description": "The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]."
|
||||
},
|
||||
"message": {
|
||||
"type": "string",
|
||||
"description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\n[google.rpc.Status.details][google.rpc.Status.details] field, or localized\nby the client."
|
||||
"description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\n[google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client."
|
||||
},
|
||||
"details": {
|
||||
"type": "array",
|
||||
@ -425,8 +425,7 @@
|
||||
"description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use."
|
||||
}
|
||||
},
|
||||
"description": "- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error\nmessage, and error details. The error code should be an enum value of\n[google.rpc.Code][google.rpc.Code], but it may accept additional error codes\nif needed. The error message should be a developer-facing English message\nthat helps developers *understand* and *resolve* the error. If a localized\nuser-facing error message is needed, put the localized message in the error\ndetails or localize it in the client. The optional error details may contain\narbitrary information about the error. There is a predefined set of error\ndetail types in the package `google.rpc` that can be used for common error\nconditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.",
|
||||
"title": "The `Status` type defines a logical error model that is suitable for\ndifferent programming environments, including REST APIs and RPC APIs. It is\nused by [gRPC](https://github.com/grpc). The error model is designed to be:"
|
||||
"description": "The `Status` type defines a logical error model that is suitable for\ndifferent programming environments, including REST APIs and RPC APIs. It is\nused by [gRPC](https://github.com/grpc). Each `Status` message contains\nthree pieces of data: error code, error message, and error details.\n\nYou can find out more about this error model and how to work with it in the\n[API Design Guide](https://cloud.google.com/apis/design/errors)."
|
||||
},
|
||||
"runtimeStreamError": {
|
||||
"type": "object",
|
||||
|
@ -230,11 +230,11 @@
|
||||
"code": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"description": "The status code, which should be an enum value of\n[google.rpc.Code][google.rpc.Code]."
|
||||
"description": "The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]."
|
||||
},
|
||||
"message": {
|
||||
"type": "string",
|
||||
"description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\n[google.rpc.Status.details][google.rpc.Status.details] field, or localized\nby the client."
|
||||
"description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\n[google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client."
|
||||
},
|
||||
"details": {
|
||||
"type": "array",
|
||||
@ -244,8 +244,7 @@
|
||||
"description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use."
|
||||
}
|
||||
},
|
||||
"description": "- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error\nmessage, and error details. The error code should be an enum value of\n[google.rpc.Code][google.rpc.Code], but it may accept additional error codes\nif needed. The error message should be a developer-facing English message\nthat helps developers *understand* and *resolve* the error. If a localized\nuser-facing error message is needed, put the localized message in the error\ndetails or localize it in the client. The optional error details may contain\narbitrary information about the error. There is a predefined set of error\ndetail types in the package `google.rpc` that can be used for common error\nconditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.",
|
||||
"title": "The `Status` type defines a logical error model that is suitable for\ndifferent programming environments, including REST APIs and RPC APIs. It is\nused by [gRPC](https://github.com/grpc). The error model is designed to be:"
|
||||
"description": "The `Status` type defines a logical error model that is suitable for\ndifferent programming environments, including REST APIs and RPC APIs. It is\nused by [gRPC](https://github.com/grpc). Each `Status` message contains\nthree pieces of data: error code, error message, and error details.\n\nYou can find out more about this error model and how to work with it in the\n[API Design Guide](https://cloud.google.com/apis/design/errors)."
|
||||
},
|
||||
"runtimeStreamError": {
|
||||
"type": "object",
|
||||
|
@ -92,7 +92,7 @@ service Frontend {
|
||||
// CreateTicket assigns an unique TicketId to the input Ticket and record it in state storage.
|
||||
// A ticket is considered as ready for matchmaking once it is created.
|
||||
// - If a TicketId exists in a Ticket request, an auto-generated TicketId will override this field.
|
||||
// - If SearchFields exist in a Ticket, CreateTicket will also index these fields such that one can query the ticket with mmlogic.QueryTickets function.
|
||||
// - If SearchFields exist in a Ticket, CreateTicket will also index these fields such that one can query the ticket with query.QueryTickets function.
|
||||
rpc CreateTicket(CreateTicketRequest) returns (CreateTicketResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/v1/frontend/tickets"
|
||||
|
@ -26,7 +26,7 @@
|
||||
"paths": {
|
||||
"/v1/frontend/tickets": {
|
||||
"post": {
|
||||
"summary": "CreateTicket assigns an unique TicketId to the input Ticket and record it in state storage.\nA ticket is considered as ready for matchmaking once it is created.\n - If a TicketId exists in a Ticket request, an auto-generated TicketId will override this field.\n - If SearchFields exist in a Ticket, CreateTicket will also index these fields such that one can query the ticket with mmlogic.QueryTickets function.",
|
||||
"summary": "CreateTicket assigns an unique TicketId to the input Ticket and record it in state storage.\nA ticket is considered as ready for matchmaking once it is created.\n - If a TicketId exists in a Ticket request, an auto-generated TicketId will override this field.\n - If SearchFields exist in a Ticket, CreateTicket will also index these fields such that one can query the ticket with query.QueryTickets function.",
|
||||
"operationId": "CreateTicket",
|
||||
"responses": {
|
||||
"200": {
|
||||
@ -282,11 +282,11 @@
|
||||
"code": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"description": "The status code, which should be an enum value of\n[google.rpc.Code][google.rpc.Code]."
|
||||
"description": "The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]."
|
||||
},
|
||||
"message": {
|
||||
"type": "string",
|
||||
"description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\n[google.rpc.Status.details][google.rpc.Status.details] field, or localized\nby the client."
|
||||
"description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\n[google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client."
|
||||
},
|
||||
"details": {
|
||||
"type": "array",
|
||||
@ -296,8 +296,7 @@
|
||||
"description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use."
|
||||
}
|
||||
},
|
||||
"description": "- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error\nmessage, and error details. The error code should be an enum value of\n[google.rpc.Code][google.rpc.Code], but it may accept additional error codes\nif needed. The error message should be a developer-facing English message\nthat helps developers *understand* and *resolve* the error. If a localized\nuser-facing error message is needed, put the localized message in the error\ndetails or localize it in the client. The optional error details may contain\narbitrary information about the error. There is a predefined set of error\ndetail types in the package `google.rpc` that can be used for common error\nconditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.",
|
||||
"title": "The `Status` type defines a logical error model that is suitable for\ndifferent programming environments, including REST APIs and RPC APIs. It is\nused by [gRPC](https://github.com/grpc). The error model is designed to be:"
|
||||
"description": "The `Status` type defines a logical error model that is suitable for\ndifferent programming environments, including REST APIs and RPC APIs. It is\nused by [gRPC](https://github.com/grpc). Each `Status` message contains\nthree pieces of data: error code, error message, and error details.\n\nYou can find out more about this error model and how to work with it in the\n[API Design Guide](https://cloud.google.com/apis/design/errors)."
|
||||
},
|
||||
"runtimeStreamError": {
|
||||
"type": "object",
|
||||
|
@ -69,7 +69,7 @@ message RunResponse {
|
||||
// The MatchFunction service implements APIs to run user-defined matchmaking logics.
|
||||
service MatchFunction {
|
||||
// DO NOT CALL THIS FUNCTION MANUALLY. USE backend.FetchMatches INSTEAD.
|
||||
// Run pulls Tickets that satisify Profile constraints from Mmlogic, runs matchmaking logics against them, then
|
||||
// Run pulls Tickets that satisify Profile constraints from QueryService, runs matchmaking logics against them, then
|
||||
// constructs and streams back match candidates to the Backend service.
|
||||
rpc Run(RunRequest) returns (stream RunResponse) {
|
||||
option (google.api.http) = {
|
||||
|
@ -26,7 +26,7 @@
|
||||
"paths": {
|
||||
"/v1/matchfunction:run": {
|
||||
"post": {
|
||||
"summary": "DO NOT CALL THIS FUNCTION MANUALLY. USE backend.FetchMatches INSTEAD.\nRun pulls Tickets that satisify Profile constraints from Mmlogic, runs matchmaking logics against them, then\nconstructs and streams back match candidates to the Backend service.",
|
||||
"summary": "DO NOT CALL THIS FUNCTION MANUALLY. USE backend.FetchMatches INSTEAD.\nRun pulls Tickets that satisify Profile constraints from QueryService, runs matchmaking logics against them, then\nconstructs and streams back match candidates to the Backend service.",
|
||||
"operationId": "Run",
|
||||
"responses": {
|
||||
"200": {
|
||||
@ -330,11 +330,11 @@
|
||||
"code": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"description": "The status code, which should be an enum value of\n[google.rpc.Code][google.rpc.Code]."
|
||||
"description": "The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]."
|
||||
},
|
||||
"message": {
|
||||
"type": "string",
|
||||
"description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\n[google.rpc.Status.details][google.rpc.Status.details] field, or localized\nby the client."
|
||||
"description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\n[google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client."
|
||||
},
|
||||
"details": {
|
||||
"type": "array",
|
||||
@ -344,8 +344,7 @@
|
||||
"description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use."
|
||||
}
|
||||
},
|
||||
"description": "- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error\nmessage, and error details. The error code should be an enum value of\n[google.rpc.Code][google.rpc.Code], but it may accept additional error codes\nif needed. The error message should be a developer-facing English message\nthat helps developers *understand* and *resolve* the error. If a localized\nuser-facing error message is needed, put the localized message in the error\ndetails or localize it in the client. The optional error details may contain\narbitrary information about the error. There is a predefined set of error\ndetail types in the package `google.rpc` that can be used for common error\nconditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.",
|
||||
"title": "The `Status` type defines a logical error model that is suitable for\ndifferent programming environments, including REST APIs and RPC APIs. It is\nused by [gRPC](https://github.com/grpc). The error model is designed to be:"
|
||||
"description": "The `Status` type defines a logical error model that is suitable for\ndifferent programming environments, including REST APIs and RPC APIs. It is\nused by [gRPC](https://github.com/grpc). Each `Status` message contains\nthree pieces of data: error code, error message, and error details.\n\nYou can find out more about this error model and how to work with it in the\n[API Design Guide](https://cloud.google.com/apis/design/errors)."
|
||||
},
|
||||
"runtimeStreamError": {
|
||||
"type": "object",
|
||||
|
@ -65,15 +65,15 @@ message QueryTicketsResponse {
|
||||
repeated Ticket tickets = 1;
|
||||
}
|
||||
|
||||
// The MmLogic service implements helper APIs for Match Function to query Tickets from state storage.
|
||||
service MmLogic {
|
||||
// The QueryService service implements helper APIs for Match Function to query Tickets from state storage.
|
||||
service QueryService {
|
||||
// QueryTickets gets a list of Tickets that match all Filters of the input Pool.
|
||||
// - If the Pool contains no Filters, QueryTickets will return all Tickets in the state storage.
|
||||
// QueryTickets pages the Tickets by `storage.pool.size` and stream back response.
|
||||
// - storage.pool.size is default to 1000 if not set, and has a mininum of 10 and maximum of 10000
|
||||
rpc QueryTickets(QueryTicketsRequest) returns (stream QueryTicketsResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/v1/mmlogic/tickets:query"
|
||||
post: "/v1/queryservice/tickets:query"
|
||||
body: "*"
|
||||
};
|
||||
}
|
@ -24,7 +24,7 @@
|
||||
"application/json"
|
||||
],
|
||||
"paths": {
|
||||
"/v1/mmlogic/tickets:query": {
|
||||
"/v1/queryservice/tickets:query": {
|
||||
"post": {
|
||||
"summary": "QueryTickets gets a list of Tickets that match all Filters of the input Pool.\n - If the Pool contains no Filters, QueryTickets will return all Tickets in the state storage.\nQueryTickets pages the Tickets by `storage.pool.size` and stream back response.\n - storage.pool.size is default to 1000 if not set, and has a mininum of 10 and maximum of 10000",
|
||||
"operationId": "QueryTickets",
|
||||
@ -54,7 +54,7 @@
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"MmLogic"
|
||||
"QueryService"
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -246,11 +246,11 @@
|
||||
"code": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"description": "The status code, which should be an enum value of\n[google.rpc.Code][google.rpc.Code]."
|
||||
"description": "The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]."
|
||||
},
|
||||
"message": {
|
||||
"type": "string",
|
||||
"description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\n[google.rpc.Status.details][google.rpc.Status.details] field, or localized\nby the client."
|
||||
"description": "A developer-facing error message, which should be in English. Any\nuser-facing error message should be localized and sent in the\n[google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client."
|
||||
},
|
||||
"details": {
|
||||
"type": "array",
|
||||
@ -260,8 +260,7 @@
|
||||
"description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use."
|
||||
}
|
||||
},
|
||||
"description": "- Simple to use and understand for most users\n- Flexible enough to meet unexpected needs\n\n# Overview\n\nThe `Status` message contains three pieces of data: error code, error\nmessage, and error details. The error code should be an enum value of\n[google.rpc.Code][google.rpc.Code], but it may accept additional error codes\nif needed. The error message should be a developer-facing English message\nthat helps developers *understand* and *resolve* the error. If a localized\nuser-facing error message is needed, put the localized message in the error\ndetails or localize it in the client. The optional error details may contain\narbitrary information about the error. There is a predefined set of error\ndetail types in the package `google.rpc` that can be used for common error\nconditions.\n\n# Language mapping\n\nThe `Status` message is the logical representation of the error model, but it\nis not necessarily the actual wire format. When the `Status` message is\nexposed in different client libraries and different wire protocols, it can be\nmapped differently. For example, it will likely be mapped to some exceptions\nin Java, but more likely mapped to some error codes in C.\n\n# Other uses\n\nThe error model and the `Status` message can be used in a variety of\nenvironments, either with or without APIs, to provide a\nconsistent developer experience across different environments.\n\nExample uses of this error model include:\n\n- Partial errors. If a service needs to return partial errors to the client,\n it may embed the `Status` in the normal response to indicate the partial\n errors.\n\n- Workflow errors. A typical workflow has multiple steps. Each step may\n have a `Status` message for error reporting.\n\n- Batch operations. If a client uses batch request and batch response, the\n `Status` message should be used directly inside batch response, one for\n each error sub-response.\n\n- Asynchronous operations. If an API call embeds asynchronous operation\n results in its response, the status of those operations should be\n represented directly using the `Status` message.\n\n- Logging. If some API errors are stored in logs, the message `Status` could\n be used directly after any stripping needed for security/privacy reasons.",
|
||||
"title": "The `Status` type defines a logical error model that is suitable for\ndifferent programming environments, including REST APIs and RPC APIs. It is\nused by [gRPC](https://github.com/grpc). The error model is designed to be:"
|
||||
"description": "The `Status` type defines a logical error model that is suitable for\ndifferent programming environments, including REST APIs and RPC APIs. It is\nused by [gRPC](https://github.com/grpc). Each `Status` message contains\nthree pieces of data: error code, error message, and error details.\n\nYou can find out more about this error model and how to work with it in the\n[API Design Guide](https://cloud.google.com/apis/design/errors)."
|
||||
},
|
||||
"runtimeStreamError": {
|
||||
"type": "object",
|
@ -12,15 +12,15 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// Package main is the mmlogic service for Open Match.
|
||||
// Package main is the query service for Open Match.
|
||||
package main
|
||||
|
||||
import (
|
||||
"open-match.dev/open-match/internal/app"
|
||||
"open-match.dev/open-match/internal/app/mmlogic"
|
||||
"open-match.dev/open-match/internal/app/query"
|
||||
"open-match.dev/open-match/internal/config"
|
||||
)
|
||||
|
||||
func main() {
|
||||
app.RunApplication("mmlogic", config.Read, mmlogic.BindService)
|
||||
app.RunApplication("query", config.Read, query.BindService)
|
||||
}
|
@ -2,7 +2,7 @@
|
||||
"urls": [
|
||||
{"name": "Frontend", "url": "https://open-match.dev/api/v0.0.0-dev/frontend.swagger.json"},
|
||||
{"name": "Backend", "url": "https://open-match.dev/api/v0.0.0-dev/backend.swagger.json"},
|
||||
{"name": "Mmlogic", "url": "https://open-match.dev/api/v0.0.0-dev/mmlogic.swagger.json"},
|
||||
{"name": "Query", "url": "https://open-match.dev/api/v0.0.0-dev/query.swagger.json"},
|
||||
{"name": "MatchFunction", "url": "https://open-match.dev/api/v0.0.0-dev/matchfunction.swagger.json"},
|
||||
{"name": "Synchronizer", "url": "https://open-match.dev/api/v0.0.0-dev/synchronizer.swagger.json"},
|
||||
{"name": "Evaluator", "url": "https://open-match.dev/api/v0.0.0-dev/evaluator.swagger.json"}
|
||||
|
@ -117,7 +117,7 @@ By default you will be talking to the frontend server but you can change the tar
|
||||
* api/frontend.swagger.json
|
||||
* api/backend.swagger.json
|
||||
* api/synchronizer.swagger.json
|
||||
* api/mmlogic.swagger.json
|
||||
* api/query.swagger.json
|
||||
|
||||
For a more current list refer to the api/ directory of this repository. Also matchfunction.swagger.json is not supported.
|
||||
|
||||
|
@ -33,7 +33,7 @@ Images
|
||||
# Servers
|
||||
docker pull gcr.io/open-match-public-images/openmatch-backend:{version}
|
||||
docker pull gcr.io/open-match-public-images/openmatch-frontend:{version}
|
||||
docker pull gcr.io/open-match-public-images/openmatch-mmlogic:{version}
|
||||
docker pull gcr.io/open-match-public-images/openmatch-query:{version}
|
||||
docker pull gcr.io/open-match-public-images/openmatch-synchronizer:{version}
|
||||
|
||||
# Evaluators
|
||||
|
@ -12,7 +12,7 @@ SOURCE_VERSION=$1
|
||||
DEST_VERSION=$2
|
||||
SOURCE_PROJECT_ID=open-match-build
|
||||
DEST_PROJECT_ID=open-match-public-images
|
||||
IMAGE_NAMES="openmatch-backend openmatch-frontend openmatch-mmlogic openmatch-synchronizer openmatch-minimatch openmatch-demo-first-match openmatch-mmf-go-soloduel openmatch-mmf-go-pool openmatch-evaluator-go-simple openmatch-swaggerui openmatch-reaper"
|
||||
IMAGE_NAMES="openmatch-backend openmatch-frontend openmatch-query openmatch-synchronizer openmatch-minimatch openmatch-demo-first-match openmatch-mmf-go-soloduel openmatch-mmf-go-pool openmatch-evaluator-go-simple openmatch-swaggerui openmatch-reaper"
|
||||
|
||||
for name in $IMAGE_NAMES
|
||||
do
|
||||
|
@ -39,7 +39,7 @@ var (
|
||||
func Run() {
|
||||
activeScenario := scenarios.ActiveScenario
|
||||
|
||||
conn, err := grpc.Dial("om-mmlogic.open-match.svc.cluster.local:50503", utilTesting.NewGRPCDialOptions(logger)...)
|
||||
conn, err := grpc.Dial("om-query.open-match.svc.cluster.local:50503", utilTesting.NewGRPCDialOptions(logger)...)
|
||||
if err != nil {
|
||||
logger.Fatalf("Failed to connect to Open Match, got %v", err)
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ var (
|
||||
|
||||
func basicMatchFunction(req *pb.RunRequest, stream pb.MatchFunction_RunServer) error {
|
||||
// Fetch tickets for the pools specified in the Match Profile.
|
||||
poolTickets, err := matchfunction.QueryPools(stream.Context(), getMmlogicGRPCClient(), req.GetProfile().GetPools())
|
||||
poolTickets, err := matchfunction.QueryPools(stream.Context(), getQueryServiceGRPCClient(), req.GetProfile().GetPools())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
mmlogicAddress = "om-mmlogic.open-match.svc.cluster.local:50503" // Address of the MMLogic Endpoint.
|
||||
queryServiceAddress = "om-query.open-match.svc.cluster.local:50503" // Address of the QueryService Endpoint.
|
||||
)
|
||||
|
||||
// StatProcessor uses syncMaps to store the stress test metrics and occurrence of errors.
|
||||
@ -91,17 +91,17 @@ func (e StatProcessor) Log(w io.Writer) {
|
||||
})
|
||||
}
|
||||
|
||||
func getMmlogicGRPCClient() pb.MmLogicClient {
|
||||
conn, err := grpc.Dial(mmlogicAddress, testing.NewGRPCDialOptions(logger)...)
|
||||
func getQueryServiceGRPCClient() pb.QueryServiceClient {
|
||||
conn, err := grpc.Dial(queryServiceAddress, testing.NewGRPCDialOptions(logger)...)
|
||||
if err != nil {
|
||||
logger.Fatalf("Failed to connect to Open Match, got %v", err)
|
||||
}
|
||||
return pb.NewMmLogicClient(conn)
|
||||
return pb.NewQueryServiceClient(conn)
|
||||
}
|
||||
|
||||
func queryPoolsWrapper(mmf func(req *pb.MatchProfile, pools map[string][]*pb.Ticket) ([]*pb.Match, error)) matchFunction {
|
||||
return func(req *pb.RunRequest, stream pb.MatchFunction_RunServer) error {
|
||||
poolTickets, err := matchfunction.QueryPools(stream.Context(), getMmlogicGRPCClient(), req.GetProfile().GetPools())
|
||||
poolTickets, err := matchfunction.QueryPools(stream.Context(), getQueryServiceGRPCClient(), req.GetProfile().GetPools())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -38,8 +38,8 @@ data:
|
||||
httpport: 51502
|
||||
matchmaker_config_override.yaml: |-
|
||||
api:
|
||||
mmlogic:
|
||||
hostname: "om-mmlogic.open-match.svc.cluster.local"
|
||||
query:
|
||||
hostname: "om-query.open-match.svc.cluster.local"
|
||||
grpcport: "50503"
|
||||
---
|
||||
kind: Service
|
||||
|
@ -1,7 +1,7 @@
|
||||
### Open Match Helm Chart Templates
|
||||
This directory contains the [helm](https://helm.sh/ "helm") chart templates used to customize and deploy Open Match.
|
||||
|
||||
Templates under the `templates/` directory are for the core components in Open Match - e.g. backend, frontend, mmlogic, synchronizor, some security policies, and configmaps are defined under this folder.
|
||||
Templates under the `templates/` directory are for the core components in Open Match - e.g. backend, frontend, query, synchronizor, some security policies, and configmaps are defined under this folder.
|
||||
|
||||
Open Match also provides templates for optional components that are disabled by default under the `subcharts/` directory.
|
||||
1. `open-match-customize` contains flexible templates to deploy your own matchfunction and evaluator.
|
||||
|
@ -36,6 +36,6 @@ data:
|
||||
httpport: "{{ .Values.evaluator.httpPort }}"
|
||||
matchmaker_config_override.yaml: |-
|
||||
api:
|
||||
mmlogic:
|
||||
hostname: "{{ .Values.mmlogic.hostName }}.{{ .Release.Namespace }}.svc.cluster.local"
|
||||
grpcport: "{{ .Values.mmlogic.grpcPort }}"
|
||||
query:
|
||||
hostname: "{{ .Values.query.hostName }}.{{ .Release.Namespace }}.svc.cluster.local"
|
||||
grpcport: "{{ .Values.query.grpcPort }}"
|
||||
|
@ -57,10 +57,10 @@ data:
|
||||
hostname: "{{ .Values.frontend.hostName }}"
|
||||
grpcport: "{{ .Values.frontend.grpcPort }}"
|
||||
httpport: "{{ .Values.frontend.httpPort }}"
|
||||
mmlogic:
|
||||
hostname: "{{ .Values.mmlogic.hostName }}"
|
||||
grpcport: "{{ .Values.mmlogic.grpcPort }}"
|
||||
httpport: "{{ .Values.mmlogic.httpPort }}"
|
||||
query:
|
||||
hostname: "{{ .Values.query.hostName }}"
|
||||
grpcport: "{{ .Values.query.grpcPort }}"
|
||||
httpport: "{{ .Values.query.httpPort }}"
|
||||
synchronizer:
|
||||
hostname: "{{ .Values.synchronizer.hostName }}"
|
||||
grpcport: "{{ .Values.synchronizer.grpcPort }}"
|
||||
|
@ -16,19 +16,19 @@
|
||||
kind: Service
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: {{ .Values.mmlogic.hostName }}
|
||||
name: {{ .Values.query.hostName }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
annotations: {{- include "openmatch.chartmeta" . | nindent 4 }}
|
||||
labels:
|
||||
app: {{ template "openmatch.name" . }}
|
||||
component: mmlogic
|
||||
component: query
|
||||
release: {{ .Release.Name }}
|
||||
spec:
|
||||
selector:
|
||||
app: {{ template "openmatch.name" . }}
|
||||
component: mmlogic
|
||||
component: query
|
||||
release: {{ .Release.Name }}
|
||||
{{- $portType := coalesce .Values.global.kubernetes.service.portType .Values.mmlogic.portType -}}
|
||||
{{- $portType := coalesce .Values.global.kubernetes.service.portType .Values.query.portType -}}
|
||||
{{- if eq $portType "ClusterIP" }}
|
||||
clusterIP: None
|
||||
{{- end }}
|
||||
@ -36,48 +36,48 @@ spec:
|
||||
ports:
|
||||
- name: grpc
|
||||
protocol: TCP
|
||||
port: {{ .Values.mmlogic.grpcPort }}
|
||||
port: {{ .Values.query.grpcPort }}
|
||||
- name: http
|
||||
protocol: TCP
|
||||
port: {{ .Values.mmlogic.httpPort }}
|
||||
port: {{ .Values.query.httpPort }}
|
||||
---
|
||||
apiVersion: autoscaling/v1
|
||||
kind: HorizontalPodAutoscaler
|
||||
metadata:
|
||||
name: {{ .Values.mmlogic.hostName }}
|
||||
name: {{ .Values.query.hostName }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
spec:
|
||||
scaleTargetRef:
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
name: {{ .Values.mmlogic.hostName }}
|
||||
name: {{ .Values.query.hostName }}
|
||||
{{- include "openmatch.HorizontalPodAutoscaler.spec.common" . | nindent 2 }}
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ .Values.mmlogic.hostName }}
|
||||
name: {{ .Values.query.hostName }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
annotations: {{- include "openmatch.chartmeta" . | nindent 4 }}
|
||||
labels:
|
||||
app: {{ template "openmatch.name" . }}
|
||||
component: mmlogic
|
||||
component: query
|
||||
release: {{ .Release.Name }}
|
||||
spec:
|
||||
replicas: {{ .Values.mmlogic.replicas }}
|
||||
replicas: {{ .Values.query.replicas }}
|
||||
selector:
|
||||
matchLabels:
|
||||
app: {{ template "openmatch.name" . }}
|
||||
component: mmlogic
|
||||
component: query
|
||||
template:
|
||||
metadata:
|
||||
namespace: {{ .Release.Namespace }}
|
||||
annotations:
|
||||
{{- include "openmatch.chartmeta" . | nindent 8 }}
|
||||
{{- include "prometheus.annotations" (dict "port" .Values.mmlogic.httpPort "prometheus" .Values.global.telemetry.prometheus) | nindent 8 }}
|
||||
{{- include "prometheus.annotations" (dict "port" .Values.query.httpPort "prometheus" .Values.global.telemetry.prometheus) | nindent 8 }}
|
||||
labels:
|
||||
app: {{ template "openmatch.name" . }}
|
||||
component: mmlogic
|
||||
component: query
|
||||
release: {{ .Release.Name }}
|
||||
spec:
|
||||
{{- include "openmatch.labels.nodegrouping" . | nindent 6 }}
|
||||
@ -87,17 +87,17 @@ spec:
|
||||
{{- include "openmatch.volumes.withredis" . | nindent 8 }}
|
||||
serviceAccountName: {{ .Values.global.kubernetes.serviceAccount }}
|
||||
containers:
|
||||
- name: {{ .Values.mmlogic.hostName }}
|
||||
- name: {{ .Values.query.hostName }}
|
||||
volumeMounts:
|
||||
{{- include "openmatch.volumemounts.configs" (dict "configs" .Values.configs) | nindent 10 }}
|
||||
{{- include "openmatch.volumemounts.tls" . | nindent 10 }}
|
||||
{{- include "openmatch.volumemounts.withredis" . | nindent 10}}
|
||||
image: "{{ .Values.global.image.registry }}/{{ .Values.mmlogic.image}}:{{ .Values.global.image.tag }}"
|
||||
image: "{{ .Values.global.image.registry }}/{{ .Values.query.image}}:{{ .Values.global.image.tag }}"
|
||||
ports:
|
||||
- name: grpc
|
||||
containerPort: {{ .Values.mmlogic.grpcPort }}
|
||||
containerPort: {{ .Values.query.grpcPort }}
|
||||
- name: http
|
||||
containerPort: {{ .Values.mmlogic.httpPort }}
|
||||
containerPort: {{ .Values.query.httpPort }}
|
||||
{{- include "openmatch.container.common" . | nindent 8 }}
|
||||
{{- include "kubernetes.probe" (dict "port" .Values.mmlogic.httpPort "isHTTPS" .Values.global.tls.enabled) | nindent 8 }}
|
||||
{{- include "kubernetes.probe" (dict "port" .Values.query.httpPort "isHTTPS" .Values.global.tls.enabled) | nindent 8 }}
|
||||
{{- end }}
|
@ -20,42 +20,42 @@
|
||||
# The configurations defined here will be applied when deploying Open Match to a Kubernetes cluster.
|
||||
# You may choose to override these values to tailor Open Match for your needs.
|
||||
#
|
||||
# Begins the configuration section for `mmlogic` component in Open Match.
|
||||
# mmlogic:
|
||||
# Begins the configuration section for `query` component in Open Match.
|
||||
# query:
|
||||
#
|
||||
# # Specifies om-mmlogic as the in-cluster domain name for the `mmlogic` service.
|
||||
# hostName: om-mmlogic
|
||||
# # Specifies om-query as the in-cluster domain name for the `query` service.
|
||||
# hostName: om-query
|
||||
#
|
||||
# # Specifies the port for receiving RESTful HTTP requests in the `mmlogic` service.
|
||||
# # Specifies the port for receiving RESTful HTTP requests in the `query` service.
|
||||
# # Checkouts https://open-match.dev/site/swaggerui/index.html for the RESTful APIs Open Match provides.
|
||||
# httpPort: 51503
|
||||
#
|
||||
# # Specifies the port for receiving gRPC calls in the `mmlogic` service.
|
||||
# # Specifies the port for receiving gRPC calls in the `query` service.
|
||||
# # Note that some services may not have grpcPort defined as they don't have gRPC APIs defined.
|
||||
# grpcPort: 50503
|
||||
#
|
||||
# # Specifies the port type for the `mmlogic` service, default to ClusterIP - available port types are ClusterIP, NodePort, LoadBalancer, ExternalName.
|
||||
# # Specifies the port type for the `query` service, default to ClusterIP - available port types are ClusterIP, NodePort, LoadBalancer, ExternalName.
|
||||
# # Please see https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types for Type values and their behaviors.
|
||||
# portType: ClusterIP
|
||||
#
|
||||
# # Specifies the number of Kubernetes pod replicas per `mmlogic` service, default to 3.
|
||||
# # Specifies the number of Kubernetes pod replicas per `query` service, default to 3.
|
||||
# replicas: 3
|
||||
#
|
||||
# # Specifies the image name to be used in a Kubernetes pod for `mmlogic` compoenent.
|
||||
# image: openmatch-mmlogic
|
||||
# # Specifies the image name to be used in a Kubernetes pod for `query` compoenent.
|
||||
# image: openmatch-query
|
||||
swaggerui: &swaggerui
|
||||
hostName: om-swaggerui
|
||||
httpPort: 51500
|
||||
portType: ClusterIP
|
||||
replicas: 1
|
||||
image: openmatch-swaggerui
|
||||
mmlogic: &mmlogic
|
||||
hostName: om-mmlogic
|
||||
query: &query
|
||||
hostName: om-query
|
||||
grpcPort: 50503
|
||||
httpPort: 51503
|
||||
portType: ClusterIP
|
||||
replicas: 3
|
||||
image: openmatch-mmlogic
|
||||
image: openmatch-query
|
||||
frontend: &frontend
|
||||
hostName: om-frontend
|
||||
grpcPort: 50504
|
||||
@ -165,7 +165,7 @@ redis:
|
||||
# 2. open-match-customize: Kubernetes definitions of the customizable template to use Open Match with your own MMFs and Evaluator.
|
||||
###############################################################################################################################
|
||||
|
||||
# Controls if users need to install backend, frontend, mmlogic, om-configmap, and swaggerui.
|
||||
# Controls if users need to install backend, frontend, query, om-configmap, and swaggerui.
|
||||
open-match-core:
|
||||
enabled: true
|
||||
ignoreListTTL: 60000ms
|
||||
@ -194,7 +194,7 @@ open-match-customize:
|
||||
enabled: false
|
||||
evaluator: *evaluator
|
||||
function: *function
|
||||
mmlogic: *mmlogic
|
||||
query: *query
|
||||
# You can override the evaluator/mmf image
|
||||
# evaluator:
|
||||
# image: [YOUR_EVALUATOR_IMAGE]
|
||||
|
@ -20,42 +20,42 @@
|
||||
# The configurations defined here will be applied when deploying Open Match to a Kubernetes cluster.
|
||||
# You may choose to override these values to tailor Open Match for your needs.
|
||||
#
|
||||
# Begins the configuration section for `mmlogic` component in Open Match.
|
||||
# mmlogic:
|
||||
# Begins the configuration section for `query` component in Open Match.
|
||||
# query:
|
||||
#
|
||||
# # Specifies om-mmlogic as the in-cluster domain name for the `mmlogic` service.
|
||||
# hostName: om-mmlogic
|
||||
# # Specifies om-query as the in-cluster domain name for the `query` service.
|
||||
# hostName: om-query
|
||||
#
|
||||
# # Specifies the port for receiving RESTful HTTP requests in the `mmlogic` service.
|
||||
# # Specifies the port for receiving RESTful HTTP requests in the `query` service.
|
||||
# # Checkouts https://open-match.dev/site/swaggerui/index.html for the RESTful APIs Open Match provides.
|
||||
# httpPort: 51503
|
||||
#
|
||||
# # Specifies the port for receiving gRPC calls in the `mmlogic` service.
|
||||
# # Specifies the port for receiving gRPC calls in the `query` service.
|
||||
# # Note that some services may not have grpcPort defined as they don't have gRPC APIs defined.
|
||||
# grpcPort: 50503
|
||||
#
|
||||
# # Specifies the port type for the `mmlogic` service, default to ClusterIP - available port types are ClusterIP, NodePort, LoadBalancer, ExternalName.
|
||||
# # Specifies the port type for the `query` service, default to ClusterIP - available port types are ClusterIP, NodePort, LoadBalancer, ExternalName.
|
||||
# # Please see https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types for Type values and their behaviors.
|
||||
# portType: ClusterIP
|
||||
#
|
||||
# # Specifies the number of Kubernetes pod replicas per `mmlogic` service, default to 3.
|
||||
# # Specifies the number of Kubernetes pod replicas per `query` service, default to 3.
|
||||
# replicas: 3
|
||||
#
|
||||
# # Specifies the image name to be used in a Kubernetes pod for `mmlogic` compoenent.
|
||||
# image: openmatch-mmlogic
|
||||
# # Specifies the image name to be used in a Kubernetes pod for `query` compoenent.
|
||||
# image: openmatch-query
|
||||
swaggerui: &swaggerui
|
||||
hostName: om-swaggerui
|
||||
httpPort: 51500
|
||||
portType: ClusterIP
|
||||
replicas: 1
|
||||
image: openmatch-swaggerui
|
||||
mmlogic: &mmlogic
|
||||
hostName: om-mmlogic
|
||||
query: &query
|
||||
hostName: om-query
|
||||
grpcPort: 50503
|
||||
httpPort: 51503
|
||||
portType: ClusterIP
|
||||
replicas: 3
|
||||
image: openmatch-mmlogic
|
||||
image: openmatch-query
|
||||
frontend: &frontend
|
||||
hostName: om-frontend
|
||||
grpcPort: 50504
|
||||
@ -150,7 +150,7 @@ redis:
|
||||
# 2. open-match-customize: Kubernetes definitions of the customizable template to use Open Match with your own MMFs and Evaluator.
|
||||
###############################################################################################################################
|
||||
|
||||
# Controls if users need to install backend, frontend, mmlogic, om-configmap, and swaggerui.
|
||||
# Controls if users need to install backend, frontend, query, om-configmap, and swaggerui.
|
||||
open-match-core:
|
||||
enabled: true
|
||||
ignoreListTTL: 60000ms
|
||||
@ -179,7 +179,7 @@ open-match-customize:
|
||||
enabled: false
|
||||
evaluator: *evaluator
|
||||
function: *function
|
||||
mmlogic: *mmlogic
|
||||
query: *query
|
||||
# You can override the evaluator/mmf image
|
||||
# evaluator:
|
||||
# image: [YOUR_EVALUATOR_IMAGE]
|
||||
|
@ -50,7 +50,7 @@ var (
|
||||
// CreateTicket assigns an unique TicketId to the input Ticket and record it in state storage.
|
||||
// A ticket is considered as ready for matchmaking once it is created.
|
||||
// - If a TicketId exists in a Ticket request, an auto-generated TicketId will override this field.
|
||||
// - If SearchFields exist in a Ticket, CreateTicket will also index these fields such that one can query the ticket with mmlogic.QueryTickets function.
|
||||
// - If SearchFields exist in a Ticket, CreateTicket will also index these fields such that one can query the ticket with query.QueryTickets function.
|
||||
func (s *frontendService) CreateTicket(ctx context.Context, req *pb.CreateTicketRequest) (*pb.CreateTicketResponse, error) {
|
||||
// Perform input validation.
|
||||
if req.GetTicket() == nil {
|
||||
|
@ -17,7 +17,7 @@ package minimatch
|
||||
import (
|
||||
"open-match.dev/open-match/internal/app/backend"
|
||||
"open-match.dev/open-match/internal/app/frontend"
|
||||
"open-match.dev/open-match/internal/app/mmlogic"
|
||||
"open-match.dev/open-match/internal/app/query"
|
||||
"open-match.dev/open-match/internal/app/synchronizer"
|
||||
"open-match.dev/open-match/internal/config"
|
||||
"open-match.dev/open-match/internal/rpc"
|
||||
@ -33,7 +33,7 @@ func BindService(p *rpc.ServerParams, cfg config.View) error {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := mmlogic.BindService(p, cfg); err != nil {
|
||||
if err := query.BindService(p, cfg); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package mmlogic
|
||||
package query
|
||||
|
||||
import (
|
||||
"google.golang.org/grpc"
|
||||
@ -22,9 +22,9 @@ import (
|
||||
"open-match.dev/open-match/pkg/pb"
|
||||
)
|
||||
|
||||
// BindService creates the mmlogic service and binds it to the serving harness.
|
||||
// BindService creates the query service and binds it to the serving harness.
|
||||
func BindService(p *rpc.ServerParams, cfg config.View) error {
|
||||
service := &mmlogicService{
|
||||
service := &queryService{
|
||||
cfg: cfg,
|
||||
store: statestore.New(cfg),
|
||||
}
|
||||
@ -32,8 +32,8 @@ func BindService(p *rpc.ServerParams, cfg config.View) error {
|
||||
p.AddHealthCheckFunc(service.store.HealthCheck)
|
||||
|
||||
p.AddHandleFunc(func(s *grpc.Server) {
|
||||
pb.RegisterMmLogicServer(s, service)
|
||||
}, pb.RegisterMmLogicHandlerFromEndpoint)
|
||||
pb.RegisterQueryServiceServer(s, service)
|
||||
}, pb.RegisterQueryServiceHandlerFromEndpoint)
|
||||
|
||||
return nil
|
||||
}
|
@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package mmlogic
|
||||
package query
|
||||
|
||||
import (
|
||||
"context"
|
||||
@ -29,13 +29,13 @@ import (
|
||||
var (
|
||||
logger = logrus.WithFields(logrus.Fields{
|
||||
"app": "openmatch",
|
||||
"component": "app.mmlogic",
|
||||
"component": "app.query",
|
||||
})
|
||||
)
|
||||
|
||||
// The MMLogic API provides utility functions for common MMF functionality such
|
||||
// queryService API provides utility functions for common MMF functionality such
|
||||
// as retreiving Tickets from state storage.
|
||||
type mmlogicService struct {
|
||||
type queryService struct {
|
||||
cfg config.View
|
||||
store statestore.Service
|
||||
}
|
||||
@ -44,7 +44,7 @@ type mmlogicService struct {
|
||||
// - If the Pool contains no Filters, QueryTickets will return all Tickets in the state storage.
|
||||
// QueryTickets pages the Tickets by `storage.pool.size` and stream back response.
|
||||
// - storage.pool.size is default to 1000 if not set, and has a mininum of 10 and maximum of 10000
|
||||
func (s *mmlogicService) QueryTickets(req *pb.QueryTicketsRequest, responseServer pb.MmLogic_QueryTicketsServer) error {
|
||||
func (s *queryService) QueryTickets(req *pb.QueryTicketsRequest, responseServer pb.QueryService_QueryTicketsServer) error {
|
||||
pool := req.GetPool()
|
||||
if pool == nil {
|
||||
return status.Error(codes.InvalidArgument, ".pool is required")
|
@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package mmlogic
|
||||
package query
|
||||
|
||||
import (
|
||||
"context"
|
@ -71,7 +71,7 @@ func serve(cfg config.View) {
|
||||
mux.Handle(telemetry.HealthCheckEndpoint, telemetry.NewAlwaysReadyHealthCheck())
|
||||
bindHandler(mux, cfg, "/v1/frontend/", "frontend")
|
||||
bindHandler(mux, cfg, "/v1/backend/", "backend")
|
||||
bindHandler(mux, cfg, "/v1/mmlogic/", "mmlogic")
|
||||
bindHandler(mux, cfg, "/v1/queryservice/", "queryservice")
|
||||
bindHandler(mux, cfg, "/v1/synchronizer/", "synchronizer")
|
||||
bindHandler(mux, cfg, "/v1/evaluator/", "evaluator")
|
||||
bindHandler(mux, cfg, "/v1/matchfunction/", "functions")
|
||||
|
@ -78,13 +78,13 @@ func (com *clusterOM) MustBackendGRPC() pb.BackendClient {
|
||||
return pb.NewBackendClient(conn)
|
||||
}
|
||||
|
||||
func (com *clusterOM) MustMmLogicGRPC() pb.MmLogicClient {
|
||||
conn, err := com.getGRPCClientFromServiceName("om-mmlogic")
|
||||
func (com *clusterOM) MustQueryServiceGRPC() pb.QueryServiceClient {
|
||||
conn, err := com.getGRPCClientFromServiceName("om-query")
|
||||
if err != nil {
|
||||
com.t.Fatalf("cannot create gRPC client, %s", err)
|
||||
}
|
||||
com.mc.AddCloseWithErrorFunc(conn.Close)
|
||||
return pb.NewMmLogicClient(conn)
|
||||
return pb.NewQueryServiceClient(conn)
|
||||
}
|
||||
|
||||
func (com *clusterOM) MustMmfConfigGRPC() *pb.FunctionConfig {
|
||||
|
@ -37,8 +37,8 @@ type OM interface {
|
||||
MustFrontendGRPC() pb.FrontendClient
|
||||
// MustBackendGRPC returns a gRPC client to backend server.
|
||||
MustBackendGRPC() pb.BackendClient
|
||||
// MustMmLogicGRPC returns a gRPC client to mmlogic server.
|
||||
MustMmLogicGRPC() pb.MmLogicClient
|
||||
// MustQueryServiceGRPC returns a gRPC client to query server.
|
||||
MustQueryServiceGRPC() pb.QueryServiceClient
|
||||
// HealthCheck probes the cluster for readiness.
|
||||
HealthCheck() error
|
||||
// MustMmfConfigGRPC returns a grpc match function config for backend server.
|
||||
|
@ -74,10 +74,10 @@ func (iom *inmemoryOM) MustBackendGRPC() pb.BackendClient {
|
||||
return pb.NewBackendClient(conn)
|
||||
}
|
||||
|
||||
func (iom *inmemoryOM) MustMmLogicGRPC() pb.MmLogicClient {
|
||||
func (iom *inmemoryOM) MustQueryServiceGRPC() pb.QueryServiceClient {
|
||||
conn := iom.mainTc.MustGRPC()
|
||||
iom.mc.AddCloseWithErrorFunc(conn.Close)
|
||||
return pb.NewMmLogicClient(conn)
|
||||
return pb.NewQueryServiceClient(conn)
|
||||
}
|
||||
|
||||
func (iom *inmemoryOM) MustMmfConfigGRPC() *pb.FunctionConfig {
|
||||
@ -115,7 +115,7 @@ func (iom *inmemoryOM) cleanupMain() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Create a minimatch test service with function bindings from frontend, backend, and mmlogic.
|
||||
// Create a minimatch test service with function bindings from frontendService, backendService, and queryService.
|
||||
// Instruct this service to start and connect to a fake storage service.
|
||||
func createMinimatchForTest(t *testing.T, evalTc *rpcTesting.TestContext) *rpcTesting.TestContext {
|
||||
var closer func()
|
||||
@ -152,16 +152,16 @@ func createMinimatchForTest(t *testing.T, evalTc *rpcTesting.TestContext) *rpcTe
|
||||
}
|
||||
|
||||
// Create a mmf service using a started test server.
|
||||
// Inject the port config of mmlogic using that the passed in test server
|
||||
// Inject the port config of queryService using that the passed in test server
|
||||
func createMatchFunctionForTest(t *testing.T, c *rpcTesting.TestContext) *rpcTesting.TestContext {
|
||||
// TODO: Use insecure for now since minimatch and mmf only works with the same secure mode
|
||||
tc := rpcTesting.MustServeInsecure(t, func(p *rpc.ServerParams) {
|
||||
cfg := viper.New()
|
||||
|
||||
// The below configuration is used by GRPC harness to create an mmlogic client to query tickets.
|
||||
cfg.Set("api.mmlogic.hostname", c.GetHostname())
|
||||
cfg.Set("api.mmlogic.grpcport", c.GetGRPCPort())
|
||||
cfg.Set("api.mmlogic.httpport", c.GetHTTPPort())
|
||||
// The below configuration is used by GRPC harness to create an queryService client to query tickets.
|
||||
cfg.Set("api.query.hostname", c.GetHostname())
|
||||
cfg.Set("api.query.grpcport", c.GetGRPCPort())
|
||||
cfg.Set("api.query.httpport", c.GetHTTPPort())
|
||||
|
||||
assert.Nil(t, internalMmf.BindService(p, cfg, &internalMmf.FunctionSettings{
|
||||
Func: mmf.MakeMatches,
|
||||
|
@ -57,8 +57,8 @@ func getCfg() (config.View, error) {
|
||||
cfg.Set("api.functions.grpcport", 50502)
|
||||
cfg.Set("api.functions.httpport", 51502)
|
||||
|
||||
cfg.Set("api.mmlogic.hostname", "om-mmlogic")
|
||||
cfg.Set("api.mmlogic.grpcport", 50503)
|
||||
cfg.Set("api.query.hostname", "om-query")
|
||||
cfg.Set("api.query.grpcport", 50503)
|
||||
|
||||
return cfg, nil
|
||||
}
|
||||
|
@ -47,9 +47,9 @@ type MatchFunction func(*MatchFunctionParams) ([]*pb.Match, error)
|
||||
// matchFunctionService implements pb.MatchFunctionServer, the server generated
|
||||
// by compiling the protobuf, by fulfilling the pb.MatchFunctionServer interface.
|
||||
type matchFunctionService struct {
|
||||
cfg config.View
|
||||
function MatchFunction
|
||||
mmlogicClient pb.MmLogicClient
|
||||
cfg config.View
|
||||
function MatchFunction
|
||||
queryServiceClient pb.QueryServiceClient
|
||||
}
|
||||
|
||||
// MatchFunctionParams is a protected view for the match function.
|
||||
@ -108,25 +108,25 @@ func (s *matchFunctionService) Run(req *pb.RunRequest, stream pb.MatchFunction_R
|
||||
}
|
||||
|
||||
func newMatchFunctionService(cfg config.View, fs *FunctionSettings) (*matchFunctionService, error) {
|
||||
conn, err := rpc.GRPCClientFromConfig(cfg, "api.mmlogic")
|
||||
conn, err := rpc.GRPCClientFromConfig(cfg, "api.query")
|
||||
if err != nil {
|
||||
logger.Errorf("Failed to get MMLogic connection, %v.", err)
|
||||
logger.Errorf("Failed to get QueryService connection, %v.", err)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
mmfService := &matchFunctionService{cfg: cfg, function: fs.Func, mmlogicClient: pb.NewMmLogicClient(conn)}
|
||||
mmfService := &matchFunctionService{cfg: cfg, function: fs.Func, queryServiceClient: pb.NewQueryServiceClient(conn)}
|
||||
return mmfService, nil
|
||||
}
|
||||
|
||||
// getMatchManifest fetches all the data needed from the mmlogic API.
|
||||
// getMatchManifest fetches all the data needed from the queryService API.
|
||||
func (s *matchFunctionService) getMatchManifest(ctx context.Context, req *pb.RunRequest) (map[string][]*pb.Ticket, error) {
|
||||
poolNameToTickets := make(map[string][]*pb.Ticket)
|
||||
filterPools := req.GetProfile().GetPools()
|
||||
|
||||
for _, pool := range filterPools {
|
||||
qtClient, err := s.mmlogicClient.QueryTickets(ctx, &pb.QueryTicketsRequest{Pool: pool}, grpc.WaitForReady(true))
|
||||
qtClient, err := s.queryServiceClient.QueryTickets(ctx, &pb.QueryTicketsRequest{Pool: pool}, grpc.WaitForReady(true))
|
||||
if err != nil {
|
||||
logger.WithError(err).Error("Failed to get queryTicketClient from mmlogic.")
|
||||
logger.WithError(err).Error("Failed to get queryTicketClient from queryService.")
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
@ -47,9 +47,9 @@ type MatchFunction func(*MatchFunctionParams) ([]*pb.Match, error)
|
||||
// matchFunctionService implements pb.MatchFunctionServer, the server generated
|
||||
// by compiling the protobuf, by fulfilling the pb.MatchFunctionServer interface.
|
||||
type matchFunctionService struct {
|
||||
cfg config.View
|
||||
function MatchFunction
|
||||
mmlogicClient pb.MmLogicClient
|
||||
cfg config.View
|
||||
function MatchFunction
|
||||
queryServiceClient pb.QueryServiceClient
|
||||
}
|
||||
|
||||
// MatchFunctionParams is a protected view for the match function.
|
||||
@ -108,25 +108,25 @@ func (s *matchFunctionService) Run(req *pb.RunRequest, stream pb.MatchFunction_R
|
||||
}
|
||||
|
||||
func newMatchFunctionService(cfg config.View, fs *FunctionSettings) (*matchFunctionService, error) {
|
||||
conn, err := rpc.GRPCClientFromConfig(cfg, "api.mmlogic")
|
||||
conn, err := rpc.GRPCClientFromConfig(cfg, "api.query")
|
||||
if err != nil {
|
||||
logger.Errorf("Failed to get MMLogic connection, %v.", err)
|
||||
logger.Errorf("Failed to get QueryService connection, %v.", err)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
mmfService := &matchFunctionService{cfg: cfg, function: fs.Func, mmlogicClient: pb.NewMmLogicClient(conn)}
|
||||
mmfService := &matchFunctionService{cfg: cfg, function: fs.Func, queryServiceClient: pb.NewQueryServiceClient(conn)}
|
||||
return mmfService, nil
|
||||
}
|
||||
|
||||
// getMatchManifest fetches all the data needed from the mmlogic API.
|
||||
// getMatchManifest fetches all the data needed from the queryService API.
|
||||
func (s *matchFunctionService) getMatchManifest(ctx context.Context, req *pb.RunRequest) (map[string][]*pb.Ticket, error) {
|
||||
poolNameToTickets := make(map[string][]*pb.Ticket)
|
||||
filterPools := req.GetProfile().GetPools()
|
||||
|
||||
for _, pool := range filterPools {
|
||||
qtClient, err := s.mmlogicClient.QueryTickets(ctx, &pb.QueryTicketsRequest{Pool: pool}, grpc.WaitForReady(true))
|
||||
qtClient, err := s.queryServiceClient.QueryTickets(ctx, &pb.QueryTicketsRequest{Pool: pool}, grpc.WaitForReady(true))
|
||||
if err != nil {
|
||||
logger.WithError(err).Error("Failed to get queryTicketClient from mmlogic.")
|
||||
logger.WithError(err).Error("Failed to get queryTicketClient from queryService.")
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
@ -23,11 +23,11 @@ import (
|
||||
"open-match.dev/open-match/pkg/pb"
|
||||
)
|
||||
|
||||
// QueryPool queries mmlogic and returns the tickets that belong to the specified pool.
|
||||
func QueryPool(ctx context.Context, mml pb.MmLogicClient, pool *pb.Pool) ([]*pb.Ticket, error) {
|
||||
// QueryPool queries queryService and returns the tickets that belong to the specified pool.
|
||||
func QueryPool(ctx context.Context, mml pb.QueryServiceClient, pool *pb.Pool) ([]*pb.Ticket, error) {
|
||||
query, err := mml.QueryTickets(ctx, &pb.QueryTicketsRequest{Pool: pool})
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Error calling mmlogic.QueryTickets: %w", err)
|
||||
return nil, fmt.Errorf("Error calling queryService.QueryTickets: %w", err)
|
||||
}
|
||||
|
||||
var tickets []*pb.Ticket
|
||||
@ -38,15 +38,15 @@ func QueryPool(ctx context.Context, mml pb.MmLogicClient, pool *pb.Pool) ([]*pb.
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Error receiving tickets from mmlogic.QueryTickets: %w", err)
|
||||
return nil, fmt.Errorf("Error receiving tickets from queryService.QueryTickets: %w", err)
|
||||
}
|
||||
|
||||
tickets = append(tickets, resp.Tickets...)
|
||||
}
|
||||
}
|
||||
|
||||
// QueryPools queries mmlogic and returns the a map of pool names to the tickets belonging to those pools.
|
||||
func QueryPools(ctx context.Context, mml pb.MmLogicClient, pools []*pb.Pool) (map[string][]*pb.Ticket, error) {
|
||||
// QueryPools queries queryService and returns the a map of pool names to the tickets belonging to those pools.
|
||||
func QueryPools(ctx context.Context, mml pb.QueryServiceClient, pools []*pb.Pool) (map[string][]*pb.Ticket, error) {
|
||||
ctx, cancel := context.WithCancel(ctx)
|
||||
defer cancel()
|
||||
type result struct {
|
||||
|
@ -368,7 +368,7 @@ type FrontendClient interface {
|
||||
// CreateTicket assigns an unique TicketId to the input Ticket and record it in state storage.
|
||||
// A ticket is considered as ready for matchmaking once it is created.
|
||||
// - If a TicketId exists in a Ticket request, an auto-generated TicketId will override this field.
|
||||
// - If SearchFields exist in a Ticket, CreateTicket will also index these fields such that one can query the ticket with mmlogic.QueryTickets function.
|
||||
// - If SearchFields exist in a Ticket, CreateTicket will also index these fields such that one can query the ticket with query.QueryTickets function.
|
||||
CreateTicket(ctx context.Context, in *CreateTicketRequest, opts ...grpc.CallOption) (*CreateTicketResponse, error)
|
||||
// DeleteTicket immediately stops Open Match from using the Ticket for matchmaking and removes the Ticket from state storage.
|
||||
// The client must delete the Ticket when finished matchmaking with it.
|
||||
@ -454,7 +454,7 @@ type FrontendServer interface {
|
||||
// CreateTicket assigns an unique TicketId to the input Ticket and record it in state storage.
|
||||
// A ticket is considered as ready for matchmaking once it is created.
|
||||
// - If a TicketId exists in a Ticket request, an auto-generated TicketId will override this field.
|
||||
// - If SearchFields exist in a Ticket, CreateTicket will also index these fields such that one can query the ticket with mmlogic.QueryTickets function.
|
||||
// - If SearchFields exist in a Ticket, CreateTicket will also index these fields such that one can query the ticket with query.QueryTickets function.
|
||||
CreateTicket(context.Context, *CreateTicketRequest) (*CreateTicketResponse, error)
|
||||
// DeleteTicket immediately stops Open Match from using the Ticket for matchmaking and removes the Ticket from state storage.
|
||||
// The client must delete the Ticket when finished matchmaking with it.
|
||||
|
@ -162,7 +162,7 @@ const _ = grpc.SupportPackageIsVersion4
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
||||
type MatchFunctionClient interface {
|
||||
// DO NOT CALL THIS FUNCTION MANUALLY. USE backend.FetchMatches INSTEAD.
|
||||
// Run pulls Tickets that satisify Profile constraints from Mmlogic, runs matchmaking logics against them, then
|
||||
// Run pulls Tickets that satisify Profile constraints from QueryService, runs matchmaking logics against them, then
|
||||
// constructs and streams back match candidates to the Backend service.
|
||||
Run(ctx context.Context, in *RunRequest, opts ...grpc.CallOption) (MatchFunction_RunClient, error)
|
||||
}
|
||||
@ -210,7 +210,7 @@ func (x *matchFunctionRunClient) Recv() (*RunResponse, error) {
|
||||
// MatchFunctionServer is the server API for MatchFunction service.
|
||||
type MatchFunctionServer interface {
|
||||
// DO NOT CALL THIS FUNCTION MANUALLY. USE backend.FetchMatches INSTEAD.
|
||||
// Run pulls Tickets that satisify Profile constraints from Mmlogic, runs matchmaking logics against them, then
|
||||
// Run pulls Tickets that satisify Profile constraints from QueryService, runs matchmaking logics against them, then
|
||||
// constructs and streams back match candidates to the Backend service.
|
||||
Run(*RunRequest, MatchFunction_RunServer) error
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// source: api/mmlogic.proto
|
||||
// source: api/query.proto
|
||||
|
||||
package pb
|
||||
|
||||
@ -38,7 +38,7 @@ func (m *QueryTicketsRequest) Reset() { *m = QueryTicketsRequest{} }
|
||||
func (m *QueryTicketsRequest) String() string { return proto.CompactTextString(m) }
|
||||
func (*QueryTicketsRequest) ProtoMessage() {}
|
||||
func (*QueryTicketsRequest) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_caa9c8aeaf311764, []int{0}
|
||||
return fileDescriptor_5ec7651f31a90698, []int{0}
|
||||
}
|
||||
|
||||
func (m *QueryTicketsRequest) XXX_Unmarshal(b []byte) error {
|
||||
@ -78,7 +78,7 @@ func (m *QueryTicketsResponse) Reset() { *m = QueryTicketsResponse{} }
|
||||
func (m *QueryTicketsResponse) String() string { return proto.CompactTextString(m) }
|
||||
func (*QueryTicketsResponse) ProtoMessage() {}
|
||||
func (*QueryTicketsResponse) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_caa9c8aeaf311764, []int{1}
|
||||
return fileDescriptor_5ec7651f31a90698, []int{1}
|
||||
}
|
||||
|
||||
func (m *QueryTicketsResponse) XXX_Unmarshal(b []byte) error {
|
||||
@ -111,42 +111,43 @@ func init() {
|
||||
proto.RegisterType((*QueryTicketsResponse)(nil), "openmatch.QueryTicketsResponse")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("api/mmlogic.proto", fileDescriptor_caa9c8aeaf311764) }
|
||||
func init() { proto.RegisterFile("api/query.proto", fileDescriptor_5ec7651f31a90698) }
|
||||
|
||||
var fileDescriptor_caa9c8aeaf311764 = []byte{
|
||||
// 510 bytes of a gzipped FileDescriptorProto
|
||||
var fileDescriptor_5ec7651f31a90698 = []byte{
|
||||
// 516 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x52, 0xcd, 0x6e, 0x13, 0x3d,
|
||||
0x14, 0xd5, 0x4c, 0xaa, 0x56, 0x75, 0x3f, 0xe9, 0xa3, 0xe6, 0x47, 0x25, 0x42, 0xc5, 0xa4, 0x2c,
|
||||
0x42, 0x20, 0xe3, 0x74, 0xc8, 0x2a, 0x08, 0xa9, 0xa5, 0xed, 0xa2, 0x52, 0xc2, 0x4f, 0x40, 0x2c,
|
||||
0xd8, 0x39, 0xce, 0xc5, 0x33, 0x74, 0xc6, 0xd7, 0xb5, 0x3d, 0x0d, 0xdd, 0xf6, 0x11, 0x60, 0x83,
|
||||
0x78, 0x04, 0x5e, 0x82, 0x87, 0xe0, 0x15, 0x10, 0xcf, 0x81, 0x66, 0x86, 0xd0, 0x40, 0xcb, 0x6a,
|
||||
0x34, 0x3e, 0xe7, 0xdc, 0x73, 0x7c, 0x7c, 0xc9, 0xba, 0x30, 0x29, 0xcf, 0xf3, 0x0c, 0x55, 0x2a,
|
||||
0x23, 0x63, 0xd1, 0x23, 0x5d, 0x45, 0x03, 0x3a, 0x17, 0x5e, 0x26, 0x4d, 0x5a, 0xa1, 0xe0, 0x9c,
|
||||
0x50, 0xe0, 0x6a, 0xb8, 0x79, 0x4b, 0x21, 0xaa, 0x0c, 0x78, 0x09, 0x09, 0xad, 0xd1, 0x0b, 0x9f,
|
||||
0xa2, 0x9e, 0xa3, 0x0f, 0xaa, 0x8f, 0xec, 0x2a, 0xd0, 0x5d, 0x37, 0x13, 0x4a, 0x81, 0xe5, 0x68,
|
||||
0x2a, 0xc6, 0x45, 0x76, 0x6b, 0x40, 0xae, 0xbe, 0x28, 0xc0, 0x9e, 0xbe, 0x4a, 0xe5, 0x11, 0x78,
|
||||
0x37, 0x86, 0xe3, 0x02, 0x9c, 0xa7, 0x5b, 0x64, 0xc9, 0x20, 0x66, 0x1b, 0x01, 0x0b, 0xda, 0x6b,
|
||||
0xf1, 0xff, 0xd1, 0xef, 0x40, 0xd1, 0x73, 0xc4, 0x6c, 0x5c, 0x81, 0xad, 0x3d, 0x72, 0xed, 0x4f,
|
||||
0xad, 0x33, 0xa8, 0x1d, 0xd0, 0xfb, 0x64, 0xc5, 0xd7, 0x47, 0x1b, 0x01, 0x6b, 0xb4, 0xd7, 0xe2,
|
||||
0xf5, 0x05, 0x7d, 0x4d, 0x1e, 0xcf, 0x19, 0xf1, 0x59, 0x40, 0x56, 0x46, 0xf9, 0xb0, 0xbc, 0x3d,
|
||||
0x9d, 0x91, 0xff, 0x16, 0x07, 0xd2, 0xcd, 0x05, 0xdd, 0x25, 0x29, 0x9b, 0xb7, 0xff, 0x89, 0xd7,
|
||||
0x49, 0x5a, 0x77, 0xcf, 0xbe, 0x7d, 0xff, 0x18, 0x6e, 0xb6, 0x6e, 0xf2, 0x93, 0xed, 0x79, 0xc7,
|
||||
0xfc, 0x97, 0xf3, 0xe0, 0xb8, 0x54, 0x0c, 0x82, 0x4e, 0x2f, 0x78, 0xf2, 0xa9, 0xf1, 0x61, 0xf7,
|
||||
0x47, 0x48, 0xbf, 0x06, 0xe4, 0xfa, 0x68, 0xc4, 0xaa, 0x30, 0xac, 0xbd, 0x2f, 0xbc, 0x60, 0x43,
|
||||
0x71, 0x0a, 0xf6, 0x5e, 0xeb, 0x90, 0x90, 0x67, 0x06, 0x34, 0x1b, 0x95, 0x5e, 0xf4, 0x46, 0xe2,
|
||||
0xbd, 0x71, 0x03, 0xce, 0x4b, 0xfb, 0x6e, 0xed, 0x3f, 0x85, 0x93, 0xe6, 0xd6, 0xf9, 0x7f, 0x77,
|
||||
0x9a, 0x3a, 0x59, 0x38, 0xb7, 0x53, 0xbf, 0x95, 0xb2, 0x58, 0x18, 0x17, 0x49, 0xcc, 0x3b, 0xaf,
|
||||
0x09, 0xdd, 0x35, 0x42, 0x26, 0xc0, 0xe2, 0xa8, 0xc7, 0x86, 0xa9, 0x84, 0xb2, 0xb3, 0x9d, 0xf9,
|
||||
0x48, 0x95, 0xfa, 0xa4, 0x98, 0x94, 0x4c, 0x5e, 0x4b, 0xdf, 0xa2, 0x55, 0x22, 0x07, 0xb7, 0x60,
|
||||
0xc6, 0x27, 0x19, 0x4e, 0x78, 0x2e, 0x9c, 0x07, 0xcb, 0x87, 0x87, 0x7b, 0x07, 0x4f, 0x5f, 0x1e,
|
||||
0xc4, 0x8d, 0xed, 0xa8, 0xd7, 0x09, 0x83, 0x30, 0xbe, 0x22, 0x8c, 0xc9, 0x52, 0x59, 0x3d, 0x33,
|
||||
0x7f, 0xe7, 0x50, 0x0f, 0x2e, 0x9c, 0x8c, 0x1f, 0x91, 0x46, 0xbf, 0xd7, 0xa7, 0x7d, 0xd2, 0x19,
|
||||
0x83, 0x2f, 0xac, 0x86, 0x29, 0x9b, 0x25, 0xa0, 0x99, 0x4f, 0x80, 0x59, 0x70, 0x58, 0x58, 0x09,
|
||||
0x6c, 0x8a, 0xe0, 0x98, 0x46, 0xcf, 0xe0, 0x7d, 0xea, 0x7c, 0x44, 0x97, 0xc9, 0xd2, 0xe7, 0x30,
|
||||
0x58, 0xb1, 0x8f, 0xc9, 0xc6, 0x79, 0x19, 0x6c, 0x1f, 0x65, 0x91, 0x83, 0xae, 0xd7, 0x8a, 0xde,
|
||||
0xb9, 0xbc, 0x1a, 0xee, 0x52, 0x0f, 0x7c, 0x8a, 0xd2, 0xf1, 0x37, 0xec, 0x2f, 0x68, 0xe1, 0x5e,
|
||||
0xe6, 0x48, 0x71, 0x33, 0xf9, 0x12, 0xae, 0x96, 0xf3, 0xab, 0xf1, 0x93, 0xe5, 0x6a, 0x4f, 0x1f,
|
||||
0xfe, 0x0c, 0x00, 0x00, 0xff, 0xff, 0xc7, 0x27, 0x53, 0xe2, 0x27, 0x03, 0x00, 0x00,
|
||||
0x14, 0xd5, 0x4c, 0xaa, 0x56, 0x75, 0x3f, 0xa9, 0x1f, 0xe6, 0x47, 0x55, 0x84, 0x8a, 0x49, 0x37,
|
||||
0x69, 0x20, 0xe3, 0x74, 0xc8, 0x2a, 0x08, 0xa9, 0xa5, 0xed, 0xa2, 0x52, 0xc2, 0x4f, 0x8a, 0x58,
|
||||
0xb0, 0x73, 0x9c, 0xcb, 0x8c, 0x69, 0xc6, 0xd7, 0xb5, 0x3d, 0x29, 0x95, 0x58, 0xb1, 0x66, 0x05,
|
||||
0x1b, 0xc4, 0x23, 0xf0, 0x12, 0x3c, 0x04, 0xaf, 0x80, 0x78, 0x0e, 0x34, 0x33, 0x09, 0x0d, 0xb4,
|
||||
0xac, 0x46, 0xbe, 0xe7, 0xdc, 0x73, 0xce, 0x1c, 0x9b, 0xac, 0x0b, 0xa3, 0xf8, 0x69, 0x0e, 0xf6,
|
||||
0x3c, 0x32, 0x16, 0x3d, 0xd2, 0x55, 0x34, 0xa0, 0x33, 0xe1, 0x65, 0x5a, 0xa7, 0x05, 0x96, 0x81,
|
||||
0x73, 0x22, 0x01, 0x57, 0xc1, 0xf5, 0xdb, 0x09, 0x62, 0x32, 0x01, 0x5e, 0x40, 0x42, 0x6b, 0xf4,
|
||||
0xc2, 0x2b, 0xd4, 0x73, 0xf4, 0x7e, 0xf9, 0x91, 0xed, 0x04, 0x74, 0xdb, 0x9d, 0x89, 0x24, 0x01,
|
||||
0xcb, 0xd1, 0x94, 0x8c, 0xcb, 0xec, 0x46, 0x8f, 0x5c, 0x7f, 0x5e, 0x38, 0xbf, 0x50, 0xf2, 0x04,
|
||||
0xbc, 0x1b, 0xc2, 0x69, 0x0e, 0xce, 0xd3, 0x2d, 0xb2, 0x64, 0x10, 0x27, 0x1b, 0x01, 0x0b, 0x9a,
|
||||
0x6b, 0xf1, 0x7a, 0xf4, 0x3b, 0x50, 0xf4, 0x0c, 0x71, 0x32, 0x2c, 0xc1, 0xc6, 0x3e, 0xb9, 0xf1,
|
||||
0xe7, 0xae, 0x33, 0xa8, 0x1d, 0xd0, 0x7b, 0x64, 0xc5, 0x57, 0xa3, 0x8d, 0x80, 0xd5, 0x9a, 0x6b,
|
||||
0xf1, 0xb5, 0x85, 0xfd, 0x8a, 0x3c, 0x9c, 0x33, 0xe2, 0x0f, 0x01, 0xf9, 0xaf, 0x54, 0x39, 0x06,
|
||||
0x3b, 0x55, 0x12, 0xe8, 0xbb, 0xd9, 0x79, 0xa6, 0x4a, 0x37, 0x17, 0x96, 0xaf, 0x88, 0x5a, 0xbf,
|
||||
0xf3, 0x4f, 0xbc, 0x8a, 0xd3, 0xd8, 0x7e, 0xff, 0xfd, 0xc7, 0xa7, 0x70, 0xab, 0xb1, 0xc9, 0xa7,
|
||||
0x3b, 0x55, 0xcd, 0xae, 0xb2, 0xe2, 0xb3, 0x0c, 0xbd, 0x72, 0xd8, 0x0b, 0x5a, 0x9d, 0xe0, 0xf1,
|
||||
0xe7, 0xda, 0xc7, 0xbd, 0x9f, 0x21, 0xfd, 0x16, 0x90, 0x9b, 0x83, 0x01, 0xeb, 0x63, 0xa2, 0x24,
|
||||
0x6b, 0x1e, 0x08, 0x2f, 0x58, 0x5f, 0x9c, 0x83, 0xdd, 0x6e, 0x1c, 0x11, 0xf2, 0xd4, 0x80, 0x66,
|
||||
0x83, 0xc2, 0x90, 0xde, 0x4a, 0xbd, 0x37, 0xae, 0xc7, 0x79, 0x91, 0xa1, 0x5d, 0x85, 0x18, 0xc3,
|
||||
0xb4, 0xbe, 0x75, 0x71, 0x6e, 0x8f, 0x95, 0x93, 0xb9, 0x73, 0xbb, 0xd5, 0xad, 0x25, 0x16, 0x73,
|
||||
0xe3, 0x22, 0x89, 0x59, 0xeb, 0x25, 0xa1, 0x7b, 0x46, 0xc8, 0x14, 0x58, 0x1c, 0x75, 0x58, 0x5f,
|
||||
0x49, 0x28, 0xda, 0xdb, 0x9d, 0x4b, 0x26, 0xca, 0xa7, 0xf9, 0xa8, 0x60, 0xf2, 0x6a, 0xf5, 0x35,
|
||||
0xda, 0x44, 0x64, 0xe0, 0x16, 0xcc, 0xf8, 0x68, 0x82, 0x23, 0x9e, 0x09, 0xe7, 0xc1, 0xf2, 0xfe,
|
||||
0xd1, 0xfe, 0xe1, 0x93, 0xe3, 0xc3, 0xb8, 0xb6, 0x13, 0x75, 0x5a, 0x61, 0x10, 0xc6, 0xff, 0x0b,
|
||||
0x63, 0x26, 0x4a, 0x96, 0x17, 0xce, 0xdf, 0x38, 0xd4, 0xbd, 0x4b, 0x93, 0xe1, 0x43, 0x52, 0xeb,
|
||||
0x76, 0xba, 0xb4, 0x4b, 0x5a, 0x43, 0xf0, 0xb9, 0xd5, 0x30, 0x66, 0x67, 0x29, 0x68, 0xe6, 0x53,
|
||||
0x60, 0x16, 0x1c, 0xe6, 0x56, 0x02, 0x1b, 0x23, 0x38, 0xa6, 0xd1, 0x33, 0x78, 0xab, 0x9c, 0x8f,
|
||||
0xe8, 0x32, 0x59, 0xfa, 0x12, 0x06, 0x2b, 0xf6, 0x11, 0xd9, 0xb8, 0x28, 0x83, 0x1d, 0xa0, 0xcc,
|
||||
0x33, 0xd0, 0xd5, 0x03, 0xa3, 0x77, 0xaf, 0xae, 0x86, 0x3b, 0xe5, 0x81, 0x8f, 0x51, 0x3a, 0xfe,
|
||||
0x8a, 0xfd, 0x05, 0x2d, 0xfc, 0x97, 0x39, 0x49, 0xb8, 0x19, 0x7d, 0x0d, 0x57, 0x0b, 0xfd, 0x52,
|
||||
0x7e, 0xb4, 0x5c, 0xbe, 0xd8, 0x07, 0xbf, 0x02, 0x00, 0x00, 0xff, 0xff, 0xaa, 0x04, 0x46, 0x55,
|
||||
0x2f, 0x03, 0x00, 0x00,
|
||||
}
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
@ -157,31 +158,31 @@ var _ grpc.ClientConn
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
const _ = grpc.SupportPackageIsVersion4
|
||||
|
||||
// MmLogicClient is the client API for MmLogic service.
|
||||
// QueryServiceClient is the client API for QueryService service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
||||
type MmLogicClient interface {
|
||||
type QueryServiceClient interface {
|
||||
// QueryTickets gets a list of Tickets that match all Filters of the input Pool.
|
||||
// - If the Pool contains no Filters, QueryTickets will return all Tickets in the state storage.
|
||||
// QueryTickets pages the Tickets by `storage.pool.size` and stream back response.
|
||||
// - storage.pool.size is default to 1000 if not set, and has a mininum of 10 and maximum of 10000
|
||||
QueryTickets(ctx context.Context, in *QueryTicketsRequest, opts ...grpc.CallOption) (MmLogic_QueryTicketsClient, error)
|
||||
QueryTickets(ctx context.Context, in *QueryTicketsRequest, opts ...grpc.CallOption) (QueryService_QueryTicketsClient, error)
|
||||
}
|
||||
|
||||
type mmLogicClient struct {
|
||||
type queryServiceClient struct {
|
||||
cc *grpc.ClientConn
|
||||
}
|
||||
|
||||
func NewMmLogicClient(cc *grpc.ClientConn) MmLogicClient {
|
||||
return &mmLogicClient{cc}
|
||||
func NewQueryServiceClient(cc *grpc.ClientConn) QueryServiceClient {
|
||||
return &queryServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *mmLogicClient) QueryTickets(ctx context.Context, in *QueryTicketsRequest, opts ...grpc.CallOption) (MmLogic_QueryTicketsClient, error) {
|
||||
stream, err := c.cc.NewStream(ctx, &_MmLogic_serviceDesc.Streams[0], "/openmatch.MmLogic/QueryTickets", opts...)
|
||||
func (c *queryServiceClient) QueryTickets(ctx context.Context, in *QueryTicketsRequest, opts ...grpc.CallOption) (QueryService_QueryTicketsClient, error) {
|
||||
stream, err := c.cc.NewStream(ctx, &_QueryService_serviceDesc.Streams[0], "/openmatch.QueryService/QueryTickets", opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &mmLogicQueryTicketsClient{stream}
|
||||
x := &queryServiceQueryTicketsClient{stream}
|
||||
if err := x.ClientStream.SendMsg(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -191,16 +192,16 @@ func (c *mmLogicClient) QueryTickets(ctx context.Context, in *QueryTicketsReques
|
||||
return x, nil
|
||||
}
|
||||
|
||||
type MmLogic_QueryTicketsClient interface {
|
||||
type QueryService_QueryTicketsClient interface {
|
||||
Recv() (*QueryTicketsResponse, error)
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
type mmLogicQueryTicketsClient struct {
|
||||
type queryServiceQueryTicketsClient struct {
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
func (x *mmLogicQueryTicketsClient) Recv() (*QueryTicketsResponse, error) {
|
||||
func (x *queryServiceQueryTicketsClient) Recv() (*QueryTicketsResponse, error) {
|
||||
m := new(QueryTicketsResponse)
|
||||
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
@ -208,58 +209,58 @@ func (x *mmLogicQueryTicketsClient) Recv() (*QueryTicketsResponse, error) {
|
||||
return m, nil
|
||||
}
|
||||
|
||||
// MmLogicServer is the server API for MmLogic service.
|
||||
type MmLogicServer interface {
|
||||
// QueryServiceServer is the server API for QueryService service.
|
||||
type QueryServiceServer interface {
|
||||
// QueryTickets gets a list of Tickets that match all Filters of the input Pool.
|
||||
// - If the Pool contains no Filters, QueryTickets will return all Tickets in the state storage.
|
||||
// QueryTickets pages the Tickets by `storage.pool.size` and stream back response.
|
||||
// - storage.pool.size is default to 1000 if not set, and has a mininum of 10 and maximum of 10000
|
||||
QueryTickets(*QueryTicketsRequest, MmLogic_QueryTicketsServer) error
|
||||
QueryTickets(*QueryTicketsRequest, QueryService_QueryTicketsServer) error
|
||||
}
|
||||
|
||||
// UnimplementedMmLogicServer can be embedded to have forward compatible implementations.
|
||||
type UnimplementedMmLogicServer struct {
|
||||
// UnimplementedQueryServiceServer can be embedded to have forward compatible implementations.
|
||||
type UnimplementedQueryServiceServer struct {
|
||||
}
|
||||
|
||||
func (*UnimplementedMmLogicServer) QueryTickets(req *QueryTicketsRequest, srv MmLogic_QueryTicketsServer) error {
|
||||
func (*UnimplementedQueryServiceServer) QueryTickets(req *QueryTicketsRequest, srv QueryService_QueryTicketsServer) error {
|
||||
return status.Errorf(codes.Unimplemented, "method QueryTickets not implemented")
|
||||
}
|
||||
|
||||
func RegisterMmLogicServer(s *grpc.Server, srv MmLogicServer) {
|
||||
s.RegisterService(&_MmLogic_serviceDesc, srv)
|
||||
func RegisterQueryServiceServer(s *grpc.Server, srv QueryServiceServer) {
|
||||
s.RegisterService(&_QueryService_serviceDesc, srv)
|
||||
}
|
||||
|
||||
func _MmLogic_QueryTickets_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
func _QueryService_QueryTickets_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
m := new(QueryTicketsRequest)
|
||||
if err := stream.RecvMsg(m); err != nil {
|
||||
return err
|
||||
}
|
||||
return srv.(MmLogicServer).QueryTickets(m, &mmLogicQueryTicketsServer{stream})
|
||||
return srv.(QueryServiceServer).QueryTickets(m, &queryServiceQueryTicketsServer{stream})
|
||||
}
|
||||
|
||||
type MmLogic_QueryTicketsServer interface {
|
||||
type QueryService_QueryTicketsServer interface {
|
||||
Send(*QueryTicketsResponse) error
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
type mmLogicQueryTicketsServer struct {
|
||||
type queryServiceQueryTicketsServer struct {
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
func (x *mmLogicQueryTicketsServer) Send(m *QueryTicketsResponse) error {
|
||||
func (x *queryServiceQueryTicketsServer) Send(m *QueryTicketsResponse) error {
|
||||
return x.ServerStream.SendMsg(m)
|
||||
}
|
||||
|
||||
var _MmLogic_serviceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "openmatch.MmLogic",
|
||||
HandlerType: (*MmLogicServer)(nil),
|
||||
var _QueryService_serviceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "openmatch.QueryService",
|
||||
HandlerType: (*QueryServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{},
|
||||
Streams: []grpc.StreamDesc{
|
||||
{
|
||||
StreamName: "QueryTickets",
|
||||
Handler: _MmLogic_QueryTickets_Handler,
|
||||
Handler: _QueryService_QueryTickets_Handler,
|
||||
ServerStreams: true,
|
||||
},
|
||||
},
|
||||
Metadata: "api/mmlogic.proto",
|
||||
Metadata: "api/query.proto",
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
|
||||
// source: api/mmlogic.proto
|
||||
// source: api/query.proto
|
||||
|
||||
/*
|
||||
Package pb is a reverse proxy.
|
||||
@ -31,7 +31,7 @@ var _ = runtime.String
|
||||
var _ = utilities.NewDoubleArray
|
||||
var _ = descriptor.ForMessage
|
||||
|
||||
func request_MmLogic_QueryTickets_0(ctx context.Context, marshaler runtime.Marshaler, client MmLogicClient, req *http.Request, pathParams map[string]string) (MmLogic_QueryTicketsClient, runtime.ServerMetadata, error) {
|
||||
func request_QueryService_QueryTickets_0(ctx context.Context, marshaler runtime.Marshaler, client QueryServiceClient, req *http.Request, pathParams map[string]string) (QueryService_QueryTicketsClient, runtime.ServerMetadata, error) {
|
||||
var protoReq QueryTicketsRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
@ -56,12 +56,12 @@ func request_MmLogic_QueryTickets_0(ctx context.Context, marshaler runtime.Marsh
|
||||
|
||||
}
|
||||
|
||||
// RegisterMmLogicHandlerServer registers the http handlers for service MmLogic to "mux".
|
||||
// UnaryRPC :call MmLogicServer directly.
|
||||
// RegisterQueryServiceHandlerServer registers the http handlers for service QueryService to "mux".
|
||||
// UnaryRPC :call QueryServiceServer directly.
|
||||
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
||||
func RegisterMmLogicHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MmLogicServer) error {
|
||||
func RegisterQueryServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServiceServer) error {
|
||||
|
||||
mux.Handle("POST", pattern_MmLogic_QueryTickets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
mux.Handle("POST", pattern_QueryService_QueryTickets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
err := status.Error(codes.Unimplemented, "streaming calls are not yet supported in the in-process transport")
|
||||
_, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
@ -71,9 +71,9 @@ func RegisterMmLogicHandlerServer(ctx context.Context, mux *runtime.ServeMux, se
|
||||
return nil
|
||||
}
|
||||
|
||||
// RegisterMmLogicHandlerFromEndpoint is same as RegisterMmLogicHandler but
|
||||
// RegisterQueryServiceHandlerFromEndpoint is same as RegisterQueryServiceHandler but
|
||||
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
|
||||
func RegisterMmLogicHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
|
||||
func RegisterQueryServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
|
||||
conn, err := grpc.Dial(endpoint, opts...)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -93,23 +93,23 @@ func RegisterMmLogicHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeM
|
||||
}()
|
||||
}()
|
||||
|
||||
return RegisterMmLogicHandler(ctx, mux, conn)
|
||||
return RegisterQueryServiceHandler(ctx, mux, conn)
|
||||
}
|
||||
|
||||
// RegisterMmLogicHandler registers the http handlers for service MmLogic to "mux".
|
||||
// RegisterQueryServiceHandler registers the http handlers for service QueryService to "mux".
|
||||
// The handlers forward requests to the grpc endpoint over "conn".
|
||||
func RegisterMmLogicHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
|
||||
return RegisterMmLogicHandlerClient(ctx, mux, NewMmLogicClient(conn))
|
||||
func RegisterQueryServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
|
||||
return RegisterQueryServiceHandlerClient(ctx, mux, NewQueryServiceClient(conn))
|
||||
}
|
||||
|
||||
// RegisterMmLogicHandlerClient registers the http handlers for service MmLogic
|
||||
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MmLogicClient".
|
||||
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MmLogicClient"
|
||||
// RegisterQueryServiceHandlerClient registers the http handlers for service QueryService
|
||||
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryServiceClient".
|
||||
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryServiceClient"
|
||||
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
|
||||
// "MmLogicClient" to call the correct interceptors.
|
||||
func RegisterMmLogicHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MmLogicClient) error {
|
||||
// "QueryServiceClient" to call the correct interceptors.
|
||||
func RegisterQueryServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryServiceClient) error {
|
||||
|
||||
mux.Handle("POST", pattern_MmLogic_QueryTickets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
mux.Handle("POST", pattern_QueryService_QueryTickets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
@ -118,14 +118,14 @@ func RegisterMmLogicHandlerClient(ctx context.Context, mux *runtime.ServeMux, cl
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_MmLogic_QueryTickets_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
resp, md, err := request_QueryService_QueryTickets_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_MmLogic_QueryTickets_0(ctx, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...)
|
||||
forward_QueryService_QueryTickets_0(ctx, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
@ -133,9 +133,9 @@ func RegisterMmLogicHandlerClient(ctx context.Context, mux *runtime.ServeMux, cl
|
||||
}
|
||||
|
||||
var (
|
||||
pattern_MmLogic_QueryTickets_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "mmlogic", "tickets"}, "query", runtime.AssumeColonVerbOpt(true)))
|
||||
pattern_QueryService_QueryTickets_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "queryservice", "tickets"}, "query", runtime.AssumeColonVerbOpt(true)))
|
||||
)
|
||||
|
||||
var (
|
||||
forward_MmLogic_QueryTickets_0 = runtime.ForwardResponseStream
|
||||
forward_QueryService_QueryTickets_0 = runtime.ForwardResponseStream
|
||||
)
|
@ -40,15 +40,15 @@ func TestGetClients(t *testing.T) {
|
||||
defer closer()
|
||||
|
||||
if c := om.MustFrontendGRPC(); c == nil {
|
||||
t.Error("cannot get frontend client")
|
||||
t.Error("cannot get frontendService client")
|
||||
}
|
||||
|
||||
if c := om.MustBackendGRPC(); c == nil {
|
||||
t.Error("cannot get backend client")
|
||||
t.Error("cannot get backendService client")
|
||||
}
|
||||
|
||||
if c := om.MustMmLogicGRPC(); c == nil {
|
||||
t.Error("cannot get mmlogic client")
|
||||
if c := om.MustQueryServiceGRPC(); c == nil {
|
||||
t.Error("cannot get queryService client")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -127,7 +127,7 @@ func TestMinimatch(t *testing.T) {
|
||||
fc := test.fcGen(om)
|
||||
|
||||
fe := om.MustFrontendGRPC()
|
||||
mml := om.MustMmLogicGRPC()
|
||||
mml := om.MustQueryServiceGRPC()
|
||||
ctx := om.Context()
|
||||
|
||||
// Create all the tickets and validate ticket creation succeeds. Also populate ticket ids
|
||||
|
@ -253,7 +253,7 @@ func TestQueryTickets(t *testing.T) {
|
||||
om, closer := e2e.New(t)
|
||||
defer closer()
|
||||
fe := om.MustFrontendGRPC()
|
||||
mml := om.MustMmLogicGRPC()
|
||||
mml := om.MustQueryServiceGRPC()
|
||||
pageCounts := 0
|
||||
ctx := om.Context()
|
||||
|
||||
|
8
third_party/google/rpc/code.proto
vendored
8
third_party/google/rpc/code.proto
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright 2017 Google Inc.
|
||||
// Copyright 2019 Google LLC.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
@ -11,6 +11,7 @@
|
||||
// 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.
|
||||
//
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
@ -22,7 +23,7 @@ option java_outer_classname = "CodeProto";
|
||||
option java_package = "com.google.rpc";
|
||||
option objc_class_prefix = "RPC";
|
||||
|
||||
// The canonical error codes for Google APIs.
|
||||
// The canonical error codes for gRPC APIs.
|
||||
//
|
||||
//
|
||||
// Sometimes multiple error codes may apply. Services should return
|
||||
@ -170,7 +171,8 @@ enum Code {
|
||||
|
||||
// The service is currently unavailable. This is most likely a
|
||||
// transient condition, which can be corrected by retrying with
|
||||
// a backoff.
|
||||
// a backoff. Note that it is not always safe to retry
|
||||
// non-idempotent operations.
|
||||
//
|
||||
// See the guidelines above for deciding between `FAILED_PRECONDITION`,
|
||||
// `ABORTED`, and `UNAVAILABLE`.
|
||||
|
63
third_party/google/rpc/error_details.proto
vendored
63
third_party/google/rpc/error_details.proto
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright 2017 Google Inc.
|
||||
// Copyright 2019 Google LLC.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
@ -11,6 +11,7 @@
|
||||
// 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.
|
||||
//
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
@ -35,7 +36,7 @@ option objc_class_prefix = "RPC";
|
||||
// receiving the error response before retrying. If retrying requests also
|
||||
// fail, clients should use an exponential backoff scheme to gradually increase
|
||||
// the delay between retries based on `retry_delay`, until either a maximum
|
||||
// number of retires have been reached or a maximum retry delay cap has been
|
||||
// number of retries have been reached or a maximum retry delay cap has been
|
||||
// reached.
|
||||
message RetryInfo {
|
||||
// Clients should wait at least this long between retrying the same request.
|
||||
@ -60,7 +61,7 @@ message DebugInfo {
|
||||
// a service could respond with the project id and set `service_disabled`
|
||||
// to true.
|
||||
//
|
||||
// Also see RetryDetail and Help types for other details about handling a
|
||||
// Also see RetryInfo and Help types for other details about handling a
|
||||
// quota failure.
|
||||
message QuotaFailure {
|
||||
// A message type used to describe a single quota violation. For example, a
|
||||
@ -85,6 +86,53 @@ message QuotaFailure {
|
||||
repeated Violation violations = 1;
|
||||
}
|
||||
|
||||
// Describes the cause of the error with structured details.
|
||||
//
|
||||
// Example of an error when contacting the "pubsub.googleapis.com" API when it
|
||||
// is not enabled:
|
||||
// { "type": "API_DISABLED"
|
||||
// "domain": "googleapis.com"
|
||||
// "metadata": {
|
||||
// "resource": "projects/123",
|
||||
// "service": "pubsub.googleapis.com"
|
||||
// }
|
||||
// }
|
||||
// This response indicates that the pubsub.googleapis.com API is not enabled.
|
||||
//
|
||||
// Example of an error that is returned when attempting to create a Spanner
|
||||
// instance in a region that is out of stock:
|
||||
// { "type": "STOCKOUT"
|
||||
// "domain": "spanner.googleapis.com",
|
||||
// "metadata": {
|
||||
// "availableRegions": ""us-central1,us-east2"
|
||||
// }
|
||||
// }
|
||||
//
|
||||
message ErrorInfo {
|
||||
// The type of the error. This is a constant value that identifies the
|
||||
// proximate cause of the error. Error types are unique within a particular
|
||||
// source of errors. This should be at most 63 characters and match
|
||||
// /[A-Z0-9_]+/.
|
||||
string type = 1;
|
||||
|
||||
// The logical grouping to which the "type" belongs. Often "domain" will
|
||||
// contain the registered service name of the tool or product that is the
|
||||
// source of the error. Example: "pubsub.googleapis.com". If the error is
|
||||
// common across many APIs, the first segment of the example above will be
|
||||
// omitted. The value will be, "googleapis.com".
|
||||
string domain = 2;
|
||||
|
||||
// Additional structured details about this error.
|
||||
//
|
||||
// Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in
|
||||
// length. When identifying the current value of an exceeded limit, the units
|
||||
// should be contained in the key, not the value. For example, rather than
|
||||
// {"instanceLimit": "100/request"}, should be returned as,
|
||||
// {"instanceLimitPerRequest": "100"}, if the client exceeds the number of
|
||||
// instances that can be created in a single (batch) request.
|
||||
map<string, string> metadata = 3;
|
||||
}
|
||||
|
||||
// Describes what preconditions have failed.
|
||||
//
|
||||
// For example, if an RPC failed because it required the Terms of Service to be
|
||||
@ -94,13 +142,13 @@ message PreconditionFailure {
|
||||
// A message type used to describe a single precondition failure.
|
||||
message Violation {
|
||||
// The type of PreconditionFailure. We recommend using a service-specific
|
||||
// enum type to define the supported precondition violation types. For
|
||||
// enum type to define the supported precondition violation subjects. For
|
||||
// example, "TOS" for "Terms of Service violation".
|
||||
string type = 1;
|
||||
|
||||
// The subject, relative to the type, that failed.
|
||||
// For example, "google.com/cloud" relative to the "TOS" type would
|
||||
// indicate which terms of service is being referenced.
|
||||
// For example, "google.com/cloud" relative to the "TOS" type would indicate
|
||||
// which terms of service is being referenced.
|
||||
string subject = 2;
|
||||
|
||||
// A description of how the precondition failed. Developers can use this
|
||||
@ -153,8 +201,7 @@ message ResourceInfo {
|
||||
|
||||
// The name of the resource being accessed. For example, a shared calendar
|
||||
// name: "example.com_4fghdhgsrgh@group.calendar.google.com", if the current
|
||||
// error is
|
||||
// [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED].
|
||||
// error is [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED].
|
||||
string resource_name = 2;
|
||||
|
||||
// The owner of the resource (optional).
|
||||
|
64
third_party/google/rpc/status.proto
vendored
64
third_party/google/rpc/status.proto
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright 2017 Google Inc.
|
||||
// Copyright 2019 Google LLC.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
@ -11,6 +11,7 @@
|
||||
// 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.
|
||||
//
|
||||
|
||||
syntax = "proto3";
|
||||
|
||||
@ -18,6 +19,7 @@ package google.rpc;
|
||||
|
||||
import "google/protobuf/any.proto";
|
||||
|
||||
option cc_enable_arenas = true;
|
||||
option go_package = "google.golang.org/genproto/googleapis/rpc/status;status";
|
||||
option java_multiple_files = true;
|
||||
option java_outer_classname = "StatusProto";
|
||||
@ -26,66 +28,18 @@ option objc_class_prefix = "RPC";
|
||||
|
||||
// The `Status` type defines a logical error model that is suitable for
|
||||
// different programming environments, including REST APIs and RPC APIs. It is
|
||||
// used by [gRPC](https://github.com/grpc). The error model is designed to be:
|
||||
// used by [gRPC](https://github.com/grpc). Each `Status` message contains
|
||||
// three pieces of data: error code, error message, and error details.
|
||||
//
|
||||
// - Simple to use and understand for most users
|
||||
// - Flexible enough to meet unexpected needs
|
||||
//
|
||||
// # Overview
|
||||
//
|
||||
// The `Status` message contains three pieces of data: error code, error
|
||||
// message, and error details. The error code should be an enum value of
|
||||
// [google.rpc.Code][google.rpc.Code], but it may accept additional error codes
|
||||
// if needed. The error message should be a developer-facing English message
|
||||
// that helps developers *understand* and *resolve* the error. If a localized
|
||||
// user-facing error message is needed, put the localized message in the error
|
||||
// details or localize it in the client. The optional error details may contain
|
||||
// arbitrary information about the error. There is a predefined set of error
|
||||
// detail types in the package `google.rpc` that can be used for common error
|
||||
// conditions.
|
||||
//
|
||||
// # Language mapping
|
||||
//
|
||||
// The `Status` message is the logical representation of the error model, but it
|
||||
// is not necessarily the actual wire format. When the `Status` message is
|
||||
// exposed in different client libraries and different wire protocols, it can be
|
||||
// mapped differently. For example, it will likely be mapped to some exceptions
|
||||
// in Java, but more likely mapped to some error codes in C.
|
||||
//
|
||||
// # Other uses
|
||||
//
|
||||
// The error model and the `Status` message can be used in a variety of
|
||||
// environments, either with or without APIs, to provide a
|
||||
// consistent developer experience across different environments.
|
||||
//
|
||||
// Example uses of this error model include:
|
||||
//
|
||||
// - Partial errors. If a service needs to return partial errors to the client,
|
||||
// it may embed the `Status` in the normal response to indicate the partial
|
||||
// errors.
|
||||
//
|
||||
// - Workflow errors. A typical workflow has multiple steps. Each step may
|
||||
// have a `Status` message for error reporting.
|
||||
//
|
||||
// - Batch operations. If a client uses batch request and batch response, the
|
||||
// `Status` message should be used directly inside batch response, one for
|
||||
// each error sub-response.
|
||||
//
|
||||
// - Asynchronous operations. If an API call embeds asynchronous operation
|
||||
// results in its response, the status of those operations should be
|
||||
// represented directly using the `Status` message.
|
||||
//
|
||||
// - Logging. If some API errors are stored in logs, the message `Status` could
|
||||
// be used directly after any stripping needed for security/privacy reasons.
|
||||
// You can find out more about this error model and how to work with it in the
|
||||
// [API Design Guide](https://cloud.google.com/apis/design/errors).
|
||||
message Status {
|
||||
// The status code, which should be an enum value of
|
||||
// [google.rpc.Code][google.rpc.Code].
|
||||
// The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
|
||||
int32 code = 1;
|
||||
|
||||
// A developer-facing error message, which should be in English. Any
|
||||
// user-facing error message should be localized and sent in the
|
||||
// [google.rpc.Status.details][google.rpc.Status.details] field, or localized
|
||||
// by the client.
|
||||
// [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
|
||||
string message = 2;
|
||||
|
||||
// A list of messages that carry the error details. There is a common set of
|
||||
|
2
third_party/swaggerui/config.json
vendored
2
third_party/swaggerui/config.json
vendored
@ -2,7 +2,7 @@
|
||||
"urls": [
|
||||
{"name": "Frontend", "url": "https://open-match.dev/api/v0.0.0-dev/frontend.swagger.json"},
|
||||
{"name": "Backend", "url": "https://open-match.dev/api/v0.0.0-dev/backend.swagger.json"},
|
||||
{"name": "Mmlogic", "url": "https://open-match.dev/api/v0.0.0-dev/mmlogic.swagger.json"},
|
||||
{"name": "Query", "url": "https://open-match.dev/api/v0.0.0-dev/query.swagger.json"},
|
||||
{"name": "MatchFunction", "url": "https://open-match.dev/api/v0.0.0-dev/matchfunction.swagger.json"},
|
||||
{"name": "Synchronizer", "url": "https://open-match.dev/api/v0.0.0-dev/synchronizer.swagger.json"},
|
||||
{"name": "Evaluator", "url": "https://open-match.dev/api/v0.0.0-dev/evaluator.swagger.json"}
|
||||
|
@ -37,7 +37,7 @@ var (
|
||||
"om-e2eevaluator:51518",
|
||||
"om-e2ematchfunction:51512",
|
||||
"om-frontend:51504",
|
||||
"om-mmlogic:51503",
|
||||
"om-query:51503",
|
||||
"om-swaggerui:51500",
|
||||
"om-synchronizer:51506",
|
||||
}
|
||||
|
@ -24,14 +24,14 @@ import (
|
||||
)
|
||||
|
||||
// This tutorial implenents a basic Match Function that is hosted in the below
|
||||
// configured port. You can also configure the Open Match MMLogic service endpoint
|
||||
// configured port. You can also configure the Open Match QueryService endpoint
|
||||
// with which the Match Function communicates to query the Tickets.
|
||||
|
||||
const (
|
||||
mmlogicAddress = "om-mmlogic.open-match.svc.cluster.local:50503" // Address of the MMLogic service endpoint.
|
||||
serverPort = 50502 // The port for hosting the Match Function.
|
||||
queryServiceAddress = "om-query.open-match.svc.cluster.local:50503" // Address of the QueryService endpoint.
|
||||
serverPort = 50502 // The port for hosting the Match Function.
|
||||
)
|
||||
|
||||
func main() {
|
||||
mmf.Start(mmlogicAddress, serverPort)
|
||||
mmf.Start(queryServiceAddress, serverPort)
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ func (s *MatchFunctionService) Run(req *pb.RunRequest, stream pb.MatchFunction_R
|
||||
// Fetch tickets for the pools specified in the Match Profile.
|
||||
log.Printf("Generating proposals for function %v", req.GetProfile().GetName())
|
||||
|
||||
poolTickets, err := matchfunction.QueryPools(stream.Context(), s.mmlogicClient, req.GetProfile().GetPools())
|
||||
poolTickets, err := matchfunction.QueryPools(stream.Context(), s.queryServiceClient, req.GetProfile().GetPools())
|
||||
if err != nil {
|
||||
log.Printf("Failed to query tickets for the given pools, got %w", err)
|
||||
return err
|
||||
|
@ -26,24 +26,24 @@ import (
|
||||
// matchFunctionService implements pb.MatchFunctionServer, the server generated
|
||||
// by compiling the protobuf, by fulfilling the pb.MatchFunctionServer interface.
|
||||
type MatchFunctionService struct {
|
||||
grpc *grpc.Server
|
||||
mmlogicClient pb.MmLogicClient
|
||||
port int
|
||||
grpc *grpc.Server
|
||||
queryServiceClient pb.QueryServiceClient
|
||||
port int
|
||||
}
|
||||
|
||||
// Start creates and starts the Match Function server and also connects to Open
|
||||
// Match's mmlogic service. This connection is used at runtime to fetch tickets
|
||||
// Match's queryService. This connection is used at runtime to fetch tickets
|
||||
// for pools specified in MatchProfile.
|
||||
func Start(mmlogicAddr string, serverPort int) {
|
||||
// Connect to MMLogic service.
|
||||
conn, err := grpc.Dial(mmlogicAddr, grpc.WithInsecure())
|
||||
func Start(queryServiceAddr string, serverPort int) {
|
||||
// Connect to QueryService.
|
||||
conn, err := grpc.Dial(queryServiceAddr, grpc.WithInsecure())
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to connect to Open Match, got %w", err)
|
||||
}
|
||||
defer conn.Close()
|
||||
|
||||
mmfService := MatchFunctionService{
|
||||
mmlogicClient: pb.NewMmLogicClient(conn),
|
||||
queryServiceClient: pb.NewQueryServiceClient(conn),
|
||||
}
|
||||
|
||||
// Create and host a new gRPC service on the configured port.
|
||||
|
@ -24,14 +24,14 @@ import (
|
||||
)
|
||||
|
||||
// This tutorial implenents a basic Match Function that is hosted in the below
|
||||
// configured port. You can also configure the Open Match MMLogic service endpoint
|
||||
// configured port. You can also configure the Open Match QueryService endpoint
|
||||
// with which the Match Function communicates to query the Tickets.
|
||||
|
||||
const (
|
||||
mmlogicAddress = "om-mmlogic.open-match.svc.cluster.local:50503" // Address of the MMLogic service endpoint.
|
||||
serverPort = 50502 // The port for hosting the Match Function.
|
||||
queryServiceAddress = "om-query.open-match.svc.cluster.local:50503" // Address of the QueryService endpoint.
|
||||
serverPort = 50502 // The port for hosting the Match Function.
|
||||
)
|
||||
|
||||
func main() {
|
||||
mmf.Start(mmlogicAddress, serverPort)
|
||||
mmf.Start(queryServiceAddress, serverPort)
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ func (s *MatchFunctionService) Run(req *pb.RunRequest, stream pb.MatchFunction_R
|
||||
// Fetch tickets for the pools specified in the Match Profile.
|
||||
log.Printf("Generating proposals for function %v", req.GetProfile().GetName())
|
||||
|
||||
poolTickets, err := matchfunction.QueryPools(stream.Context(), s.mmlogicClient, req.GetProfile().GetPools())
|
||||
poolTickets, err := matchfunction.QueryPools(stream.Context(), s.queryServiceClient, req.GetProfile().GetPools())
|
||||
if err != nil {
|
||||
log.Printf("Failed to query tickets for the given pools, got %w", err)
|
||||
return err
|
||||
|
@ -26,24 +26,24 @@ import (
|
||||
// matchFunctionService implements pb.MatchFunctionServer, the server generated
|
||||
// by compiling the protobuf, by fulfilling the pb.MatchFunctionServer interface.
|
||||
type MatchFunctionService struct {
|
||||
grpc *grpc.Server
|
||||
mmlogicClient pb.MmLogicClient
|
||||
port int
|
||||
grpc *grpc.Server
|
||||
queryServiceClient pb.QueryServiceClient
|
||||
port int
|
||||
}
|
||||
|
||||
// Start creates and starts the Match Function server and also connects to Open
|
||||
// Match's mmlogic service. This connection is used at runtime to fetch tickets
|
||||
// Match's queryService. This connection is used at runtime to fetch tickets
|
||||
// for pools specified in MatchProfile.
|
||||
func Start(mmlogicAddr string, serverPort int) {
|
||||
// Connect to MMLogic service.
|
||||
conn, err := grpc.Dial(mmlogicAddr, grpc.WithInsecure())
|
||||
func Start(queryServiceAddr string, serverPort int) {
|
||||
// Connect to QueryService.
|
||||
conn, err := grpc.Dial(queryServiceAddr, grpc.WithInsecure())
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to connect to Open Match, got %w", err)
|
||||
}
|
||||
defer conn.Close()
|
||||
|
||||
mmfService := MatchFunctionService{
|
||||
mmlogicClient: pb.NewMmLogicClient(conn),
|
||||
queryServiceClient: pb.NewQueryServiceClient(conn),
|
||||
}
|
||||
|
||||
// Create and host a new gRPC service on the configured port.
|
||||
|
@ -24,14 +24,14 @@ import (
|
||||
)
|
||||
|
||||
// This tutorial implenents a basic Match Function that is hosted in the below
|
||||
// configured port. You can also configure the Open Match MMLogic service endpoint
|
||||
// configured port. You can also configure the Open Match QueryService endpoint
|
||||
// with which the Match Function communicates to query the Tickets.
|
||||
|
||||
const (
|
||||
mmlogicAddress = "om-mmlogic.open-match.svc.cluster.local:50503" // Address of the MMLogic service endpoint.
|
||||
serverPort = 50502 // The port for hosting the Match Function.
|
||||
queryServiceAddress = "om-query.open-match.svc.cluster.local:50503" // Address of the QueryService endpoint.
|
||||
serverPort = 50502 // The port for hosting the Match Function.
|
||||
)
|
||||
|
||||
func main() {
|
||||
mmf.Start(mmlogicAddress, serverPort)
|
||||
mmf.Start(queryServiceAddress, serverPort)
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ func (s *MatchFunctionService) Run(req *pb.RunRequest, stream pb.MatchFunction_R
|
||||
// Fetch tickets for the pools specified in the Match Profile.
|
||||
log.Printf("Generating proposals for function %v", req.GetProfile().GetName())
|
||||
|
||||
poolTickets, err := matchfunction.QueryPools(stream.Context(), s.mmlogicClient, req.GetProfile().GetPools())
|
||||
poolTickets, err := matchfunction.QueryPools(stream.Context(), s.queryServiceClient, req.GetProfile().GetPools())
|
||||
if err != nil {
|
||||
log.Printf("Failed to query tickets for the given pools, got %w", err)
|
||||
return err
|
||||
|
@ -26,24 +26,24 @@ import (
|
||||
// MatchFunctionService implements pb.MatchFunctionServer, the server generated
|
||||
// by compiling the protobuf, by fulfilling the pb.MatchFunctionServer interface.
|
||||
type MatchFunctionService struct {
|
||||
grpc *grpc.Server
|
||||
mmlogicClient pb.MmLogicClient
|
||||
port int
|
||||
grpc *grpc.Server
|
||||
queryServiceClient pb.QueryServiceClient
|
||||
port int
|
||||
}
|
||||
|
||||
// Start creates and starts the Match Function server and also connects to Open
|
||||
// Match's mmlogic service. This connection is used at runtime to fetch tickets
|
||||
// Match's queryService. This connection is used at runtime to fetch tickets
|
||||
// for pools specified in MatchProfile.
|
||||
func Start(mmlogicAddr string, serverPort int) {
|
||||
// Connect to MMLogic service.
|
||||
conn, err := grpc.Dial(mmlogicAddr, grpc.WithInsecure())
|
||||
func Start(queryServiceAddr string, serverPort int) {
|
||||
// Connect to QueryService.
|
||||
conn, err := grpc.Dial(queryServiceAddr, grpc.WithInsecure())
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to connect to Open Match, got %w", err)
|
||||
}
|
||||
defer conn.Close()
|
||||
|
||||
mmfService := MatchFunctionService{
|
||||
mmlogicClient: pb.NewMmLogicClient(conn),
|
||||
queryServiceClient: pb.NewQueryServiceClient(conn),
|
||||
}
|
||||
|
||||
// Create and host a new gRPC service on the configured port.
|
||||
|
@ -24,14 +24,14 @@ import (
|
||||
)
|
||||
|
||||
// This tutorial implenents a basic Match Function that is hosted in the below
|
||||
// configured port. You can also configure the Open Match MMLogic service endpoint
|
||||
// configured port. You can also configure the Open Match QueryService endpoint
|
||||
// with which the Match Function communicates to query the Tickets.
|
||||
|
||||
const (
|
||||
mmlogicAddress = "om-mmlogic.open-match.svc.cluster.local:50503" // Address of the MMLogic service endpoint.
|
||||
serverPort = 50502 // The port for hosting the Match Function.
|
||||
queryServiceAddress = "om-query.open-match.svc.cluster.local:50503" // Address of the QueryService endpoint.
|
||||
serverPort = 50502 // The port for hosting the Match Function.
|
||||
)
|
||||
|
||||
func main() {
|
||||
mmf.Start(mmlogicAddress, serverPort)
|
||||
mmf.Start(queryServiceAddress, serverPort)
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ func (s *MatchFunctionService) Run(req *pb.RunRequest, stream pb.MatchFunction_R
|
||||
// Fetch tickets for the pools specified in the Match Profile.
|
||||
log.Printf("Generating proposals for function %v", req.GetProfile().GetName())
|
||||
|
||||
poolTickets, err := matchfunction.QueryPools(stream.Context(), s.mmlogicClient, req.GetProfile().GetPools())
|
||||
poolTickets, err := matchfunction.QueryPools(stream.Context(), s.queryServiceClient, req.GetProfile().GetPools())
|
||||
if err != nil {
|
||||
log.Printf("Failed to query tickets for the given pools, got %w", err)
|
||||
return err
|
||||
|
@ -26,24 +26,24 @@ import (
|
||||
// MatchFunctionService implements pb.MatchFunctionServer, the server generated
|
||||
// by compiling the protobuf, by fulfilling the pb.MatchFunctionServer interface.
|
||||
type MatchFunctionService struct {
|
||||
grpc *grpc.Server
|
||||
mmlogicClient pb.MmLogicClient
|
||||
port int
|
||||
grpc *grpc.Server
|
||||
queryServiceClient pb.QueryServiceClient
|
||||
port int
|
||||
}
|
||||
|
||||
// Start creates and starts the Match Function server and also connects to Open
|
||||
// Match's mmlogic service. This connection is used at runtime to fetch tickets
|
||||
// Match's queryService. This connection is used at runtime to fetch tickets
|
||||
// for pools specified in MatchProfile.
|
||||
func Start(mmlogicAddr string, serverPort int) {
|
||||
// Connect to MMLogic service.
|
||||
conn, err := grpc.Dial(mmlogicAddr, grpc.WithInsecure())
|
||||
func Start(queryServiceAddr string, serverPort int) {
|
||||
// Connect to QueryService.
|
||||
conn, err := grpc.Dial(queryServiceAddr, grpc.WithInsecure())
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to connect to Open Match, got %w", err)
|
||||
}
|
||||
defer conn.Close()
|
||||
|
||||
mmfService := MatchFunctionService{
|
||||
mmlogicClient: pb.NewMmLogicClient(conn),
|
||||
queryServiceClient: pb.NewQueryServiceClient(conn),
|
||||
}
|
||||
|
||||
// Create and host a new gRPC service on the configured port.
|
||||
|
@ -24,14 +24,14 @@ import (
|
||||
)
|
||||
|
||||
// This tutorial implenents a basic Match Function that is hosted in the below
|
||||
// configured port. You can also configure the Open Match MMLogic service endpoint
|
||||
// configured port. You can also configure the Open Match QueryService endpoint
|
||||
// with which the Match Function communicates to query the Tickets.
|
||||
|
||||
const (
|
||||
mmlogicAddress = "om-mmlogic.open-match.svc.cluster.local:50503" // Address of the MMLogic service endpoint.
|
||||
serverPort = 50502 // The port for hosting the Match Function.
|
||||
queryServiceAddress = "om-query.open-match.svc.cluster.local:50503" // Address of the QueryService endpoint.
|
||||
serverPort = 50502 // The port for hosting the Match Function.
|
||||
)
|
||||
|
||||
func main() {
|
||||
mmf.Start(mmlogicAddress, serverPort)
|
||||
mmf.Start(queryServiceAddress, serverPort)
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ func (s *MatchFunctionService) Run(req *pb.RunRequest, stream pb.MatchFunction_R
|
||||
// Fetch tickets for the pools specified in the Match Profile.
|
||||
log.Printf("Generating proposals for function %v", req.GetProfile().GetName())
|
||||
|
||||
poolTickets, err := matchfunction.QueryPools(stream.Context(), s.mmlogicClient, req.GetProfile().GetPools())
|
||||
poolTickets, err := matchfunction.QueryPools(stream.Context(), s.queryServiceClient, req.GetProfile().GetPools())
|
||||
if err != nil {
|
||||
log.Printf("Failed to query tickets for the given pools, got %w", err)
|
||||
return err
|
||||
|
@ -23,27 +23,27 @@ import (
|
||||
"open-match.dev/open-match/pkg/pb"
|
||||
)
|
||||
|
||||
// matchFunctionService implements pb.MatchFunctionServer, the server generated
|
||||
// MatchFunctionService implements pb.MatchFunctionServer, the server generated
|
||||
// by compiling the protobuf, by fulfilling the pb.MatchFunctionServer interface.
|
||||
type MatchFunctionService struct {
|
||||
grpc *grpc.Server
|
||||
mmlogicClient pb.MmLogicClient
|
||||
port int
|
||||
grpc *grpc.Server
|
||||
queryServiceClient pb.QueryServiceClient
|
||||
port int
|
||||
}
|
||||
|
||||
// Start creates and starts the Match Function server and also connects to Open
|
||||
// Match's mmlogic service. This connection is used at runtime to fetch tickets
|
||||
// Match's queryService service. This connection is used at runtime to fetch tickets
|
||||
// for pools specified in MatchProfile.
|
||||
func Start(mmlogicAddr string, serverPort int) {
|
||||
// Connect to MMLogic service.
|
||||
conn, err := grpc.Dial(mmlogicAddr, grpc.WithInsecure())
|
||||
func Start(queryServiceAddr string, serverPort int) {
|
||||
// Connect to QueryService.
|
||||
conn, err := grpc.Dial(queryServiceAddr, grpc.WithInsecure())
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to connect to Open Match, got %w", err)
|
||||
}
|
||||
defer conn.Close()
|
||||
|
||||
mmfService := MatchFunctionService{
|
||||
mmlogicClient: pb.NewMmLogicClient(conn),
|
||||
queryServiceClient: pb.NewQueryServiceClient(conn),
|
||||
}
|
||||
|
||||
// Create and host a new gRPC service on the configured port.
|
||||
|
@ -24,14 +24,14 @@ import (
|
||||
)
|
||||
|
||||
// This tutorial implenents a basic Match Function that is hosted in the below
|
||||
// configured port. You can also configure the Open Match MMLogic service endpoint
|
||||
// configured port. You can also configure the Open Match QueryService endpoint
|
||||
// with which the Match Function communicates to query the Tickets.
|
||||
|
||||
const (
|
||||
mmlogicAddress = "om-mmlogic.open-match.svc.cluster.local:50503" // Address of the MMLogic service endpoint.
|
||||
serverPort = 50502 // The port for hosting the Match Function.
|
||||
queryServiceAddress = "om-query.open-match.svc.cluster.local:50503" // Address of the QueryService endpoint.
|
||||
serverPort = 50502 // The port for hosting the Match Function.
|
||||
)
|
||||
|
||||
func main() {
|
||||
mmf.Start(mmlogicAddress, serverPort)
|
||||
mmf.Start(queryServiceAddress, serverPort)
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ func (s *MatchFunctionService) Run(req *pb.RunRequest, stream pb.MatchFunction_R
|
||||
// Fetch tickets for the pools specified in the Match Profile.
|
||||
log.Printf("Generating proposals for function %v", req.GetProfile().GetName())
|
||||
|
||||
poolTickets, err := matchfunction.QueryPools(stream.Context(), s.mmlogicClient, req.GetProfile().GetPools())
|
||||
poolTickets, err := matchfunction.QueryPools(stream.Context(), s.queryServiceClient, req.GetProfile().GetPools())
|
||||
if err != nil {
|
||||
log.Printf("Failed to query tickets for the given pools, got %w", err)
|
||||
return err
|
||||
|
@ -26,24 +26,24 @@ import (
|
||||
// matchFunctionService implements pb.MatchFunctionServer, the server generated
|
||||
// by compiling the protobuf, by fulfilling the pb.MatchFunctionServer interface.
|
||||
type MatchFunctionService struct {
|
||||
grpc *grpc.Server
|
||||
mmlogicClient pb.MmLogicClient
|
||||
port int
|
||||
grpc *grpc.Server
|
||||
queryServiceClient pb.QueryServiceClient
|
||||
port int
|
||||
}
|
||||
|
||||
// Start creates and starts the Match Function server and also connects to Open
|
||||
// Match's mmlogic service. This connection is used at runtime to fetch tickets
|
||||
// Match's queryService service. This connection is used at runtime to fetch tickets
|
||||
// for pools specified in MatchProfile.
|
||||
func Start(mmlogicAddr string, serverPort int) {
|
||||
// Connect to MMLogic service.
|
||||
conn, err := grpc.Dial(mmlogicAddr, grpc.WithInsecure())
|
||||
func Start(queryServiceAddr string, serverPort int) {
|
||||
// Connect to QueryService.
|
||||
conn, err := grpc.Dial(queryServiceAddr, grpc.WithInsecure())
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to connect to Open Match, got %w", err)
|
||||
}
|
||||
defer conn.Close()
|
||||
|
||||
mmfService := MatchFunctionService{
|
||||
mmlogicClient: pb.NewMmLogicClient(conn),
|
||||
queryServiceClient: pb.NewQueryServiceClient(conn),
|
||||
}
|
||||
|
||||
// Create and host a new gRPC service on the configured port.
|
||||
|
@ -24,14 +24,14 @@ import (
|
||||
)
|
||||
|
||||
// This tutorial implenents a basic Match Function that is hosted in the below
|
||||
// configured port. You can also configure the Open Match MMLogic service endpoint
|
||||
// configured port. You can also configure the Open Match QueryService endpoint
|
||||
// with which the Match Function communicates to query the Tickets.
|
||||
|
||||
const (
|
||||
mmlogicAddress = "om-mmlogic.open-match.svc.cluster.local:50503" // Address of the MMLogic service endpoint.
|
||||
serverPort = 50502 // The port for hosting the Match Function.
|
||||
queryServiceAddress = "om-query.open-match.svc.cluster.local:50503" // Address of the QueryService endpoint.
|
||||
serverPort = 50502 // The port for hosting the Match Function.
|
||||
)
|
||||
|
||||
func main() {
|
||||
mmf.Start(mmlogicAddress, serverPort)
|
||||
mmf.Start(queryServiceAddress, serverPort)
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ func (s *MatchFunctionService) Run(req *pb.RunRequest, stream pb.MatchFunction_R
|
||||
// Fetch tickets for the pools specified in the Match Profile.
|
||||
log.Printf("Generating proposals for function %v", req.GetProfile().GetName())
|
||||
|
||||
poolTickets, err := matchfunction.QueryPools(stream.Context(), s.mmlogicClient, req.GetProfile().GetPools())
|
||||
poolTickets, err := matchfunction.QueryPools(stream.Context(), s.queryServiceClient, req.GetProfile().GetPools())
|
||||
if err != nil {
|
||||
log.Printf("Failed to query tickets for the given pools, got %w", err)
|
||||
return err
|
||||
|
@ -23,27 +23,27 @@ import (
|
||||
"open-match.dev/open-match/pkg/pb"
|
||||
)
|
||||
|
||||
// matchFunctionService implements pb.MatchFunctionServer, the server generated
|
||||
// MatchFunctionService implements pb.MatchFunctionServer, the server generated
|
||||
// by compiling the protobuf, by fulfilling the pb.MatchFunctionServer interface.
|
||||
type MatchFunctionService struct {
|
||||
grpc *grpc.Server
|
||||
mmlogicClient pb.MmLogicClient
|
||||
port int
|
||||
grpc *grpc.Server
|
||||
queryServiceClient pb.QueryServiceClient
|
||||
port int
|
||||
}
|
||||
|
||||
// Start creates and starts the Match Function server and also connects to Open
|
||||
// Match's mmlogic service. This connection is used at runtime to fetch tickets
|
||||
// Match's queryService. This connection is used at runtime to fetch tickets
|
||||
// for pools specified in MatchProfile.
|
||||
func Start(mmlogicAddr string, serverPort int) {
|
||||
// Connect to MMLogic service.
|
||||
conn, err := grpc.Dial(mmlogicAddr, grpc.WithInsecure())
|
||||
func Start(queryServiceAddr string, serverPort int) {
|
||||
// Connect to QueryService.
|
||||
conn, err := grpc.Dial(queryServiceAddr, grpc.WithInsecure())
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to connect to Open Match, got %w", err)
|
||||
}
|
||||
defer conn.Close()
|
||||
|
||||
mmfService := MatchFunctionService{
|
||||
mmlogicClient: pb.NewMmLogicClient(conn),
|
||||
queryServiceClient: pb.NewQueryServiceClient(conn),
|
||||
}
|
||||
|
||||
// Create and host a new gRPC service on the configured port.
|
||||
|
@ -24,14 +24,14 @@ import (
|
||||
)
|
||||
|
||||
// This tutorial implenents a basic Match Function that is hosted in the below
|
||||
// configured port. You can also configure the Open Match MMLogic service endpoint
|
||||
// configured port. You can also configure the Open Match QueryService endpoint
|
||||
// with which the Match Function communicates to query the Tickets.
|
||||
|
||||
const (
|
||||
mmlogicAddress = "om-mmlogic.open-match.svc.cluster.local:50503" // Address of the MMLogic service endpoint.
|
||||
serverPort = 50502 // The port for hosting the Match Function.
|
||||
queryServiceAddress = "om-query.open-match.svc.cluster.local:50503" // Address of the QueryService endpoint.
|
||||
serverPort = 50502 // The port for hosting the Match Function.
|
||||
)
|
||||
|
||||
func main() {
|
||||
mmf.Start(mmlogicAddress, serverPort)
|
||||
mmf.Start(queryServiceAddress, serverPort)
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ func (s *MatchFunctionService) Run(req *pb.RunRequest, stream pb.MatchFunction_R
|
||||
// Fetch tickets for the pools specified in the Match Profile.
|
||||
log.Printf("Generating proposals for function %v", req.GetProfile().GetName())
|
||||
|
||||
poolTickets, err := matchfunction.QueryPools(stream.Context(), s.mmlogicClient, req.GetProfile().GetPools())
|
||||
poolTickets, err := matchfunction.QueryPools(stream.Context(), s.queryServiceClient, req.GetProfile().GetPools())
|
||||
if err != nil {
|
||||
log.Printf("Failed to query tickets for the given pools, got %w", err)
|
||||
return err
|
||||
|
@ -23,27 +23,27 @@ import (
|
||||
"open-match.dev/open-match/pkg/pb"
|
||||
)
|
||||
|
||||
// matchFunctionService implements pb.MatchFunctionServer, the server generated
|
||||
// MatchFunctionService implements pb.MatchFunctionServer, the server generated
|
||||
// by compiling the protobuf, by fulfilling the pb.MatchFunctionServer interface.
|
||||
type MatchFunctionService struct {
|
||||
grpc *grpc.Server
|
||||
mmlogicClient pb.MmLogicClient
|
||||
port int
|
||||
grpc *grpc.Server
|
||||
queryServiceClient pb.QueryServiceClient
|
||||
port int
|
||||
}
|
||||
|
||||
// Start creates and starts the Match Function server and also connects to Open
|
||||
// Match's mmlogic service. This connection is used at runtime to fetch tickets
|
||||
// Match's queryService. This connection is used at runtime to fetch tickets
|
||||
// for pools specified in MatchProfile.
|
||||
func Start(mmlogicAddr string, serverPort int) {
|
||||
// Connect to MMLogic service.
|
||||
conn, err := grpc.Dial(mmlogicAddr, grpc.WithInsecure())
|
||||
func Start(queryServiceAddr string, serverPort int) {
|
||||
// Connect to QueryService.
|
||||
conn, err := grpc.Dial(queryServiceAddr, grpc.WithInsecure())
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to connect to Open Match, got %w", err)
|
||||
}
|
||||
defer conn.Close()
|
||||
|
||||
mmfService := MatchFunctionService{
|
||||
mmlogicClient: pb.NewMmLogicClient(conn),
|
||||
queryServiceClient: pb.NewQueryServiceClient(conn),
|
||||
}
|
||||
|
||||
// Create and host a new gRPC service on the configured port.
|
||||
|
Reference in New Issue
Block a user