Compare commits

...

4 Commits

Author SHA1 Message Date
60c28919f0 0.6.0 Release () 2019-08-02 14:17:32 -07:00
840a61db47 Unify server setup and call log configuration () ()
* Unify server setup and call log configuration ()

* Fix
2019-07-29 14:36:36 -07:00
098bb12860 Disable Jaeger in install.yaml () 2019-07-17 14:04:04 -07:00
2b94ebb1d4 0.6.0-rc.1 Release () 2019-07-15 15:45:55 -07:00
22 changed files with 100 additions and 205 deletions
Makefilecloudbuild.yaml
cmd
backend
frontend
minimatch
mmlogic
synchronizer
install/helm/open-match
internal
app
logging
telemetry
pkg/harness
evaluator/golang
function/golang
third_party/swaggerui

@ -51,7 +51,7 @@
# If you want information on how to edit this file checkout,
# http://makefiletutorial.com/
BASE_VERSION = 0.0.0-dev
BASE_VERSION = 0.6.0
SHORT_SHA = $(shell git rev-parse --short=7 HEAD | tr -d [:punct:])
VERSION_SUFFIX = $(SHORT_SHA)
BRANCH_NAME = $(shell git rev-parse --abbrev-ref HEAD | tr -d [:punct:])
@ -344,12 +344,12 @@ build/chart/: build/chart/index.yaml build/chart/index.yaml.$(YEAR_MONTH_DAY)
install-large-chart: build/toolchain/bin/helm$(EXE_EXTENSION) install/helm/open-match/secrets/
$(HELM) upgrade $(OPEN_MATCH_CHART_NAME) --install --wait --debug install/helm/open-match \
--timeout=400 \
--timeout=600 \
--namespace=$(OPEN_MATCH_KUBERNETES_NAMESPACE) \
--set openmatch.image.registry=$(REGISTRY) \
--set openmatch.image.tag=$(TAG) \
--set grafana.enabled=true \
--set jaeger.enabled=true \
--set jaeger.enabled=false \
--set prometheus.enabled=true \
--set redis.enabled=true \
--set openmatch.telemetry.stackdriver.enabled=true \
@ -501,7 +501,7 @@ install/yaml/install.yaml: build/toolchain/bin/helm$(EXE_EXTENSION)
--set redis.enabled=true \
--set prometheus.enabled=true \
--set grafana.enabled=true \
--set jaeger.enabled=true \
--set jaeger.enabled=false \
install/helm/open-match > install/yaml/install.yaml
install/yaml/install-demo.yaml: build/toolchain/bin/helm$(EXE_EXTENSION)
@ -923,7 +923,7 @@ preview-release: validate-preview-release build/release/ retag-images ci-deploy-
release: REGISTRY = gcr.io/$(OPEN_MATCH_PUBLIC_IMAGES_PROJECT_ID)
release: TAG = $(BASE_VERSION)
release: build/release/
release: presubmit build/release/
clean-secrets:
rm -rf $(OPEN_MATCH_SECRETS_DIR)

@ -200,7 +200,7 @@ images:
- 'gcr.io/$PROJECT_ID/openmatch-swaggerui:${_OM_VERSION}-${SHORT_SHA}'
- 'gcr.io/$PROJECT_ID/openmatch-reaper:${_OM_VERSION}-${SHORT_SHA}'
substitutions:
_OM_VERSION: "0.0.0-dev"
_OM_VERSION: "0.6.0"
_GCB_POST_SUBMIT: "0"
_GCB_LATEST_VERSION: "undefined"
logsBucket: 'gs://open-match-build-logs/'

@ -16,9 +16,10 @@
package main
import (
"open-match.dev/open-match/internal/app"
"open-match.dev/open-match/internal/app/backend"
)
func main() {
backend.RunApplication()
app.RunApplication("backend", backend.BindService)
}

@ -16,9 +16,10 @@
package main
import (
"open-match.dev/open-match/internal/app"
"open-match.dev/open-match/internal/app/frontend"
)
func main() {
frontend.RunApplication()
app.RunApplication("frontend", frontend.BindService)
}

@ -16,9 +16,10 @@
package main
import (
"open-match.dev/open-match/internal/app"
"open-match.dev/open-match/internal/app/minimatch"
)
func main() {
minimatch.RunApplication()
app.RunApplication("minimatch", minimatch.BindService)
}

@ -16,9 +16,10 @@
package main
import (
"open-match.dev/open-match/internal/app"
"open-match.dev/open-match/internal/app/mmlogic"
)
func main() {
mmlogic.RunApplication()
app.RunApplication("mmlogic", mmlogic.BindService)
}

@ -16,9 +16,10 @@
package main
import (
"open-match.dev/open-match/internal/app"
"open-match.dev/open-match/internal/app/synchronizer"
)
func main() {
synchronizer.RunApplication()
app.RunApplication("synchronizer", synchronizer.BindService)
}

@ -13,8 +13,8 @@
# limitations under the License.
apiVersion: v1
appVersion: "0.0.0-dev"
version: 0.0.0-dev
appVersion: "0.6.0"
version: 0.6.0
name: open-match
description: Flexible, extensible, and scalable video game matchmaking.
keywords:

@ -27,4 +27,4 @@ data:
{{ range $path, $content := $root.Values.openmatch.config.files }}
{{ $path }}: |- {{- tpl (toYaml $content | nindent 4) $root -}}
{{- end -}}
{{- end }}
{{- end }}

@ -15,7 +15,7 @@
openmatch:
telemetry:
jaeger:
enabled: true
enabled: false
agentEndpoint: "open-match-jaeger-agent:6831"
collectorEndpoint: "http://open-match-jaeger-collector:14268/api/traces"
prometheus:
@ -33,7 +33,7 @@ openmatch:
opencensusAgent:
enabled: false
agentEndpoint: "om-opencensus-agent:55678"
reportingPeriod: "5s"
reportingPeriod: "1m"
synchronizer:
install: true
replicas: 1
@ -135,7 +135,7 @@ openmatch:
matchmaker_config.yaml:
logging:
level: debug
format: text
format: "{{ternary \"stackdriver\" \"text\" .Values.openmatch.telemetry.stackdriver.enabled}}"
rpc: false
# Open Match applies the exponential backoff strategy for its retryable gRPC calls.
# The settings below are the default backoff configuration used in Open Match.
@ -247,7 +247,7 @@ openmatch:
image:
registry: gcr.io/open-match-public-images
tag: 0.0.0-dev
tag: 0.6.0
pullPolicy: Always
backend:
name: openmatch-backend

55
internal/app/appmain.go Normal file

@ -0,0 +1,55 @@
// 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.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Package app contains the common application initialization code for Open Match servers.
package app
import (
"github.com/sirupsen/logrus"
"open-match.dev/open-match/internal/config"
"open-match.dev/open-match/internal/logging"
"open-match.dev/open-match/internal/rpc"
)
var (
logger = logrus.WithFields(logrus.Fields{
"app": "openmatch",
"component": "app.main",
})
)
// RunApplication creates a server.
func RunApplication(serverName string, bindService func(*rpc.ServerParams, config.View) error) {
cfg, err := config.Read()
if err != nil {
logger.WithFields(logrus.Fields{
"error": err.Error(),
}).Fatalf("cannot read configuration.")
}
logging.ConfigureLogging(cfg)
p, err := rpc.NewServerParamsFromConfig(cfg, "api."+serverName)
if err != nil {
logger.WithFields(logrus.Fields{
"error": err.Error(),
}).Fatalf("cannot construct server.")
}
if err := bindService(p, cfg); err != nil {
logger.WithFields(logrus.Fields{
"error": err.Error(),
}).Fatalf("failed to bind %s service.", serverName)
}
rpc.MustServeForever(p)
}

@ -15,7 +15,6 @@
package backend
import (
"github.com/sirupsen/logrus"
"google.golang.org/grpc"
"open-match.dev/open-match/internal/config"
"open-match.dev/open-match/internal/rpc"
@ -23,30 +22,6 @@ import (
"open-match.dev/open-match/pkg/pb"
)
// RunApplication creates a server.
func RunApplication() {
cfg, err := config.Read()
if err != nil {
logger.WithFields(logrus.Fields{
"error": err.Error(),
}).Fatalf("cannot read configuration.")
}
p, err := rpc.NewServerParamsFromConfig(cfg, "api.backend")
if err != nil {
logger.WithFields(logrus.Fields{
"error": err.Error(),
}).Fatalf("cannot construct server.")
}
if err := BindService(p, cfg); err != nil {
logger.WithFields(logrus.Fields{
"error": err.Error(),
}).Fatalf("failed to bind backend service.")
}
rpc.MustServeForever(p)
}
// BindService creates the backend service and binds it to the serving harness.
func BindService(p *rpc.ServerParams, cfg config.View) error {
service := &backendService{

@ -15,7 +15,6 @@
package frontend
import (
"github.com/sirupsen/logrus"
"google.golang.org/grpc"
"open-match.dev/open-match/internal/config"
"open-match.dev/open-match/internal/rpc"
@ -23,30 +22,6 @@ import (
"open-match.dev/open-match/pkg/pb"
)
// RunApplication creates a server.
func RunApplication() {
cfg, err := config.Read()
if err != nil {
logger.WithFields(logrus.Fields{
"error": err.Error(),
}).Fatalf("cannot read configuration.")
}
p, err := rpc.NewServerParamsFromConfig(cfg, "api.frontend")
if err != nil {
logger.WithFields(logrus.Fields{
"error": err.Error(),
}).Fatalf("cannot construct server.")
}
if err := BindService(p, cfg); err != nil {
logger.WithFields(logrus.Fields{
"error": err.Error(),
}).Fatalf("failed to bind frontend service.")
}
rpc.MustServeForever(p)
}
// BindService creates the frontend service and binds it to the serving harness.
func BindService(p *rpc.ServerParams, cfg config.View) error {
service := &frontendService{

@ -15,7 +15,6 @@
package minimatch
import (
"github.com/sirupsen/logrus"
"open-match.dev/open-match/internal/app/backend"
"open-match.dev/open-match/internal/app/frontend"
"open-match.dev/open-match/internal/app/mmlogic"
@ -24,37 +23,6 @@ import (
"open-match.dev/open-match/internal/rpc"
)
var (
logger = logrus.WithFields(logrus.Fields{
"app": "openmatch",
"component": "minimatch",
})
)
// RunApplication creates a server.
func RunApplication() {
cfg, err := config.Read()
if err != nil {
logger.WithFields(logrus.Fields{
"error": err.Error(),
}).Fatalf("cannot read configuration.")
}
p, err := rpc.NewServerParamsFromConfig(cfg, "api.frontend")
if err != nil {
logger.WithFields(logrus.Fields{
"error": err.Error(),
}).Fatalf("cannot construct server.")
}
if err := BindService(p, cfg); err != nil {
logger.WithFields(logrus.Fields{
"error": err.Error(),
}).Fatalf("cannot bind server.")
}
rpc.MustServeForever(p)
}
// BindService creates the minimatch service to the server Params.
func BindService(p *rpc.ServerParams, cfg config.View) error {
if err := backend.BindService(p, cfg); err != nil {

@ -15,7 +15,6 @@
package mmlogic
import (
"github.com/sirupsen/logrus"
"google.golang.org/grpc"
"open-match.dev/open-match/internal/config"
"open-match.dev/open-match/internal/rpc"
@ -23,30 +22,6 @@ import (
"open-match.dev/open-match/pkg/pb"
)
// RunApplication creates a server.
func RunApplication() {
cfg, err := config.Read()
if err != nil {
logger.WithFields(logrus.Fields{
"error": err.Error(),
}).Fatalf("cannot read configuration.")
}
p, err := rpc.NewServerParamsFromConfig(cfg, "api.mmlogic")
if err != nil {
logger.WithFields(logrus.Fields{
"error": err.Error(),
}).Fatalf("cannot construct server.")
}
if err := BindService(p, cfg); err != nil {
logger.WithFields(logrus.Fields{
"error": err.Error(),
}).Fatalf("failed to bind mmlogic service.")
}
rpc.MustServeForever(p)
}
// BindService creates the mmlogic service and binds it to the serving harness.
func BindService(p *rpc.ServerParams, cfg config.View) error {
service := &mmlogicService{

@ -26,6 +26,7 @@ import (
"github.com/sirupsen/logrus"
"open-match.dev/open-match/internal/config"
"open-match.dev/open-match/internal/logging"
"open-match.dev/open-match/internal/rpc"
"open-match.dev/open-match/internal/telemetry"
)
@ -45,6 +46,7 @@ func RunApplication() {
"error": err.Error(),
}).Fatalf("cannot read configuration.")
}
logging.ConfigureLogging(cfg)
serve(cfg)
}

@ -15,7 +15,6 @@
package synchronizer
import (
"github.com/sirupsen/logrus"
"google.golang.org/grpc"
"open-match.dev/open-match/internal/config"
"open-match.dev/open-match/internal/pb"
@ -23,31 +22,6 @@ import (
"open-match.dev/open-match/internal/statestore"
)
// RunApplication creates a server.
func RunApplication() {
cfg, err := config.Read()
if err != nil {
logger.WithFields(logrus.Fields{
"error": err.Error(),
}).Fatalf("cannot read configuration.")
}
p, err := rpc.NewServerParamsFromConfig(cfg, "api.synchronizer")
if err != nil {
logger.WithFields(logrus.Fields{
"error": err.Error(),
}).Fatalf("cannot construct server.")
}
if err := BindService(p, cfg); err != nil {
logger.WithFields(logrus.Fields{
"error": err.Error(),
}).Fatalf("failed to bind synchronizer service.")
}
rpc.MustServeForever(p)
}
// BindService creates the synchronizer service and binds it to the serving harness.
func BindService(p *rpc.ServerParams, cfg config.View) error {
service := newSynchronizerService(cfg, &evaluatorClient{cfg: cfg}, statestore.New(cfg))

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
// Package logging provides configurable logging.
// Package logging configures the Logrus logging library.
package logging
import (
@ -37,6 +37,9 @@ func ConfigureLogging(cfg config.View) {
}
switch cfg.GetString("logging.level") {
case "trace":
logrus.SetLevel(logrus.TraceLevel)
logrus.Warn("Trace logging level configured. Not recommended for production!")
case "debug":
logrus.SetLevel(logrus.DebugLevel)
logrus.Warn("Debug logging level configured. Not recommended for production!")

@ -42,8 +42,8 @@ func Setup(mux *http.ServeMux, cfg config.View) func() {
logger.WithFields(logrus.Fields{
"error": err,
"reportingPeriod": periodString,
}).Info("Failed to parse telemetry.reportingPeriod, defaulting to 10s")
reportingPeriod = time.Second * 10
}).Info("Failed to parse telemetry.reportingPeriod, defaulting to 1m")
reportingPeriod = time.Minute * 1
}
bindJaeger(cfg)

@ -17,36 +17,17 @@ package golang
import (
"google.golang.org/grpc"
"open-match.dev/open-match/internal/app"
"open-match.dev/open-match/internal/config"
"open-match.dev/open-match/internal/rpc"
"open-match.dev/open-match/pkg/pb"
"github.com/sirupsen/logrus"
)
// RunEvaluator is a hook for the main() method in the main executable.
func RunEvaluator(eval Evaluator) {
cfg, err := config.Read()
if err != nil {
logger.WithFields(logrus.Fields{
"error": err.Error(),
}).Fatalf("cannot read configuration.")
}
p, err := rpc.NewServerParamsFromConfig(cfg, "api.evaluator")
if err != nil {
logger.WithFields(logrus.Fields{
"error": err.Error(),
}).Fatalf("cannot construct server.")
}
if err := BindService(p, cfg, eval); err != nil {
logger.WithFields(logrus.Fields{
"error": err.Error(),
}).Fatalf("failed to bind evaluator service.")
}
rpc.MustServeForever(p)
app.RunApplication("evaluator", func(p *rpc.ServerParams, cfg config.View) error {
return BindService(p, cfg, eval)
})
}
// BindService creates the evaluator service to the server Params.

@ -17,11 +17,10 @@ package golang
import (
"google.golang.org/grpc"
"open-match.dev/open-match/internal/app"
"open-match.dev/open-match/internal/config"
"open-match.dev/open-match/internal/rpc"
"open-match.dev/open-match/pkg/pb"
"github.com/sirupsen/logrus"
)
// FunctionSettings is a collection of parameters used to customize matchfunction views.
@ -31,26 +30,9 @@ type FunctionSettings struct {
// RunMatchFunction is a hook for the main() method in the main executable.
func RunMatchFunction(settings *FunctionSettings) {
cfg, err := config.Read()
if err != nil {
logger.WithFields(logrus.Fields{
"error": err.Error(),
}).Fatalf("cannot read configuration.")
}
p, err := rpc.NewServerParamsFromConfig(cfg, "api.functions")
if err != nil {
logger.WithFields(logrus.Fields{
"error": err.Error(),
}).Fatalf("cannot construct server.")
}
if err := BindService(p, cfg, settings); err != nil {
logger.WithFields(logrus.Fields{
"error": err.Error(),
}).Fatalf("failed to bind functions service.")
}
rpc.MustServeForever(p)
app.RunApplication("functions", func(p *rpc.ServerParams, cfg config.View) error {
return BindService(p, cfg, settings)
})
}
// BindService creates the function service to the server Params.

@ -1,10 +1,10 @@
{
"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": "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"}
{"name": "Frontend", "url": "https://open-match.dev/api/v0.6.0/frontend.swagger.json"},
{"name": "Backend", "url": "https://open-match.dev/api/v0.6.0/backend.swagger.json"},
{"name": "Mmlogic", "url": "https://open-match.dev/api/v0.6.0/mmlogic.swagger.json"},
{"name": "MatchFunction", "url": "https://open-match.dev/api/v0.6.0/matchfunction.swagger.json"},
{"name": "Synchronizer", "url": "https://open-match.dev/api/v0.6.0/synchronizer.swagger.json"},
{"name": "Evaluator", "url": "https://open-match.dev/api/v0.6.0/evaluator.swagger.json"}
]
}