Compare commits

..

5 Commits

Author SHA1 Message Date
3025dec5f8 updated module versions (#1401) 2021-07-28 14:49:31 -04:00
cfe84e217f Release 1.2.0 (#1379)
* Fix minor typos (#1347)

* Make tests output readable (#1349)

* Fix WatchAssignments causes memory leaks (#1350)

* Return 404 when deleting ticket/backfill ticket that does not exist (#1352)

* Updating jonfoust username to syntxerror as a code reviewer (#1363)

Co-authored-by: jonfoust <38893532+jonfoust@users.noreply.github.com>

* Update to gRPC Gateway v2 (#1358)

* Sentinel fix (#1367)

* update master

* override sentinel.usePassword to false

Co-authored-by: jonfoust <38893532+jonfoust@users.noreply.github.com>

* Revert "Sentinel fix (#1367)" (#1368)

This reverts commit 8b8617f68d5aec70b1016912d07acfe31e3d12ab.

* Sentinel fix (2) (#1369)

* update master

* fixing config.json

* add override for sentinel.usePassword

* Update go.sum

removed leftover from conflict

* Add backfill scenario to scale tests (#1339)

* Implement backfill querying

* Update location for stable and incubator charts

* Add MMF backfill example

* Simplify MMF backfill example

* Add backfill scenario to scale tests

* Update backfill scenario

* Improve backfill scenario

Co-authored-by: Alexander Apalikov <alexander.apalikov@globant.com>

* add mode to profile name for range of game modes (#1375)

* changes for release 1.2.0 process

Co-authored-by: Alexander Apalikov <alexander.apalikov@globant.com>
Co-authored-by: Alexey <oleksii.kremsa@globant.com>
Co-authored-by: yeukovichd <dmitry.yeukovich@globant.com>
Co-authored-by: Lucy Yuan <lucy.yuan@unity3d.com>
Co-authored-by: jonfoust <38893532+jonfoust@users.noreply.github.com>
Co-authored-by: Andrew Grundy <andrewgrundy@2k.com>
Co-authored-by: John Pekcan <johnpekcan@gmail.com>
2021-04-29 21:02:10 -04:00
f848f4eb80 Release 1.2.0-rc.1 (#1370)
* Fix minor typos (#1347)

* Make tests output readable (#1349)

* Fix WatchAssignments causes memory leaks (#1350)

* Return 404 when deleting ticket/backfill ticket that does not exist (#1352)

* Updating jonfoust username to syntxerror as a code reviewer (#1363)

Co-authored-by: jonfoust <38893532+jonfoust@users.noreply.github.com>

* Update to gRPC Gateway v2 (#1358)

* update master

* Sentinel fix (#1367)

* update master

* override sentinel.usePassword to false

Co-authored-by: jonfoust <38893532+jonfoust@users.noreply.github.com>

* Revert "Sentinel fix (#1367)" (#1368)

This reverts commit 8b8617f68d5aec70b1016912d07acfe31e3d12ab.

* fixing config.json

* Sentinel fix (2) (#1369)

* update master

* fixing config.json

* add override for sentinel.usePassword

* Update go.sum

removed leftover from conflict

* Release-1.2.0-rc.1 steps and dependency updates

* Add backfill scenario to scale tests (#1339)

* Implement backfill querying

* Update location for stable and incubator charts

* Add MMF backfill example

* Simplify MMF backfill example

* Add backfill scenario to scale tests

* Update backfill scenario

* Improve backfill scenario

Co-authored-by: Alexander Apalikov <alexander.apalikov@globant.com>

Co-authored-by: jonfoust <38893532+jonfoust@users.noreply.github.com>
Co-authored-by: Alexander Apalikov <alexander.apalikov@globant.com>
Co-authored-by: Alexey <oleksii.kremsa@globant.com>
Co-authored-by: yeukovichd <dmitry.yeukovich@globant.com>
Co-authored-by: Lucy Yuan <lucy.yuan@unity3d.com>
Co-authored-by: Andrew Grundy <andrewgrundy@2k.com>
2021-04-13 20:01:08 -04:00
ed233f899f Revert "Release 1.2 (#1364)" (#1365)
This reverts commit 9b2c5de4a4eca840e4f5483ff99350936b897c88.
2021-04-03 03:21:26 -04:00
9b2c5de4a4 Release 1.2 (#1364)
Release 1.2
2021-03-30 17:48:34 -04:00
250 changed files with 25763 additions and 7938 deletions

2
.github/CODEOWNERS vendored
View File

@ -1 +1 @@
* @laremere @aLekSer @HazWard @calebatwd @syntxerror @sawagh @amg84 @scosgrave @mridulji @markmandel @joeholley
* @laremere @aLekSer @HazWard @calebatwd @syntxerror @sawagh

View File

@ -27,4 +27,4 @@ If the matter is security related, please disclose it privately via
**Open Match Release Version**:
**Install Method(yaml/helm)**:
**Install Method(yaml/helm):**:

View File

@ -37,7 +37,7 @@ then you'll need to create the release branch.
```shell
# Create a local release branch.
git checkout -b release-0.5 upstream/main
git checkout -b release-0.5 upstream/master
# Push the branch upstream.
git push upstream release-0.5
```
@ -76,7 +76,7 @@ Hot Fixes:
Preview:
* Rare, a one off release cut from the main branch to provide early access
* Rare, a one off release cut from the master branch to provide early access
to APIs or some other major change.
* **NOTE: There's no branch for this release.**
* Example: 0.5-preview.1
@ -98,7 +98,7 @@ only required once.**
- [ ] Create the branch in the **upstream** repository. It should be named
release-X.Y. Example: release-0.5. At this point there's effectively a code
freeze for this version and all work on main will be included in a future
freeze for this version and all work on master will be included in a future
version. If you're on the branch that you created in the *getting setup*
section above you should be able to push upstream.
@ -106,16 +106,17 @@ only required once.**
git push origin release-0.5
```
- [ ] Announce a PR freeze on release-X.Y branch on [open-match-discuss@](https://groups.google.com/forum/#!forum/open-match-discuss).
- [ ] Announce a PR freeze on release-X.Y branch on [open-match-discuss@](mailing-list-post).
- [ ] Open the [`Makefile`](makefile-version) and change BASE_VERSION entry.
- [ ] Open the [`install/helm/open-match/Chart.yaml`](om-chart-yaml-version) and change the `appVersion` and `version` entries.
- [ ] Open the [`install/helm/open-match/values.yaml`](om-values-yaml-version) and change the `tag` entries.
- [ ] Open the [`cloudbuild.yaml`] and change the `_OM_VERSION` entry.
- [ ] There might be additional references to the old version but be careful not to change it for places that have it for historical purposes.
- [ ] Update usage requirements in the Installation doc - e.g. supported minikube version, kubectl version, golang version, etc.
- [ ] Run `make release`
- [ ] Run `make api/api.md` in open-match repo to update the auto-generated API references in open-match-docs repo.
- [ ] Create a PR with the changes, include the release candidate name, and point it to the release branch.
- [ ] Go to [open-match-build](https://pantheon.corp.google.com/cloud-build/triggers?project=open-match-build) and update all *post submit* triggers' `_GCB_LATEST_VERSION` value to the `X.Y` of the release. This value should only increase as it's used to determine the latest stable version.
- [ ] Merge your changes once the PR is approved. Note: the helm chart is not published to the public registry until the merge is complete (it's a second cloud build trigger upon merge), so you won't be able to do final release testing until after all checks/approvals are finished!
- [ ] Merge your changes once the PR is approved.
## Create a release branch in the upstream open-match-docs repository
- [ ] Open [`Makefile`](makefile-version) and change BASE_VERSION entry.
@ -130,46 +131,52 @@ git push origin release-0.5
only required once.**
- [ ] Create the next [version milestone](https://github.com/googleforgames/open-match/milestones) and use [semantic versioning](https://semver.org/) when naming it to be consistent with the [Go community](https://blog.golang.org/versioning-proposal).
- [ ] Create a *draft* [release](https://github.com/googleforgames/open-match/releases). Note that github has both "Pre-release" and "draft" as different concepts for a release. Until the release is finalized, only use "Save draft", and do not use "Publish release".
- [ ] Use the [release template](https://github.com/googleforgames/open-match/blob/main/docs/governance/templates/release.md)
- [ ] `Tag = v{version}` (Example: v0.5.0. Append -rc.# for release candidates. Example: v0.5.0-rc.1.)
- [ ] `Target = release-X.Y` (Example: release-0.5.)
- [ ] `Release Title = v{version}` (Must match `Tag`)
- [ ] `Write` section will contain the contents from the [release template](https://github.com/googleforgames/open-match/blob/main/docs/governance/templates/release.md).
- [ ] Add the milestone to all PRs and issues that were merged since the last milestone. Look at the [releases page](https://github.com/googleforgames/open-match/releases) and look for the "X commits to main since this release" for the diff.
- [ ] Use the [release template](https://github.com/googleforgames/open-match/blob/master/docs/governance/templates/release.md)
- [ ] `Tag` = v{version}. Example: v0.5.0. Append -rc.# for release candidates. Example: v0.5.0-rc.1.
- [ ] `Target` = release-X.Y. Example: release-0.5.
- [ ] `Release Title` = `Tag`
- [ ] `Write` section will contain the contents from the [release template](https://github.com/googleforgames/open-match/blob/master/docs/governance/templates/release.md).
- [ ] Add the milestone to all PRs and issues that were merged since the last milestone. Look at the [releases page](https://github.com/googleforgames/open-match/releases) and look for the "X commits to master since this release" for the diff.
- [ ] Review all [milestone-less closed issues](https://github.com/googleforgames/open-match/issues?q=is%3Aissue+is%3Aclosed+no%3Amilestone) and assign the appropriate milestone.
- [ ] Review all [issues in milestone](https://github.com/googleforgames/open-match/milestones) for proper [labels](https://github.com/googleforgames/open-match/labels) (ex: area/build).
- [ ] Review all [milestone-less closed PRs](https://github.com/googleforgames/open-match/pulls?q=is%3Apr+is%3Aclosed+no%3Amilestone) and assign the appropriate milestone.
- [ ] Review all [PRs in milestone](https://github.com/googleforgames/open-match/milestones) for proper [labels](https://github.com/googleforgames/open-match/labels) (ex: area/build).
- [ ] View all open entries in milestone and move them to a future milestone if they aren't getting closed in time. https://github.com/googleforgames/open-match/milestones/v{version}
- [ ] Review all closed PRs against the milestone. Put the user visible changes into the release notes using the suggested format. https://github.com/googleforgames/open-match/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aclosed+is%3Amerged+milestone%3Av{version}
- [ ] Review all closed issues against the milestone. Put the user visible changes into the release notes using the suggested format. https://github.com/googleforgames/open-match/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aclosed+milestone%3Av{version}
- [ ] Verify everything in the [milestone](https://github.com/googleforgames/open-match/milestones) is complete with the exception of the release issue itself.
- [ ] Verify the [milestone](https://github.com/googleforgames/open-match/milestones) is effectively 100% at this point with the exception of the release issue itself.
## Build And Test Artifacts
## Build Artifacts
- [ ] Navigate to the [Cloud Console](https://console.cloud.google.com) in a browser and open the [Cloud Build History section](https://console.cloud.google.com/cloud-build/builds?project=open-match-build) and find the latest "Post Submit" build (trigger id: 9a451c7a-197b-4a38-a612-21f4c53c42fd) of the merged commit. The build may still be running, if so wait for it to finish. If it failed, fix the error and repeat this section. Open the build details and click on step 12, "Build: Docker Images". Take note of the docker image version tag near the top of the build log. This is the "{source version tag}" referenced in various commands below. Example: `0.5.0-a4706cb`.
- [ ] Go to the History section and find the "Post Submit" build of the merged commit that's running. Wait for it to go Green. If it's red, fix error repeat this section. Take note of the docker image version tag for next step. Example: 0.5.0-a4706cb.
- [ ] Run `./docs/governance/templates/release.sh {source version tag} {version}` to copy the images to open-match-public-images.
- [ ] If this is not a release candidate or preview but a full release, run `./docs/governance/templates/release.sh {source version tag} latest` to tag these public images as the default version to pull from the registry.
- [ ] Once the images have successfully been pushed to the registry, modify the line `open-match.dev/open-match v0.0.0-dev` in all `go.mod` files in the [Tutorials] (https://github.com/googleforgames/open-match/tree/main/tutorials) directory to use the current release version for the remainder of your local release testing. This includes all solution subdirectories as well. This change is local only and doesn't get committed to git.
- [ ] Copy the installation files named `{sequence_number}-{component}.yaml` (example: `01-open-match-core.yaml`) from the [build folder in the private open-match-build-artifacts GCS bucket https://storage.mtls.cloud.google.com/open-match-build-artifacts/{version}](https://console.cloud.google.com/storage/browser/open-match-build-artifacts?project=open-match-build) to the release draft you created. Download them to your local machine, and then attach them to the draft using the Github UI. Note: the `05-jaeger.yaml` file no longer exists after release 1.8, so don't be surprised if that number is missing.
- [ ] Update the [Slack invitation link](https://slack.com/help/articles/201330256-invite-new-members-to-your-workspace#share-an-invite-link) in [open-match.dev](https://open-match.dev/site/docs/contribute/#get-involved).
- [ ] Test Open Match installation under GKE and Minikube enviroment using the YAML files attached to the release and the latest Helm chart, pulled from the public helm repo (not your local copy from github). Follow the [First Match](https://development.open-match.dev/site/docs/getting-started/first_match/) guide, run `make proxy-demo`, and open `localhost:51507` to make sure everything works.
- [ ] If this is a new minor version in the newest major version then run `./docs/governance/templates/release.sh {source version tag} latest`.
- [ ] Use the files under the `build/release/` directory for the Open Match installation guide. Make sure the artifacts work as expected - these are the artifacts that will be published to the GCS bucket and used in our release assets.
- [ ] Copy the files from `build/release/` generated from `make release` to the release draft you created. You can drag and drop the files using the Github UI.
- [ ] Update [Slack invitation link](https://slack.com/help/articles/201330256-invite-new-members-to-your-workspace#share-an-invite-link) in [open-match.dev](https://open-match.dev/site/docs/contribute/#get-involved).
- [ ] Test Open Match installation under GKE and Minikube enviroment using YAML files and Helm. Follow the [First Match](https://development.open-match.dev/site/docs/getting-started/first_match/) guide, run `make proxy-demo`, and open `localhost:51507` to make sure everything works.
- [ ] Minikube: Run `make create-mini-cluster` to create a local cluster with latest Kubernetes API version.
- [ ] GKE: Run `make create-gke-cluster` to create a GKE cluster.
- [ ] Helm: Run `helm install open-match -n open-match open-match/open-match`. Note, the helm chart for the release is not public until the PR has been merged, so you cannot complete this step until after the PR is closed and the 'Tagged Build' trigger (trigger ID: 083adc1a-fcac-4033-bc38-b9f6eadcb75d) has completed, which publishes the helm chart.
- [ ] Helm: Run `helm install open-match -n open-match open-match/open-match`
- [ ] Update usage requirements in the Installation doc - e.g. supported minikube version, kubectl version, golang version, etc.
## Finalize
- [ ] Make sure your release draft reflects all steps up to this point, and is saved (so contributors can review it).
- [ ] Save the release as a draft.
- [ ] Circulate the draft release to active contributors. Where reasonable, get everyone's ok on the release notes before continuing.
- [ ] Publish the [Release](om-release) in Github. This will notify repository watchers.
- [ ] Publish the [Release](om-release) on Open Match [Blog](https://open-match.dev/site/blog/).
## Announce
- [ ] Send an email to the [mailing list](https://groups.google.com/forum/#!newtopic/open-match-discuss) with the release details (copy-paste the release blog post)
- [ ] Send a chat on the [Slack channel](https://open-match.slack.com/). "Open Match {version} has been released! Check it out at {release url}."
- [ ] Send an email to the [mailing list](mailing-list-post) with the release details (copy-paste the release blog post)
- [ ] Send a chat on the [Slack channel](om-slack). "Open Match {version} has been released! Check it out at {release url}."
[makefile-version]: https://github.com/googleforgames/open-match/blob/main/Makefile#L53
[om-chart-yaml-version]: https://github.com/googleforgames/open-match/blob/main/install/helm/open-match/Chart.yaml#L16
[om-values-yaml-version]: https://github.com/googleforgames/open-match/blob/main/install/helm/open-match/values.yaml#L16
[om-slack]: https://open-match.slack.com/
[mailing-list-post]: https://groups.google.com/forum/#!newtopic/open-match-discuss
[release-template]: https://github.com/googleforgames/open-match/blob/master/docs/governance/templates/release.md
[makefile-version]: https://github.com/googleforgames/open-match/blob/master/Makefile#L53
[om-chart-yaml-version]: https://github.com/googleforgames/open-match/blob/master/install/helm/open-match/Chart.yaml#L16
[om-values-yaml-version]: https://github.com/googleforgames/open-match/blob/master/install/helm/open-match/values.yaml#L16
[om-release]: https://github.com/googleforgames/open-match/releases/new
[readme-deploy]: https://github.com/googleforgames/open-match/blob/main/README.md#deploy-to-kubernetes
[readme-deploy]: https://github.com/googleforgames/open-match/blob/master/README.md#deploy-to-kubernetes

View File

@ -175,7 +175,6 @@ linters:
- gosec
- interfacer # deprecated - "A tool that suggests interfaces is prone to bad suggestions"
- lll
- typecheck
#linters:
# enable-all: true

View File

@ -13,7 +13,8 @@
# limitations under the License.
# When updating Go version, update Dockerfile.ci, Dockerfile.base-build, and go.mod
FROM golang:1.21.0
FROM golang:1.14.0
ENV GO111MODULE=on
WORKDIR /go/src/open-match.dev/open-match

View File

@ -11,65 +11,47 @@
# 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.
FROM debian:bookworm
# set env vars
ARG DEBIAN_FRONTEND=noninteractive
ENV OPEN_MATCH_CI_MODE=1
ENV KUBECONFIG=$HOME/.kube/config
ENV GOPATH=/go
ENV PATH=$GOPATH/bin:/usr/local/go/bin:$PATH
FROM debian
RUN apt-get update -y \
&& apt-get install -y -qq --no-install-recommends \
apt-utils \
git \
make \
python3 \
virtualenv \
curl \
sudo \
unzip \
apt-transport-https \
ca-certificates \
curl \
software-properties-common \
gnupg2 \
libc6 \
build-essential
RUN mkdir -p /usr/share/keyrings/
RUN apt-get update
RUN apt-get install -y -qq git make python3 virtualenv curl sudo unzip apt-transport-https ca-certificates curl software-properties-common gnupg2
# Docker
RUN echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker.gpg] https://download.docker.com/linux/debian bookworm stable" | tee -a /etc/apt/sources.list.d/docker.list \
&& curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker.gpg \
&& apt-get update -y \
&& apt-get install -y -qq \
docker-ce \
docker-ce-cli \
containerd.io
RUN curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
RUN sudo apt-key fingerprint 0EBFCD88
RUN sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/debian \
stretch \
stable"
RUN sudo apt-get update
RUN sudo apt-get install -y -qq docker-ce docker-ce-cli containerd.io
# Cloud SDK
RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list \
&& curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - \
&& apt-get update -y \
&& apt-get install -y -qq \
google-cloud-cli \
google-cloud-sdk-gke-gcloud-auth-plugin
RUN export CLOUD_SDK_REPO="cloud-sdk-stretch" && \
echo "deb http://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && \
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - && \
apt-get update -y && apt-get install google-cloud-sdk google-cloud-sdk-app-engine-go -y -qq
# Install Golang
# https://github.com/docker-library/golang/blob/master/1.14/stretch/Dockerfile
RUN mkdir -p /toolchain/golang
WORKDIR /toolchain/golang
RUN rm -rf /usr/local/go/
RUN sudo rm -rf /usr/local/go/
# When updating Go version, update Dockerfile.ci, Dockerfile.base-build, and go.mod
# reference: https://github.com/docker-library/golang/blob/master/1.20/bookworm/Dockerfile
RUN curl -L https://golang.org/dl/go1.21.0.linux-amd64.tar.gz | tar -C /usr/local -xz
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" \
&& chmod -R 777 "$GOPATH"
RUN curl -L https://golang.org/dl/go1.14.linux-amd64.tar.gz | sudo tar -C /usr/local -xz
ENV GOPATH /go
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
RUN sudo mkdir -p "$GOPATH/src" "$GOPATH/bin" \
&& sudo chmod -R 777 "$GOPATH"
# Prepare toolchain and workspace
RUN mkdir -p /toolchain
# Prepare toolchain, workspace, homedir
RUN mkdir -p \
/toolchain \
/workspace \
$HOME/.kube/
WORKDIR /workspace
ENV OPEN_MATCH_CI_MODE=1
ENV KUBECONFIG=$HOME/.kube/config
RUN mkdir -p $HOME/.kube/

View File

@ -18,9 +18,7 @@ WORKDIR /go/src/open-match.dev/open-match
ARG IMAGE_TITLE
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
make "build/cmd/${IMAGE_TITLE}"
RUN make "build/cmd/${IMAGE_TITLE}"
FROM gcr.io/distroless/static:nonroot
ARG IMAGE_TITLE

138
Makefile
View File

@ -53,7 +53,7 @@
# If you want information on how to edit this file checkout,
# http://makefiletutorial.com/
BASE_VERSION = 1.8.0
BASE_VERSION = 1.2.0
SHORT_SHA = $(shell git rev-parse --short=7 HEAD | tr -d [:punct:])
BRANCH_NAME = $(shell git rev-parse --abbrev-ref HEAD | tr -d [:punct:])
VERSION = $(BASE_VERSION)-$(SHORT_SHA)
@ -61,15 +61,15 @@ BUILD_DATE = $(shell date -u +'%Y-%m-%dT%H:%M:%SZ')
YEAR_MONTH = $(shell date -u +'%Y%m')
YEAR_MONTH_DAY = $(shell date -u +'%Y%m%d')
MAJOR_MINOR_VERSION = $(shell echo $(BASE_VERSION) | cut -d '.' -f1).$(shell echo $(BASE_VERSION) | cut -d '.' -f2)
PROTOC_VERSION = 24.0
HELM_VERSION = 3.12.3
KUBECTL_VERSION = 1.27.3
PROTOC_VERSION = 3.10.1
HELM_VERSION = 3.0.0
KUBECTL_VERSION = 1.16.2
MINIKUBE_VERSION = latest
GOLANGCI_VERSION = 1.18.0
KIND_VERSION = 0.5.1
SWAGGERUI_VERSION = 3.24.2
GOOGLE_APIS_VERSION = aba342359b6743353195ca53f944fe71e6fb6cd4
GRPC_GATEWAY_VERSION = 2.16.2
GRPC_GATEWAY_VERSION = 2.3.0
TERRAFORM_VERSION = 0.12.13
CHART_TESTING_VERSION = 2.4.0
@ -77,7 +77,7 @@ CHART_TESTING_VERSION = 2.4.0
REDIS_DEV_PASSWORD = helloworld
ENABLE_SECURITY_HARDENING = 0
GO = go
GO = GO111MODULE=on go
# Defines the absolute local directory of the open-match project
REPOSITORY_ROOT := $(patsubst %/,%,$(dir $(abspath $(MAKEFILE_LIST))))
BUILD_DIR = $(REPOSITORY_ROOT)/build
@ -100,10 +100,11 @@ GCP_ZONE = us-west1-a
GCP_LOCATION = $(GCP_ZONE)
EXE_EXTENSION =
GCP_LOCATION_FLAG = --zone $(GCP_ZONE)
GO111MODULE = on
GOLANG_TEST_COUNT = 1
GOLANG_EXTRA_TEST_FLAGS =
SWAGGERUI_PORT = 51500
PROMETHEUS_PORT = 9090
JAEGER_QUERY_PORT = 16686
GRAFANA_PORT = 3000
FRONTEND_PORT = 51504
BACKEND_PORT = 51505
@ -120,7 +121,6 @@ CERTGEN = $(TOOLCHAIN_BIN)/certgen$(EXE_EXTENSION)
GOLANGCI = $(TOOLCHAIN_BIN)/golangci-lint$(EXE_EXTENSION)
CHART_TESTING = $(TOOLCHAIN_BIN)/ct$(EXE_EXTENSION)
GCLOUD = gcloud --quiet
USE_GKE_GCLOUD_AUTH_PLUGIN = True
OPEN_MATCH_HELM_NAME = open-match
OPEN_MATCH_KUBERNETES_NAMESPACE = open-match
OPEN_MATCH_SECRETS_DIR = $(REPOSITORY_ROOT)/install/helm/open-match/secrets
@ -189,10 +189,8 @@ else
endif
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 internal/ipb/messages.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
golang-protos: $(GOLANG_PROTOS)
SWAGGER_JSON_DOCS = api/frontend.swagger.json api/backend.swagger.json api/query.swagger.json api/matchfunction.swagger.json api/evaluator.swagger.json
swagger-json-docs: $(SWAGGER_JSON_DOCS)
ALL_PROTOS = $(GOLANG_PROTOS) $(SWAGGER_JSON_DOCS)
@ -319,9 +317,10 @@ build/chart/: build/chart/index.yaml build/chart/index.yaml.$(YEAR_MONTH_DAY)
install-chart-prerequisite: build/toolchain/bin/kubectl$(EXE_EXTENSION) update-chart-deps
-$(KUBECTL) create namespace $(OPEN_MATCH_KUBERNETES_NAMESPACE)
$(KUBECTL) apply -f install/gke-metadata-server-workaround.yaml
# Used for Open Match development. Install om-configmap-override.yaml by default.
HELM_UPGRADE_FLAGS = --cleanup-on-fail -i --no-hooks --debug --timeout=600s --namespace=$(OPEN_MATCH_KUBERNETES_NAMESPACE) --set global.gcpProjectId=$(GCP_PROJECT_ID) --set open-match-override.enabled=true --set redis.password=$(REDIS_DEV_PASSWORD) --set redis.auth.enabled=false --set redis.auth.sentinel=false
HELM_UPGRADE_FLAGS = --cleanup-on-fail -i --no-hooks --debug --timeout=600s --namespace=$(OPEN_MATCH_KUBERNETES_NAMESPACE) --set global.gcpProjectId=$(GCP_PROJECT_ID) --set open-match-override.enabled=true --set redis.password=$(REDIS_DEV_PASSWORD) --set redis.usePassword=false --set redis.sentinel.usePassword=false
# Used for generate static yamls. Install om-configmap-override.yaml as needed.
HELM_TEMPLATE_FLAGS = --no-hooks --namespace $(OPEN_MATCH_KUBERNETES_NAMESPACE) --set usingHelmTemplate=true
HELM_IMAGE_FLAGS = --set global.image.registry=$(REGISTRY) --set global.image.tag=$(TAG)
@ -340,6 +339,7 @@ install-large-chart: install-chart-prerequisite install-demo build/toolchain/bin
--set open-match-customize.enabled=true \
--set open-match-customize.evaluator.enabled=true \
--set global.telemetry.grafana.enabled=true \
--set global.telemetry.jaeger.enabled=true \
--set global.telemetry.prometheus.enabled=true
# install-chart will install open-match-core, open-match-demo, with the demo evaluator and mmf.
@ -357,6 +357,7 @@ install-scale-chart: install-chart-prerequisite build/toolchain/bin/helm$(EXE_EX
--set open-match-customize.evaluator.enabled=true \
--set open-match-customize.function.image=openmatch-scale-mmf \
--set global.telemetry.grafana.enabled=true \
--set global.telemetry.jaeger.enabled=false \
--set global.telemetry.prometheus.enabled=true
$(HELM) template $(OPEN_MATCH_HELM_NAME)-scale install/helm/open-match $(HELM_TEMPLATE_FLAGS) $(HELM_IMAGE_FLAGS) -f install/helm/open-match/values-production.yaml \
--set open-match-core.enabled=false \
@ -387,8 +388,8 @@ install-ci-chart: install-chart-prerequisite build/toolchain/bin/helm$(EXE_EXTEN
delete-chart: build/toolchain/bin/helm$(EXE_EXTENSION) build/toolchain/bin/kubectl$(EXE_EXTENSION)
-$(HELM) uninstall $(OPEN_MATCH_HELM_NAME)
-$(HELM) uninstall $(OPEN_MATCH_HELM_NAME)-demo
-$(KUBECTL) delete clusterrole,clusterrolebinding --selector=release=open-match
-$(KUBECTL) delete clusterrole,clusterrolebinding --selector=release=open-match-demo
-$(KUBECTL) delete psp,clusterrole,clusterrolebinding --selector=release=open-match
-$(KUBECTL) delete psp,clusterrole,clusterrolebinding --selector=release=open-match-demo
-$(KUBECTL) delete namespace $(OPEN_MATCH_KUBERNETES_NAMESPACE)
-$(KUBECTL) delete namespace $(OPEN_MATCH_KUBERNETES_NAMESPACE)-demo
@ -396,11 +397,14 @@ ifneq ($(BASE_VERSION), 0.0.0-dev)
install/yaml/: REGISTRY = gcr.io/$(OPEN_MATCH_PUBLIC_IMAGES_PROJECT_ID)
install/yaml/: TAG = $(BASE_VERSION)
endif
install/yaml/: update-chart-deps install/yaml/install.yaml install/yaml/01-open-match-core.yaml install/yaml/02-open-match-demo.yaml install/yaml/03-prometheus-chart.yaml install/yaml/04-grafana-chart.yaml install/yaml/06-open-match-override-configmap.yaml install/yaml/07-open-match-default-evaluator.yaml
install/yaml/: update-chart-deps install/yaml/install.yaml install/yaml/01-open-match-core.yaml install/yaml/02-open-match-demo.yaml install/yaml/03-prometheus-chart.yaml install/yaml/04-grafana-chart.yaml install/yaml/05-jaeger-chart.yaml install/yaml/06-open-match-override-configmap.yaml install/yaml/07-open-match-default-evaluator.yaml
# We have to hard-code the Jaeger endpoints as we are excluding Jaeger, so Helm cannot determine the endpoints from the Jaeger subchart
install/yaml/01-open-match-core.yaml: build/toolchain/bin/helm$(EXE_EXTENSION)
mkdir -p install/yaml/
$(HELM) template $(OPEN_MATCH_HELM_NAME) $(HELM_TEMPLATE_FLAGS) $(HELM_IMAGE_FLAGS) \
--set-string global.telemetry.jaeger.agentEndpoint="$(OPEN_MATCH_HELM_NAME)-jaeger-agent:6831" \
--set-string global.telemetry.jaeger.collectorEndpoint="http://$(OPEN_MATCH_HELM_NAME)-jaeger-collector:14268/api/traces" \
install/helm/open-match > install/yaml/01-open-match-core.yaml
install/yaml/02-open-match-demo.yaml: build/toolchain/bin/helm$(EXE_EXTENSION)
@ -429,6 +433,15 @@ install/yaml/04-grafana-chart.yaml: build/toolchain/bin/helm$(EXE_EXTENSION)
--set-string global.telemetry.grafana.prometheusServer="http://$(OPEN_MATCH_HELM_NAME)-prometheus-server.$(OPEN_MATCH_KUBERNETES_NAMESPACE).svc.cluster.local:80/" \
install/helm/open-match > install/yaml/04-grafana-chart.yaml
install/yaml/05-jaeger-chart.yaml: build/toolchain/bin/helm$(EXE_EXTENSION)
mkdir -p install/yaml/
$(HELM) template $(OPEN_MATCH_HELM_NAME) $(HELM_TEMPLATE_FLAGS) $(HELM_IMAGE_FLAGS) \
--set open-match-core.enabled=false \
--set open-match-core.redis.enabled=false \
--set open-match-telemetry.enabled=true \
--set global.telemetry.jaeger.enabled=true \
install/helm/open-match > install/yaml/05-jaeger-chart.yaml
install/yaml/06-open-match-override-configmap.yaml: build/toolchain/bin/helm$(EXE_EXTENSION)
mkdir -p install/yaml/
$(HELM) template $(OPEN_MATCH_HELM_NAME) $(HELM_TEMPLATE_FLAGS) $(HELM_IMAGE_FLAGS) \
@ -453,6 +466,7 @@ install/yaml/install.yaml: build/toolchain/bin/helm$(EXE_EXTENSION)
--set open-match-customize.enabled=true \
--set open-match-customize.evaluator.enabled=true \
--set open-match-telemetry.enabled=true \
--set global.telemetry.jaeger.enabled=true \
--set global.telemetry.grafana.enabled=true \
--set global.telemetry.prometheus.enabled=true \
install/helm/open-match > install/yaml/install.yaml
@ -481,7 +495,7 @@ install-kubernetes-tools: build/toolchain/bin/kubectl$(EXE_EXTENSION) build/tool
## # Install protoc tools
## make install-protoc-tools
##
install-protoc-tools: build/toolchain/bin/protoc$(EXE_EXTENSION) build/toolchain/bin/protoc-gen-go$(EXE_EXTENSION) build/toolchain/bin/protoc-gen-go-grpc$(EXE_EXTENSION) build/toolchain/bin/protoc-gen-grpc-gateway$(EXE_EXTENSION) build/toolchain/bin/protoc-gen-openapiv2$(EXE_EXTENSION)
install-protoc-tools: build/toolchain/bin/protoc$(EXE_EXTENSION) build/toolchain/bin/protoc-gen-go$(EXE_EXTENSION) build/toolchain/bin/protoc-gen-grpc-gateway$(EXE_EXTENSION) build/toolchain/bin/protoc-gen-openapiv2$(EXE_EXTENSION)
## # Install OpenMatch tools
## make install-openmatch-tools
@ -550,22 +564,18 @@ build/toolchain/bin/protoc$(EXE_EXTENSION):
build/toolchain/bin/protoc-gen-doc$(EXE_EXTENSION):
mkdir -p $(TOOLCHAIN_BIN)
cd $(TOOLCHAIN_BIN) && $(GO) get github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc && $(GO) build -pkgdir . github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc
cd $(TOOLCHAIN_BIN) && $(GO) build -i -pkgdir . github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc
build/toolchain/bin/protoc-gen-go$(EXE_EXTENSION):
mkdir -p $(TOOLCHAIN_BIN)
cd $(TOOLCHAIN_BIN) && $(GO) get google.golang.org/protobuf/cmd/protoc-gen-go && $(GO) build -pkgdir . google.golang.org/protobuf/cmd/protoc-gen-go
build/toolchain/bin/protoc-gen-go-grpc$(EXE_EXTENSION):
mkdir -p $(TOOLCHAIN_BIN)
cd $(TOOLCHAIN_BIN) && $(GO) get google.golang.org/grpc/cmd/protoc-gen-go-grpc && $(GO) build -pkgdir . google.golang.org/grpc/cmd/protoc-gen-go-grpc
cd $(TOOLCHAIN_BIN) && $(GO) build -i -pkgdir . github.com/golang/protobuf/protoc-gen-go
build/toolchain/bin/protoc-gen-grpc-gateway$(EXE_EXTENSION):
cd $(TOOLCHAIN_BIN) && $(GO) get github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway && $(GO) build -pkgdir . github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway
cd $(TOOLCHAIN_BIN) && $(GO) build -i -pkgdir . github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway
build/toolchain/bin/protoc-gen-openapiv2$(EXE_EXTENSION):
mkdir -p $(TOOLCHAIN_BIN)
cd $(TOOLCHAIN_BIN) && $(GO) get github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2 && $(GO) build -pkgdir . github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2
cd $(TOOLCHAIN_BIN) && $(GO) build -i -pkgdir . github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2
build/toolchain/bin/certgen$(EXE_EXTENSION):
mkdir -p $(TOOLCHAIN_BIN)
@ -626,23 +636,26 @@ delete-kind-cluster: build/toolchain/bin/kind$(EXE_EXTENSION) build/toolchain/bi
create-cluster-role-binding:
$(KUBECTL) create clusterrolebinding myname-cluster-admin-binding --clusterrole=cluster-admin --user=$(GCLOUD_ACCOUNT_EMAIL)
create-gke-cluster: GKE_VERSION = 1.15.12-gke.6002 # gcloud beta container get-server-config --zone us-west1-a
create-gke-cluster: GKE_CLUSTER_SHAPE_FLAGS = --machine-type n1-standard-8 --enable-autoscaling --min-nodes 1 --num-nodes 6 --max-nodes 10 --disk-size 50
create-gke-cluster: GKE_FUTURE_COMPAT_FLAGS = --no-enable-basic-auth --no-issue-client-certificate --enable-ip-alias --metadata disable-legacy-endpoints=true --enable-autoupgrade
create-gke-cluster: build/toolchain/bin/kubectl$(EXE_EXTENSION) gcloud
$(GCLOUD) $(GCP_PROJECT_FLAG) container clusters create $(GKE_CLUSTER_NAME) $(GCP_LOCATION_FLAG) $(GKE_CLUSTER_SHAPE_FLAGS) $(GKE_FUTURE_COMPAT_FLAGS) $(GKE_CLUSTER_FLAGS) \
--cluster-version 1.27.3-gke.1700 \
$(GCLOUD) beta $(GCP_PROJECT_FLAG) container clusters create $(GKE_CLUSTER_NAME) $(GCP_LOCATION_FLAG) $(GKE_CLUSTER_SHAPE_FLAGS) $(GKE_FUTURE_COMPAT_FLAGS) $(GKE_CLUSTER_FLAGS) \
--enable-pod-security-policy \
--cluster-version $(GKE_VERSION) \
--image-type cos_containerd \
--tags open-match \
--workload-pool $(GCP_PROJECT_ID).svc.id.goog
--tags open-match
$(MAKE) create-cluster-role-binding
delete-gke-cluster: gcloud
-$(GCLOUD) $(GCP_PROJECT_FLAG) container clusters delete $(GKE_CLUSTER_NAME) $(GCP_LOCATION_FLAG) $(GCLOUD_EXTRA_FLAGS)
create-mini-cluster: build/toolchain/bin/minikube$(EXE_EXTENSION)
$(MINIKUBE) start -p openmatch --memory 6144 --cpus 4 --disk-size 50g --kubernetes-version=v1.27.3
$(MINIKUBE) start --memory 6144 --cpus 4 --disk-size 50g
delete-mini-cluster: build/toolchain/bin/minikube$(EXE_EXTENSION)
-$(MINIKUBE) delete -p openmatch
-$(MINIKUBE) delete
gcp-apply-binauthz-policy: build/policies/binauthz.yaml
$(GCLOUD) beta $(GCP_PROJECT_FLAG) container binauthz policy import build/policies/binauthz.yaml
@ -660,28 +673,26 @@ all-protos: $(ALL_PROTOS)
# support methods for directing it to the correct location that's not the proto
# file's location.
# So, instead, put it in a tempororary directory, then move it out.
pkg/pb/%.pb.go: api/%.proto third_party/ build/toolchain/bin/protoc$(EXE_EXTENSION) build/toolchain/bin/protoc-gen-go$(EXE_EXTENSION) build/toolchain/bin/protoc-gen-go-grpc$(EXE_EXTENSION) build/toolchain/bin/protoc-gen-grpc-gateway$(EXE_EXTENSION)
pkg/pb/%.pb.go: api/%.proto third_party/ build/toolchain/bin/protoc$(EXE_EXTENSION) build/toolchain/bin/protoc-gen-go$(EXE_EXTENSION) build/toolchain/bin/protoc-gen-grpc-gateway$(EXE_EXTENSION)
mkdir -p $(REPOSITORY_ROOT)/build/prototmp $(REPOSITORY_ROOT)/pkg/pb
$(PROTOC) $< \
$(PROTOC) $< \
-I $(REPOSITORY_ROOT) -I $(PROTOC_INCLUDES) \
--go_out=$(REPOSITORY_ROOT)/build/prototmp \
--go-grpc_out=require_unimplemented_servers=false:$(REPOSITORY_ROOT)/build/prototmp
mv $(REPOSITORY_ROOT)/build/prototmp/open-match.dev/open-match/pkg/pb/* $(REPOSITORY_ROOT)/pkg/pb/
--go_out=plugins=grpc:$(REPOSITORY_ROOT)/build/prototmp
mv $(REPOSITORY_ROOT)/build/prototmp/open-match.dev/open-match/$@ $@
internal/ipb/%.pb.go: internal/api/%.proto third_party/ build/toolchain/bin/protoc$(EXE_EXTENSION) build/toolchain/bin/protoc-gen-go$(EXE_EXTENSION) build/toolchain/bin/protoc-gen-go-grpc$(EXE_EXTENSION) build/toolchain/bin/protoc-gen-grpc-gateway$(EXE_EXTENSION)
internal/ipb/%.pb.go: internal/api/%.proto third_party/ build/toolchain/bin/protoc$(EXE_EXTENSION) build/toolchain/bin/protoc-gen-go$(EXE_EXTENSION) build/toolchain/bin/protoc-gen-grpc-gateway$(EXE_EXTENSION)
mkdir -p $(REPOSITORY_ROOT)/build/prototmp $(REPOSITORY_ROOT)/internal/ipb
$(PROTOC) $< \
$(PROTOC) $< \
-I $(REPOSITORY_ROOT) -I $(PROTOC_INCLUDES) \
--go_out=$(REPOSITORY_ROOT)/build/prototmp \
--go-grpc_out=require_unimplemented_servers=false:$(REPOSITORY_ROOT)/build/prototmp
mv $(REPOSITORY_ROOT)/build/prototmp/open-match.dev/open-match/internal/ipb/* $(REPOSITORY_ROOT)/internal/ipb/
--go_out=plugins=grpc:$(REPOSITORY_ROOT)/build/prototmp
mv $(REPOSITORY_ROOT)/build/prototmp/open-match.dev/open-match/$@ $@
pkg/pb/%.pb.gw.go: api/%.proto third_party/ build/toolchain/bin/protoc$(EXE_EXTENSION) build/toolchain/bin/protoc-gen-go$(EXE_EXTENSION) build/toolchain/bin/protoc-gen-go-grpc$(EXE_EXTENSION) build/toolchain/bin/protoc-gen-grpc-gateway$(EXE_EXTENSION)
pkg/pb/%.pb.gw.go: api/%.proto third_party/ build/toolchain/bin/protoc$(EXE_EXTENSION) build/toolchain/bin/protoc-gen-go$(EXE_EXTENSION) build/toolchain/bin/protoc-gen-grpc-gateway$(EXE_EXTENSION)
mkdir -p $(REPOSITORY_ROOT)/build/prototmp $(REPOSITORY_ROOT)/pkg/pb
$(PROTOC) $< \
-I $(REPOSITORY_ROOT) -I $(PROTOC_INCLUDES) \
--grpc-gateway_out=logtostderr=true,allow_delete_body=true:$(REPOSITORY_ROOT)/build/prototmp
mv $(REPOSITORY_ROOT)/build/prototmp/open-match.dev/open-match/pkg/pb/* $(REPOSITORY_ROOT)/pkg/pb/
mv $(REPOSITORY_ROOT)/build/prototmp/open-match.dev/open-match/$@ $@
api/%.swagger.json: api/%.proto third_party/ build/toolchain/bin/protoc$(EXE_EXTENSION) build/toolchain/bin/protoc-gen-openapiv2$(EXE_EXTENSION)
$(PROTOC) $< \
@ -725,10 +736,8 @@ build: assets
define test_folder
$(if $(wildcard $(1)/go.mod), \
cd $(1) && \
$(GO) mod tidy && \
$(GO) mod download -x && \
CGO_ENABLED=1 $(GO) test $(GOLANG_EXTRA_TEST_FLAGS) -p 1 -cover -test.count $(GOLANG_TEST_COUNT) -race -vet=off ./... && \
CGO_ENABLED=0 $(GO) test $(GOLANG_EXTRA_TEST_FLAGS) -p 1 -cover -test.count $(GOLANG_TEST_COUNT) -vet=off -run IgnoreRace$$ ./... \
$(GO) test -cover -test.count $(GOLANG_TEST_COUNT) -race ./... && \
$(GO) test -cover -test.count $(GOLANG_TEST_COUNT) -run IgnoreRace$$ ./... \
)
$(foreach dir, $(wildcard $(1)/*/.), $(call test_folder, $(dir)))
endef
@ -754,7 +763,7 @@ fasttest: $(ALL_PROTOS) tls-certs third_party/
$(call fast_test_folder,.)
test-e2e-cluster: all-protos tls-certs third_party/
$(HELM) test --timeout 15m --debug -v 0 --logs -n $(OPEN_MATCH_KUBERNETES_NAMESPACE) $(OPEN_MATCH_HELM_NAME)
$(HELM) test --timeout 7m30s -v 0 --logs -n $(OPEN_MATCH_KUBERNETES_NAMESPACE) $(OPEN_MATCH_HELM_NAME)
fmt:
$(GO) fmt ./...
@ -764,7 +773,7 @@ vet:
$(GO) vet ./...
golangci: build/toolchain/bin/golangci-lint$(EXE_EXTENSION)
$(GOLANGCI) run --config=$(REPOSITORY_ROOT)/.golangci.yaml
GO111MODULE=on $(GOLANGCI) run --config=$(REPOSITORY_ROOT)/.golangci.yaml
## # Run linter on Go code, charts and terraform
## make lint
@ -783,7 +792,7 @@ $(foreach CMD,$(CMDS),build/cmd/$(CMD)): build/cmd/%: build/cmd/%/BUILD_PHONY bu
build/cmd/%/BUILD_PHONY:
mkdir -p $(BUILD_DIR)/cmd/$*
CGO_ENABLED=0 $(GO) build -v -installsuffix cgo -o $(BUILD_DIR)/cmd/$*/run open-match.dev/open-match/cmd/$*
CGO_ENABLED=0 $(GO) build -a -installsuffix cgo -o $(BUILD_DIR)/cmd/$*/run open-match.dev/open-match/cmd/$*
# Default is that nothing needs to be copied into the direcotry
build/cmd/%/COPY_PHONY:
@ -854,7 +863,7 @@ ci-reap-namespaces: build/toolchain/bin/reaper$(EXE_EXTENSION)
-$(TOOLCHAIN_BIN)/reaper -age=30m
# For presubmit we want to update the protobuf generated files and verify that tests are good.
presubmit: GOLANG_TEST_COUNT = 3
presubmit: GOLANG_TEST_COUNT = 5
presubmit: clean third_party/ update-chart-deps assets update-deps lint build test md-test terraform-test
build/release/: presubmit clean-install-yaml install/yaml/
@ -939,13 +948,17 @@ proxy-synchronizer: build/toolchain/bin/kubectl$(EXE_EXTENSION)
@echo "Synchronizer Trace: http://localhost:$(SYNCHRONIZER_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=synchronizer,release=$(OPEN_MATCH_HELM_NAME)" --output jsonpath='{.items[0].metadata.name}') $(SYNCHRONIZER_PORT):51506 $(PORT_FORWARD_ADDRESS_FLAG)
proxy-jaeger: build/toolchain/bin/kubectl$(EXE_EXTENSION)
@echo "Jaeger Query Frontend: http://localhost:16686"
$(KUBECTL) port-forward --namespace $(OPEN_MATCH_KUBERNETES_NAMESPACE) $(shell $(KUBECTL) get pod --namespace $(OPEN_MATCH_KUBERNETES_NAMESPACE) --selector="app.kubernetes.io/name=jaeger,app.kubernetes.io/component=query" --output jsonpath='{.items[0].metadata.name}') $(JAEGER_QUERY_PORT):16686 $(PORT_FORWARD_ADDRESS_FLAG)
proxy-grafana: build/toolchain/bin/kubectl$(EXE_EXTENSION)
@echo "User: admin"
@echo "Password: openmatch"
$(KUBECTL) port-forward --namespace $(OPEN_MATCH_KUBERNETES_NAMESPACE) service/$(shell $(KUBECTL) get service --namespace $(OPEN_MATCH_KUBERNETES_NAMESPACE) --selector="app.kubernetes.io/name=grafana" --output jsonpath='{.items[0].metadata.name}') $(GRAFANA_PORT):3000 $(PORT_FORWARD_ADDRESS_FLAG)
$(KUBECTL) port-forward --namespace $(OPEN_MATCH_KUBERNETES_NAMESPACE) $(shell $(KUBECTL) get pod --namespace $(OPEN_MATCH_KUBERNETES_NAMESPACE) --selector="app=grafana,release=$(OPEN_MATCH_HELM_NAME)" --output jsonpath='{.items[0].metadata.name}') $(GRAFANA_PORT):3000 $(PORT_FORWARD_ADDRESS_FLAG)
proxy-prometheus: build/toolchain/bin/kubectl$(EXE_EXTENSION)
$(KUBECTL) port-forward --namespace $(OPEN_MATCH_KUBERNETES_NAMESPACE) service/$(shell $(KUBECTL) get service --namespace $(OPEN_MATCH_KUBERNETES_NAMESPACE) --selector="app=prometheus,component=server,release=$(OPEN_MATCH_HELM_NAME)" --output jsonpath='{.items[0].metadata.name}') $(PROMETHEUS_PORT):80 $(PORT_FORWARD_ADDRESS_FLAG)
$(KUBECTL) port-forward --namespace $(OPEN_MATCH_KUBERNETES_NAMESPACE) $(shell $(KUBECTL) get pod --namespace $(OPEN_MATCH_KUBERNETES_NAMESPACE) --selector="app=prometheus,component=server,release=$(OPEN_MATCH_HELM_NAME)" --output jsonpath='{.items[0].metadata.name}') $(PROMETHEUS_PORT):9090 $(PORT_FORWARD_ADDRESS_FLAG)
proxy-dashboard: build/toolchain/bin/kubectl$(EXE_EXTENSION)
$(KUBECTL) port-forward --namespace kube-system $(shell $(KUBECTL) get pod --namespace kube-system --selector="app=kubernetes-dashboard" --output jsonpath='{.items[0].metadata.name}') $(DASHBOARD_PORT):9092 $(PORT_FORWARD_ADDRESS_FLAG)
@ -960,7 +973,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-query proxy-grafana proxy-prometheus 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.
@ -969,7 +982,6 @@ proxy:
update-deps:
$(GO) mod tidy
$(MAKE) tutorial-deps
third_party/: third_party/google/api third_party/protoc-gen-openapiv2/options third_party/swaggerui/
@ -1005,25 +1017,9 @@ third_party/swaggerui/:
$(SED_REPLACE) 's|0.0.0-dev|$(BASE_VERSION)|g' $(REPOSITORY_ROOT)/third_party/swaggerui/config.json
rm -rf $(TOOLCHAIN_DIR)/swaggerui-temp
clean-deps:
sync-deps:
$(GO) clean -modcache
sync-deps: clean-deps
$(GO) mod tidy
$(GO) mod download -x
define tutorial_folder
$(if $(wildcard $(1)/go.mod), \
cd $(1) && \
$(GO) mod tidy
)
$(foreach dir, $(wildcard $(1)/*/.), $(call tutorial_folder, $(dir)))
endef
tutorial-deps:
$(call tutorial_folder,./tutorials)
$(GO) mod download
# Prevents users from running with sudo.
# There's an exception for Google Cloud Build because it runs as root.

View File

@ -26,7 +26,7 @@ to Open Match.
## Support
* [Slack Channel](https://open-match.slack.com/) ([Signup](https://join.slack.com/t/open-match/shared_invite/zt-5k57lph3-Oe0WdatzL32xv6tPG3PfzQ))
* [Slack Channel](https://open-match.slack.com/) ([Signup](https://join.slack.com/t/open-match/shared_invite/enQtNDM1NjcxNTY4MTgzLTM5ZWQxNjc1YWI3MzJmN2RiMWJmYWI0ZjFiNzNkZmNkMWQ3YWU5OGVkNzA5Yzc4OGVkOGU5MTc0OTA5ZTA5NDU))
* [File an Issue](https://github.com/googleforgames/open-match/issues/new)
* [Mailing list](https://groups.google.com/forum/#!forum/open-match-discuss)

View File

@ -225,7 +225,6 @@
"assignments": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/openmatchAssignmentGroup"
},
"description": "Assignments is a list of assignment groups that contain assignment and the Tickets to which they should be applied."
@ -238,7 +237,6 @@
"failures": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/openmatchAssignmentFailure"
},
"description": "Failures is a list of all the Tickets that failed assignment along with the cause of failure."
@ -309,13 +307,6 @@
},
"description": "Customized information not inspected by Open Match, to be used by\nthe Match Function, evaluator, and components making calls to Open Match.\nOptional, depending on the requirements of the connected systems."
},
"persistent_field": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/protobufAny"
},
"description": "Customized information not inspected by Open Match, to be kept persistent \nthroughout the life-cycle of a backfill. \nOptional, depending on the requirements of the connected systems."
},
"create_time": {
"type": "string",
"format": "date-time",
@ -417,7 +408,6 @@
"tickets": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/openmatchTicket"
},
"description": "Tickets belonging to this match."
@ -450,7 +440,6 @@
"pools": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/openmatchPool"
},
"description": "Set of pools to be queried when generating a match for this MatchProfile."
@ -475,7 +464,6 @@
"double_range_filters": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/openmatchDoubleRangeFilter"
},
"description": "Set of Filters indicating the filtering criteria. Selected tickets must\nmatch every Filter."
@ -483,14 +471,12 @@
"string_equals_filters": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/openmatchStringEqualsFilter"
}
},
"tag_present_filters": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/openmatchTagPresentFilter"
}
},
@ -600,13 +586,6 @@
},
"description": "Customized information not inspected by Open Match, to be used by the match\nmaking function, evaluator, and components making calls to Open Match.\nOptional, depending on the requirements of the connected systems."
},
"persistent_field": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/protobufAny"
},
"description": "Customized information not inspected by Open Match, to be kept persistent \nthroughout the life-cycle of a ticket. \nOptional, depending on the requirements of the connected systems."
},
"create_time": {
"type": "string",
"format": "date-time",
@ -618,13 +597,17 @@
"protobufAny": {
"type": "object",
"properties": {
"@type": {
"type_url": {
"type": "string",
"description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics."
"description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics."
},
"value": {
"type": "string",
"format": "byte",
"description": "Must be a valid serialized protocol buffer of the above specified type."
}
},
"additionalProperties": {},
"description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\n Example 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\n Example 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }"
"description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n\n Example 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\n Example 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := ptypes.MarshalAny(foo)\n ...\n foo := \u0026pb.Foo{}\n if err := ptypes.UnmarshalAny(any, foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }"
},
"rpcStatus": {
"type": "object",
@ -641,7 +624,6 @@
"details": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/protobufAny"
},
"description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use."

View File

@ -116,13 +116,6 @@
},
"description": "Customized information not inspected by Open Match, to be used by\nthe Match Function, evaluator, and components making calls to Open Match.\nOptional, depending on the requirements of the connected systems."
},
"persistent_field": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/protobufAny"
},
"description": "Customized information not inspected by Open Match, to be kept persistent \nthroughout the life-cycle of a backfill. \nOptional, depending on the requirements of the connected systems."
},
"create_time": {
"type": "string",
"format": "date-time",
@ -172,7 +165,6 @@
"tickets": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/openmatchTicket"
},
"description": "Tickets belonging to this match."
@ -245,13 +237,6 @@
},
"description": "Customized information not inspected by Open Match, to be used by the match\nmaking function, evaluator, and components making calls to Open Match.\nOptional, depending on the requirements of the connected systems."
},
"persistent_field": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/protobufAny"
},
"description": "Customized information not inspected by Open Match, to be kept persistent \nthroughout the life-cycle of a ticket. \nOptional, depending on the requirements of the connected systems."
},
"create_time": {
"type": "string",
"format": "date-time",
@ -263,13 +248,17 @@
"protobufAny": {
"type": "object",
"properties": {
"@type": {
"type_url": {
"type": "string",
"description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics."
"description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics."
},
"value": {
"type": "string",
"format": "byte",
"description": "Must be a valid serialized protocol buffer of the above specified type."
}
},
"additionalProperties": {},
"description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\n Example 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\n Example 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }"
"description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n\n Example 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\n Example 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := ptypes.MarshalAny(foo)\n ...\n foo := \u0026pb.Foo{}\n if err := ptypes.UnmarshalAny(any, foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }"
},
"rpcStatus": {
"type": "object",
@ -286,7 +275,6 @@
"details": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/protobufAny"
},
"description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use."

View File

@ -91,16 +91,6 @@ message AcknowledgeBackfillRequest {
Assignment assignment = 2;
}
// BETA FEATURE WARNING: This Request message is not finalized and still subject
// to possible change or removal.
message AcknowledgeBackfillResponse {
// The Backfill that was acknowledged.
Backfill backfill = 1;
// All of the Tickets that were successfully assigned
repeated Ticket tickets = 2;
}
// BETA FEATURE WARNING: This Request message is not finalized and still subject
// to possible change or removal.
message CreateBackfillRequest {
@ -173,7 +163,7 @@ service FrontendService {
// This triggers an assignment process.
// BETA FEATURE WARNING: This call and the associated Request and Response
// messages are not finalized and still subject to possible change or removal.
rpc AcknowledgeBackfill(AcknowledgeBackfillRequest) returns (AcknowledgeBackfillResponse) {
rpc AcknowledgeBackfill(AcknowledgeBackfillRequest) returns (Backfill) {
option (google.api.http) = {
post: "/v1/frontendservice/backfills/{backfill_id}/acknowledge"
body: "*"

View File

@ -57,7 +57,6 @@
"parameters": [
{
"name": "body",
"description": "BETA FEATURE WARNING: This Request message is not finalized and still subject\nto possible change or removal.",
"in": "body",
"required": true,
"schema": {
@ -96,7 +95,6 @@
"parameters": [
{
"name": "body",
"description": "UpdateBackfillRequest - update searchFields, extensions and set assignment.\n\nBETA FEATURE WARNING: This Request message is not finalized and still subject\nto possible change or removal.",
"in": "body",
"required": true,
"schema": {
@ -154,7 +152,6 @@
"200": {
"description": "A successful response.",
"schema": {
"type": "object",
"properties": {}
}
},
@ -194,7 +191,7 @@
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/openmatchAcknowledgeBackfillResponse"
"$ref": "#/definitions/openmatchBackfill"
}
},
"404": {
@ -224,14 +221,7 @@
"in": "body",
"required": true,
"schema": {
"type": "object",
"properties": {
"assignment": {
"$ref": "#/definitions/openmatchAssignment",
"description": "An updated Assignment of the requested Backfill."
}
},
"description": "BETA FEATURE WARNING: This Request message is not finalized and still subject\nto possible change or removal."
"$ref": "#/definitions/openmatchAcknowledgeBackfillRequest"
}
}
],
@ -325,7 +315,6 @@
"200": {
"description": "A successful response.",
"schema": {
"type": "object",
"properties": {}
}
},
@ -407,20 +396,16 @@
}
},
"definitions": {
"openmatchAcknowledgeBackfillResponse": {
"openmatchAcknowledgeBackfillRequest": {
"type": "object",
"properties": {
"backfill": {
"$ref": "#/definitions/openmatchBackfill",
"description": "The Backfill that was acknowledged."
"backfill_id": {
"type": "string",
"description": "An existing ID of Backfill to acknowledge."
},
"tickets": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/openmatchTicket"
},
"title": "All of the Tickets that were successfully assigned"
"assignment": {
"$ref": "#/definitions/openmatchAssignment",
"description": "An updated Assignment of the requested Backfill."
}
},
"description": "BETA FEATURE WARNING: This Request message is not finalized and still subject\nto possible change or removal."
@ -460,13 +445,6 @@
},
"description": "Customized information not inspected by Open Match, to be used by\nthe Match Function, evaluator, and components making calls to Open Match.\nOptional, depending on the requirements of the connected systems."
},
"persistent_field": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/protobufAny"
},
"description": "Customized information not inspected by Open Match, to be kept persistent \nthroughout the life-cycle of a backfill. \nOptional, depending on the requirements of the connected systems."
},
"create_time": {
"type": "string",
"format": "date-time",
@ -549,13 +527,6 @@
},
"description": "Customized information not inspected by Open Match, to be used by the match\nmaking function, evaluator, and components making calls to Open Match.\nOptional, depending on the requirements of the connected systems."
},
"persistent_field": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/protobufAny"
},
"description": "Customized information not inspected by Open Match, to be kept persistent \nthroughout the life-cycle of a ticket. \nOptional, depending on the requirements of the connected systems."
},
"create_time": {
"type": "string",
"format": "date-time",
@ -586,13 +557,17 @@
"protobufAny": {
"type": "object",
"properties": {
"@type": {
"type_url": {
"type": "string",
"description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics."
"description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics."
},
"value": {
"type": "string",
"format": "byte",
"description": "Must be a valid serialized protocol buffer of the above specified type."
}
},
"additionalProperties": {},
"description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\n Example 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\n Example 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }"
"description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n\n Example 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\n Example 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := ptypes.MarshalAny(foo)\n ...\n foo := \u0026pb.Foo{}\n if err := ptypes.UnmarshalAny(any, foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }"
},
"rpcStatus": {
"type": "object",
@ -609,7 +584,6 @@
"details": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/protobufAny"
},
"description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use."

View File

@ -126,13 +126,6 @@
},
"description": "Customized information not inspected by Open Match, to be used by\nthe Match Function, evaluator, and components making calls to Open Match.\nOptional, depending on the requirements of the connected systems."
},
"persistent_field": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/protobufAny"
},
"description": "Customized information not inspected by Open Match, to be kept persistent \nthroughout the life-cycle of a backfill. \nOptional, depending on the requirements of the connected systems."
},
"create_time": {
"type": "string",
"format": "date-time",
@ -188,7 +181,6 @@
"tickets": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/openmatchTicket"
},
"description": "Tickets belonging to this match."
@ -221,7 +213,6 @@
"pools": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/openmatchPool"
},
"description": "Set of pools to be queried when generating a match for this MatchProfile."
@ -246,7 +237,6 @@
"double_range_filters": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/openmatchDoubleRangeFilter"
},
"description": "Set of Filters indicating the filtering criteria. Selected tickets must\nmatch every Filter."
@ -254,14 +244,12 @@
"string_equals_filters": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/openmatchStringEqualsFilter"
}
},
"tag_present_filters": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/openmatchTagPresentFilter"
}
},
@ -368,13 +356,6 @@
},
"description": "Customized information not inspected by Open Match, to be used by the match\nmaking function, evaluator, and components making calls to Open Match.\nOptional, depending on the requirements of the connected systems."
},
"persistent_field": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/protobufAny"
},
"description": "Customized information not inspected by Open Match, to be kept persistent \nthroughout the life-cycle of a ticket. \nOptional, depending on the requirements of the connected systems."
},
"create_time": {
"type": "string",
"format": "date-time",
@ -386,13 +367,17 @@
"protobufAny": {
"type": "object",
"properties": {
"@type": {
"type_url": {
"type": "string",
"description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics."
"description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics."
},
"value": {
"type": "string",
"format": "byte",
"description": "Must be a valid serialized protocol buffer of the above specified type."
}
},
"additionalProperties": {},
"description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\n Example 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\n Example 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }"
"description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n\n Example 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\n Example 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := ptypes.MarshalAny(foo)\n ...\n foo := \u0026pb.Foo{}\n if err := ptypes.UnmarshalAny(any, foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }"
},
"rpcStatus": {
"type": "object",
@ -409,7 +394,6 @@
"details": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/protobufAny"
},
"description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use."

View File

@ -45,14 +45,9 @@ message Ticket {
// Optional, depending on the requirements of the connected systems.
map<string, google.protobuf.Any> extensions = 5;
// Customized information not inspected by Open Match, to be kept persistent
// throughout the life-cycle of a ticket.
// Optional, depending on the requirements of the connected systems.
map<string, google.protobuf.Any> persistent_field = 6;
// Create time is the time the Ticket was created. It is populated by Open
// Match at the time of Ticket creation.
google.protobuf.Timestamp create_time = 7;
google.protobuf.Timestamp create_time = 6;
// Deprecated fields.
reserved 2;
@ -258,17 +253,12 @@ message Backfill {
// Optional, depending on the requirements of the connected systems.
map<string, google.protobuf.Any> extensions = 3;
// Customized information not inspected by Open Match, to be kept persistent
// throughout the life-cycle of a backfill.
// Optional, depending on the requirements of the connected systems.
map<string, google.protobuf.Any> persistent_field = 4;
// Create time is the time the Ticket was created. It is populated by Open
// Match at the time of Ticket creation.
google.protobuf.Timestamp create_time = 5;
google.protobuf.Timestamp create_time = 4;
// Generation gets incremented on GameServers update operations.
// Prevents the MMF from overriding a newer version from the game server.
// Do NOT read or write to this field, it is for internal tracking, and changing the value will cause bugs.
int64 generation = 6;
int64 generation = 5;
}

View File

@ -66,7 +66,6 @@
"parameters": [
{
"name": "body",
"description": "BETA FEATURE WARNING: This Request messages are not finalized and \nstill subject to possible change or removal.",
"in": "body",
"required": true,
"schema": {
@ -225,13 +224,6 @@
},
"description": "Customized information not inspected by Open Match, to be used by\nthe Match Function, evaluator, and components making calls to Open Match.\nOptional, depending on the requirements of the connected systems."
},
"persistent_field": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/protobufAny"
},
"description": "Customized information not inspected by Open Match, to be kept persistent \nthroughout the life-cycle of a backfill. \nOptional, depending on the requirements of the connected systems."
},
"create_time": {
"type": "string",
"format": "date-time",
@ -279,7 +271,6 @@
"double_range_filters": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/openmatchDoubleRangeFilter"
},
"description": "Set of Filters indicating the filtering criteria. Selected tickets must\nmatch every Filter."
@ -287,14 +278,12 @@
"string_equals_filters": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/openmatchStringEqualsFilter"
}
},
"tag_present_filters": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/openmatchTagPresentFilter"
}
},
@ -327,7 +316,6 @@
"backfills": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/openmatchBackfill"
},
"description": "Backfills that meet all the filtering criteria requested by the pool."
@ -371,7 +359,6 @@
"tickets": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/openmatchTicket"
},
"description": "Tickets that meet all the filtering criteria requested by the pool."
@ -450,13 +437,6 @@
},
"description": "Customized information not inspected by Open Match, to be used by the match\nmaking function, evaluator, and components making calls to Open Match.\nOptional, depending on the requirements of the connected systems."
},
"persistent_field": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/protobufAny"
},
"description": "Customized information not inspected by Open Match, to be kept persistent \nthroughout the life-cycle of a ticket. \nOptional, depending on the requirements of the connected systems."
},
"create_time": {
"type": "string",
"format": "date-time",
@ -468,13 +448,17 @@
"protobufAny": {
"type": "object",
"properties": {
"@type": {
"type_url": {
"type": "string",
"description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com. As of May 2023, there are no widely used type server\nimplementations and no plans to implement one.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics."
"description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics."
},
"value": {
"type": "string",
"format": "byte",
"description": "Must be a valid serialized protocol buffer of the above specified type."
}
},
"additionalProperties": {},
"description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\n Example 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\n Example 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }"
"description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n\n Example 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\n Example 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := ptypes.MarshalAny(foo)\n ...\n foo := \u0026pb.Foo{}\n if err := ptypes.UnmarshalAny(any, foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\n\nJSON\n====\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }"
},
"rpcStatus": {
"type": "object",
@ -491,7 +475,6 @@
"details": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/protobufAny"
},
"description": "A list of messages that carry the error details. There is a common set of\nmessage types for APIs to use."

View File

@ -16,9 +16,15 @@
# Open Match Script for Google Cloud Build #
################################################################################
# example command-line invocation:
# To run this locally:
# cloud-build-local --config=cloudbuild.yaml --dryrun=false --substitutions=_OM_VERSION=DEV .
# To run this remotely:
# gcloud builds submit --config=cloudbuild.yaml --substitutions=_OM_VERSION=DEV .
# Requires gcloud to be installed to work. (https://cloud.google.com/sdk/)
# gcloud auth login
# gcloud components install cloud-build-local
# This YAML contains all the build steps for building Open Match.
# All PRs are verified against this script to prevent build breakages and regressions.
@ -32,11 +38,8 @@
# Setup: Read-Write, similar to generate but steps that run before any other step.
# Some useful things to know about Cloud Build.
# When your build executes, Cloud Build copies the contents of your repository to /workspace, the default working directory for Cloud Build.
# Learn more about working directories on the Build configuration overview page https://cloud.google.com/build/docs/build-config-file-schema
# - Modifications that occur within /workspace are persisted between build steps.
# - If you want to replicate the build process from this file locally, you'll need to
# clone the open match github repo and set HEAD to the commit you're trying to build.
# The root of this repository is always stored in /workspace.
# Any modifications that occur within /workspace are persisted between builds anything else is forgotten.
# If a build step has intermediate files that need to be persisted for a future step then use volumes.
# An example of this is the go-vol which is where the pkg/ data for go mod is stored.
# More information here: https://cloud.google.com/cloud-build/docs/build-config#build_steps
@ -45,31 +48,23 @@
steps:
- id: 'Docker Image: open-match-build'
name: gcr.io/kaniko-project/executor:latest
args: [
"--destination=gcr.io/$PROJECT_ID/open-match-build",
"--dockerfile=Dockerfile.ci",
"--cache=true",
"--cache-ttl=3600h",
]
name: gcr.io/cloud-builders/docker
args: ['build', '-t', 'gcr.io/$PROJECT_ID/open-match-build', '-f', 'Dockerfile.ci', '.']
waitFor: ['-']
#name: gcr.io/cloud-builders/docker
#args: ['build', '-t', 'gcr.io/$PROJECT_ID/open-match-build', '-f', 'Dockerfile.ci', '.']
#waitFor: ['-']
- id: 'Build: Clean'
name: 'gcr.io/$PROJECT_ID/open-match-build'
args: ['make', 'clean-third-party', 'clean-protos', 'clean-swagger-docs']
waitFor: ['Docker Image: open-match-build']
- id: 'Test: Markdown'
name: 'gcr.io/$PROJECT_ID/open-match-build'
args: ['make', 'md-test']
waitFor: ['Build: Clean']
# - id: 'Test: Markdown'
# name: 'gcr.io/$PROJECT_ID/open-match-build'
# args: ['make', 'md-test']
# waitFor: ['Build: Clean']
- id: 'Setup: Clean Go Dependencies'
- id: 'Setup: Download Dependencies'
name: 'gcr.io/$PROJECT_ID/open-match-build'
args: ['make', 'clean-deps']
args: ['make', 'sync-deps']
volumes:
- name: 'go-vol'
path: '/go'
@ -81,33 +76,17 @@ steps:
volumes:
- name: 'go-vol'
path: '/go'
waitFor: ['Setup: Clean Go Dependencies']
- id: 'Build: Compile Protos'
name: 'gcr.io/$PROJECT_ID/open-match-build'
args: ['make', 'golang-protos']
volumes:
- name: 'go-vol'
path: '/go'
waitFor: ['Build: Initialize Toolchain']
- id: 'Setup: Download Go Dependencies'
name: 'gcr.io/$PROJECT_ID/open-match-build'
args: ['make', 'sync-deps']
volumes:
- name: 'go-vol'
path: '/go'
waitFor: ['Build: Compile Protos']
- id: 'Build: Deployment Configs'
name: 'gcr.io/$PROJECT_ID/open-match-build'
args: ['make', 'SHORT_SHA=${SHORT_SHA}', 'update-chart-deps', 'install/yaml/']
waitFor: ['Setup: Download Go Dependencies']
waitFor: ['Setup: Download Dependencies']
- id: 'Test: Terraform Configuration'
name: 'gcr.io/$PROJECT_ID/open-match-build'
args: ['make', 'terraform-test']
waitFor: ['Setup: Download Go Dependencies']
waitFor: ['Build: Initialize Toolchain']
- id: 'Build: Deployment Configs'
name: 'gcr.io/$PROJECT_ID/open-match-build'
args: ['make', 'SHORT_SHA=${SHORT_SHA}', 'update-chart-deps', 'install/yaml/']
waitFor: ['Build: Initialize Toolchain']
- id: 'Build: Assets'
name: 'gcr.io/$PROJECT_ID/open-match-build'
@ -119,7 +98,7 @@ steps:
- id: 'Build: Binaries'
name: 'gcr.io/$PROJECT_ID/open-match-build'
args: ['make', '_CHARTS_BUCKET=${_CHARTS_BUCKET}', 'build', 'all', '-j12']
args: ['make', 'GOPROXY=off', 'build', 'all', '-j12']
volumes:
- name: 'go-vol'
path: '/go'
@ -127,9 +106,7 @@ steps:
- id: 'Test: Services'
name: 'gcr.io/$PROJECT_ID/open-match-build'
args: ['make', 'GOLANG_TEST_COUNT=3', 'test']
# When debugging failing tests, enable verbose 'go test' output, run additional passes
#args: ['make', 'GOLANG_EXTRA_TEST_FLAGS=-v', 'GOLANG_TEST_COUNT=10', 'test']
args: ['make', 'GOLANG_TEST_COUNT=10', 'test']
volumes:
- name: 'go-vol'
path: '/go'
@ -176,19 +153,21 @@ steps:
artifacts:
objects:
location: '${_ARTIFACTS_BUCKET}${_OM_VERSION}'
location: '${_ARTIFACTS_BUCKET}'
paths:
- install/yaml/*.yaml
- pkg/pb/*.pb.go
- pkg/pb/*.pb.gw.go
- internal/ipb/*.pb.go
- api/*.swagger.json
- install/yaml/install.yaml
- install/yaml/01-open-match-core.yaml
- install/yaml/02-open-match-demo.yaml
- install/yaml/03-prometheus-chart.yaml
- install/yaml/04-grafana-chart.yaml
- install/yaml/05-jaeger-chart.yaml
- install/yaml/06-open-match-override-configmap.yaml
substitutions:
_OM_VERSION: "1.8.0"
_OM_VERSION: "1.2.0"
_GCB_POST_SUBMIT: "0"
_GCB_LATEST_VERSION: "undefined"
_ARTIFACTS_BUCKET: "gs://open-match-build-artifacts/"
_ARTIFACTS_BUCKET: "gs://open-match-build-artifacts/output/"
_LOGS_BUCKET: "gs://open-match-build-logs/"
_CHARTS_BUCKET: "gs://open-match-chart"
logsBucket: '${_LOGS_BUCKET}'

View File

@ -46,7 +46,7 @@ make
*Typically for contributing you'll want to
[create a fork](https://help.github.com/en/articles/fork-a-repo) and use that
but for purpose of this guide we'll be using the upstream/main.*
but for purpose of this guide we'll be using the upstream/master.*
## Building code and images

View File

@ -24,10 +24,10 @@ import (
"log"
"github.com/golang/protobuf/ptypes"
"github.com/golang/protobuf/ptypes/any"
"github.com/golang/protobuf/ptypes/wrappers"
"google.golang.org/grpc"
"google.golang.org/protobuf/types/known/anypb"
"google.golang.org/protobuf/types/known/timestamppb"
"google.golang.org/protobuf/types/known/wrapperspb"
"open-match.dev/open-match/pkg/matchfunction"
"open-match.dev/open-match/pkg/pb"
)
@ -243,7 +243,7 @@ func newBackfill(searchFields *pb.SearchFields, openSlots int) (*pb.Backfill, er
b := pb.Backfill{
SearchFields: searchFields,
Generation: 0,
CreateTime: timestamppb.Now(),
CreateTime: ptypes.TimestampNow(),
}
err := setOpenSlots(&b, int32(openSlots))
@ -264,10 +264,10 @@ func newMatch(num int, profile string, tickets []*pb.Ticket, b *pb.Backfill) pb.
func setOpenSlots(b *pb.Backfill, val int32) error {
if b.Extensions == nil {
b.Extensions = make(map[string]*anypb.Any)
b.Extensions = make(map[string]*any.Any)
}
any, err := anypb.New(&wrapperspb.Int32Value{Value: val})
any, err := ptypes.MarshalAny(&wrappers.Int32Value{Value: val})
if err != nil {
return err
}
@ -283,8 +283,8 @@ func getOpenSlots(b *pb.Backfill) (int32, error) {
if b.Extensions != nil {
if any, ok := b.Extensions[openSlotsKey]; ok {
var val wrapperspb.Int32Value
err := any.UnmarshalTo(&val)
var val wrappers.Int32Value
err := ptypes.UnmarshalAny(any, &val)
if err != nil {
return 0, err
}

View File

@ -4,7 +4,7 @@
// 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
// 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,
@ -16,9 +16,10 @@ package mmf
import (
"testing"
"github.com/golang/protobuf/ptypes"
"github.com/golang/protobuf/ptypes/any"
"github.com/golang/protobuf/ptypes/wrappers"
"github.com/stretchr/testify/require"
"google.golang.org/protobuf/types/known/anypb"
"google.golang.org/protobuf/types/known/wrapperspb"
"open-match.dev/open-match/pkg/pb"
)
@ -128,13 +129,13 @@ func TestMakeFullMatches(t *testing.T) {
}
func withOpenSlots(openSlots int) *pb.Backfill {
val, err := anypb.New(&wrapperspb.Int32Value{Value: int32(openSlots)})
val, err := ptypes.MarshalAny(&wrappers.Int32Value{Value: int32(openSlots)})
if err != nil {
panic(err)
}
return &pb.Backfill{
Extensions: map[string]*anypb.Any{
Extensions: map[string]*any.Any{
openSlotsKey: val,
},
}

View File

@ -19,8 +19,9 @@ import (
"io"
"time"
"google.golang.org/protobuf/types/known/anypb"
"google.golang.org/protobuf/types/known/wrapperspb"
"github.com/golang/protobuf/ptypes"
"github.com/golang/protobuf/ptypes/any"
"github.com/golang/protobuf/ptypes/wrappers"
"open-match.dev/open-match/pkg/pb"
)
@ -161,8 +162,8 @@ func getOpenSlots(b *pb.Backfill, defaultVal int) int {
return defaultVal
}
var val wrapperspb.Int32Value
err := any.UnmarshalTo(&val)
var val wrappers.Int32Value
err := ptypes.UnmarshalAny(any, &val)
if err != nil {
panic(err)
}
@ -172,10 +173,10 @@ func getOpenSlots(b *pb.Backfill, defaultVal int) int {
func setOpenSlots(b *pb.Backfill, val int) {
if b.Extensions == nil {
b.Extensions = make(map[string]*anypb.Any)
b.Extensions = make(map[string]*any.Any)
}
any, err := anypb.New(&wrapperspb.Int32Value{Value: int32(val)})
any, err := ptypes.MarshalAny(&wrappers.Int32Value{Value: int32(val)})
if err != nil {
panic(err)
}

View File

@ -18,13 +18,10 @@
// arguments used:
// mode: The game mode the players wants to play in. mode is a hard partition.
// regions: Players may have good latency to one or more regions. A player will
//
// search for matches in all eligible regions.
//
// search for matches in all eligible regions.
// skill: Players have a random skill based on a normal distribution. Players
//
// will only be matched with other players who have a close skill value. The
// match functions have overlapping partitions of the skill brackets.
// will only be matched with other players who have a close skill value. The
// match functions have overlapping partitions of the skill brackets.
package teamshooter
import (
@ -35,8 +32,9 @@ import (
"sort"
"time"
"google.golang.org/protobuf/types/known/anypb"
"google.golang.org/protobuf/types/known/wrapperspb"
"github.com/golang/protobuf/ptypes"
"github.com/golang/protobuf/ptypes/any"
"github.com/golang/protobuf/ptypes/wrappers"
"open-match.dev/open-match/pkg/pb"
)
@ -267,9 +265,9 @@ type matchExt struct {
}
func unpackMatch(m *pb.Match) (*matchExt, error) {
v := &wrapperspb.DoubleValue{}
v := &wrappers.DoubleValue{}
err := m.Extensions["quality"].UnmarshalTo(v)
err := ptypes.UnmarshalAny(m.Extensions["quality"], v)
if err != nil {
return nil, fmt.Errorf("Error unpacking match quality: %w", err)
}
@ -284,9 +282,9 @@ func unpackMatch(m *pb.Match) (*matchExt, error) {
}
func (m *matchExt) pack() (*pb.Match, error) {
v := &wrapperspb.DoubleValue{Value: m.quality}
v := &wrappers.DoubleValue{Value: m.quality}
a, err := anypb.New(v)
a, err := ptypes.MarshalAny(v)
if err != nil {
return nil, fmt.Errorf("Error packing match quality: %w", err)
}
@ -296,7 +294,7 @@ func (m *matchExt) pack() (*pb.Match, error) {
Tickets: m.tickets,
MatchProfile: m.matchProfile,
MatchFunction: m.matchFunction,
Extensions: map[string]*anypb.Any{
Extensions: map[string]*any.Any{
"quality": a,
},
}, nil

146
go.mod
View File

@ -15,124 +15,52 @@ module open-match.dev/open-match
// limitations under the License.
// When updating Go version, update Dockerfile.ci, Dockerfile.base-build, and go.mod
go 1.21
go 1.14
require (
contrib.go.opencensus.io/exporter/jaeger v0.2.1
contrib.go.opencensus.io/exporter/ocagent v0.7.0
contrib.go.opencensus.io/exporter/prometheus v0.4.2
contrib.go.opencensus.io/exporter/stackdriver v0.13.14
contrib.go.opencensus.io/exporter/prometheus v0.2.0
contrib.go.opencensus.io/exporter/stackdriver v0.13.4
github.com/Bose/minisentinel v0.0.0-20200130220412-917c5a9223bb
github.com/TV4/logrus-stackdriver-formatter v0.1.0
github.com/alicebob/miniredis/v2 v2.30.5
github.com/alicebob/miniredis/v2 v2.14.1
github.com/aws/aws-sdk-go v1.35.26 // indirect
github.com/cenkalti/backoff v2.2.1+incompatible
github.com/fsnotify/fsnotify v1.6.0
github.com/go-redsync/redsync/v4 v4.8.1
github.com/golang/protobuf v1.5.3
github.com/fsnotify/fsnotify v1.4.9
github.com/go-redsync/redsync/v4 v4.0.3
github.com/gogo/protobuf v1.3.1 // indirect
github.com/golang/protobuf v1.4.3
github.com/gomodule/redigo v2.0.1-0.20191111085604-09d84710e01a+incompatible
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0
github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.2
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.16.0
github.com/rs/xid v1.5.0
github.com/sirupsen/logrus v1.9.3
github.com/spf13/viper v1.16.0
github.com/stretchr/testify v1.8.4
go.opencensus.io v0.24.0
golang.org/x/net v0.14.0
golang.org/x/sync v0.3.0
google.golang.org/genproto v0.0.0-20230815205213-6bfd019c3878 // indirect
google.golang.org/grpc v1.57.0
google.golang.org/protobuf v1.31.0
k8s.io/api v0.28.0 // kubernetes-1.14.10
k8s.io/apimachinery v0.28.0
k8s.io/client-go v0.28.0
)
require (
google.golang.org/genproto/googleapis/api v0.0.0-20230815205213-6bfd019c3878
google.golang.org/genproto/googleapis/rpc v0.0.0-20230815205213-6bfd019c3878
)
require (
cloud.google.com/go/compute v1.23.0 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go/monitoring v1.15.1 // indirect
cloud.google.com/go/trace v1.10.1 // indirect
github.com/Masterminds/semver v1.4.2 // indirect
github.com/Masterminds/sprig v2.15.0+incompatible // indirect
github.com/alicebob/gopher-json v0.0.0-20230218143504-906a9b012302 // indirect
github.com/aokoli/goutils v1.0.1 // indirect
github.com/aws/aws-sdk-go v1.44.324 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/census-instrumentation/opencensus-proto v0.4.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/emicklei/go-restful/v3 v3.10.2 // indirect
github.com/envoyproxy/protoc-gen-validate v1.0.2 // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.6.0 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-openapi/jsonpointer v0.20.0 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.4 // indirect
github.com/go-stack/stack v1.8.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/s2a-go v0.1.5 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.5 // indirect
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
github.com/googleapis/gnostic v0.3.1 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.2.2
github.com/grpc-ecosystem/grpc-gateway/v2 v2.3.0
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/huandu/xstrings v1.0.0 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/mwitkow/go-proto-validators v0.0.0-20180403085117-0950a7990007 // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/pelletier/go-toml/v2 v2.0.9 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/prometheus/client_model v0.4.0 // indirect
github.com/prometheus/common v0.44.0 // indirect
github.com/prometheus/procfs v0.11.1 // indirect
github.com/prometheus/prometheus v0.46.0 // indirect
github.com/prometheus/statsd_exporter v0.24.0 // indirect
github.com/pseudomuto/protoc-gen-doc v1.5.1 // indirect
github.com/pseudomuto/protokit v0.2.0 // indirect
github.com/spf13/afero v1.9.5 // indirect
github.com/spf13/cast v1.5.1 // indirect
github.com/imdario/mergo v0.3.11 // indirect
github.com/pelletier/go-toml v1.8.1 // indirect
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.8.0
github.com/pseudomuto/protoc-gen-doc v1.4.1 // indirect
github.com/rs/xid v1.2.1
github.com/sirupsen/logrus v1.7.0
github.com/spf13/afero v1.4.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/yuin/gopher-lua v1.1.0 // indirect
golang.org/x/crypto v0.12.0 // indirect
golang.org/x/oauth2 v0.11.0 // indirect
golang.org/x/sys v0.11.0 // indirect
golang.org/x/term v0.11.0 // indirect
golang.org/x/text v0.12.0 // indirect
golang.org/x/time v0.3.0 // indirect
google.golang.org/api v0.137.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
github.com/spf13/viper v1.7.1
github.com/stretchr/testify v1.7.0
go.opencensus.io v0.23.0
golang.org/x/net v0.0.0-20210224082022-3d97a244fca7
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9
golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073 // indirect
google.golang.org/api v0.35.0 // indirect
google.golang.org/genproto v0.0.0-20210224155714-063164c882e6
google.golang.org/grpc v1.36.0
google.golang.org/protobuf v1.25.1-0.20201208041424-160c7477e0e8
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/klog/v2 v2.100.1 // indirect
k8s.io/kube-openapi v0.0.0-20230811205723-7ac0aad8c58d // indirect
k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.3.0 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
k8s.io/api v0.0.0-20191004102349-159aefb8556b // kubernetes-1.14.10
k8s.io/apimachinery v0.0.0-20191004074956-c5d2f014d689 // kubernetes-1.14.10
k8s.io/client-go v11.0.1-0.20191029005444-8e4128053008+incompatible // kubernetes-1.14.10
k8s.io/klog v1.0.0 // indirect
k8s.io/utils v0.0.0-20200729134348-d5654de09c73 // indirect
sigs.k8s.io/yaml v1.2.0 // indirect
)

774
go.sum

File diff suppressed because it is too large Load Diff

View File

@ -5,7 +5,7 @@ Templates under the `templates/` directory are for the core components in Open M
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.
2. `open-match-telemetry` contains monitoring supports for Open Match, you may choose to enable/disable [prometheus](http://prometheus.io "prometheus"), [stackdriver](https://cloud.google.com/stackdriver/ "stackdriver"), and [grafana](https://grafana.com/ "grafana") by overriding the config values in the provided templates.
2. `open-match-telemetry` contains monitoring supports for Open Match, you may choose to enable/disable [jaeger](https://www.jaegertracing.io/ "jaeger"), [prometheus](http://prometheus.io "prometheus"), [stackdriver](https://cloud.google.com/stackdriver/ "stackdriver"), and [grafana](https://grafana.com/ "grafana") by overriding the config values in the provided templates.
You may control the behavior of Open Match by overriding the configs in `install/helm/open-match/values.yaml` file. Here are a few examples:
@ -26,7 +26,7 @@ swaggerui:
global:
kubernetes:
service:
- portType: ClusterIP
- portType: ClusterIP
+ portType: LoadBalancer
# Enables grafana support in Open Match

View File

@ -13,12 +13,12 @@
# limitations under the License.
apiVersion: v2
appVersion: "1.8.0"
version: 1.8.0
appVersion: "1.2.0"
version: 1.2.0
name: open-match
dependencies:
- name: redis
version: 17.15.4
version: 12.3.3
repository: https://charts.bitnami.com/bitnami
condition: open-match-core.redis.enabled
- name: open-match-telemetry

View File

@ -54,7 +54,7 @@ spec:
apiVersion: apps/v1
kind: Deployment
name: {{ include "openmatch.evaluator.hostName" . }}
{{- include "openmatch.HorizontalPodAutoscaler.evaluator.spec.common" . | nindent 2 }}
{{- include "openmatch.HorizontalPodAutoscaler.spec.common" . | nindent 2 }}
---
apiVersion: apps/v1
kind: Deployment

View File

@ -54,7 +54,7 @@ spec:
apiVersion: apps/v1
kind: Deployment
name: {{ include "openmatchcustomize.function.hostName" . }}
{{- include "openmatch.HorizontalPodAutoscaler.matchfunction.spec.common" . | nindent 2 }}
{{- include "openmatch.HorizontalPodAutoscaler.spec.common" . | nindent 2 }}
---
apiVersion: apps/v1
kind: Deployment

View File

@ -31,7 +31,7 @@ spec:
protocol: TCP
port: {{ .Values.scaleFrontend.httpPort }}
---
apiVersion: apps/v1
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: {{ include "openmatchscale.scaleFrontend.hostName" . }}

View File

@ -19,10 +19,15 @@ name: open-match-telemetry
version: 0.0.0-dev
dependencies:
- name: prometheus
version: 15.8.7
repository: https://prometheus-community.github.io/helm-charts
version: 9.2.0
repository: https://charts.helm.sh/stable
condition: global.telemetry.prometheus.enabled,prometheus.enabled
- name: grafana
version: 6.29.3
repository: https://grafana.github.io/helm-charts
version: 4.0.1
repository: https://charts.helm.sh/stable
condition: global.telemetry.grafana.enabled,grafana.enabled
- name: jaeger
version: 0.13.3
repository: https://charts.helm.sh/stable
condition: global.telemetry.jaeger.enabled,jaeger.enabled

View File

@ -13,20 +13,12 @@
# limitations under the License.
{{- if .Values.global.telemetry.grafana.enabled }}
{{- $om := (include "openmatch.fullname" .) }}
{{ $c := 1 | int }}
{{- range $path, $bytes := .Files.Glob "dashboards/*.json" }}
{{- $ext := ext $path }}
{{- $file := base $path }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ printf "%s-%s-dashboard" $om ((printf "%s" $file) | replace $ext "") }}
name: {{ include "openmatch.fullname" . }}-dashboards
labels:
grafana_dashboard: {{ printf "d-%d" $c }}
grafana_dashboard: "1"
data:
{{- ($.Files.Glob (printf "dashboards/%s" $file)).AsConfig | nindent 2 }}
---
{{ $c = add1 $c }}
{{- end }}
{{- (.Files.Glob "dashboards/*.json").AsConfig | nindent 2 }}
{{- end }}

View File

@ -146,3 +146,23 @@ grafana:
datasources:
enabled: true
plugins: grafana-piechart-panel
jaeger:
enabled: true
# Configs for the cassandra schema job
schema:
pullPolicy: Always
mode: prod
activeDeadlineSeconds: 200
cassandra:
image:
tag: latest
config:
cluster_size: 2
resources:
requests:
memory: 4Gi
cpu: 2
limits:
memory: 4Gi
cpu: 2

View File

@ -102,17 +102,17 @@ resources:
{{- end -}}
{{- define "openmatch.volumemounts.withredis" -}}
{{- if .Values.redis.auth.enabled }}
{{- if .Values.redis.usePassword }}
- name: redis-password
mountPath: {{ .Values.redis.secretMountPath }}
{{- end -}}
{{- end -}}
{{- define "openmatch.volumes.withredis" -}}
{{- if .Values.redis.auth.enabled }}
{{- if .Values.redis.usePassword }}
- name: redis-password
secret:
secretName: {{ include "call-nested" (list . "redis" "common.names.fullname") }}
secretName: {{ include "call-nested" (list . "redis" "redis.fullname") }}
{{- end -}}
{{- end -}}
@ -150,46 +150,16 @@ readinessProbe:
failureThreshold: 2
{{- end -}}
{{- define "openmatch.HorizontalPodAutoscaler.frontend.spec.common" -}}
minReplicas: {{ .Values.global.kubernetes.horizontalPodAutoScaler.frontend.minReplicas }}
maxReplicas: {{ .Values.global.kubernetes.horizontalPodAutoScaler.frontend.maxReplicas }}
targetCPUUtilizationPercentage: {{ .Values.global.kubernetes.horizontalPodAutoScaler.frontend.targetCPUUtilizationPercentage }}
{{- end -}}
{{- define "openmatch.HorizontalPodAutoscaler.backend.spec.common" -}}
minReplicas: {{ .Values.global.kubernetes.horizontalPodAutoScaler.backend.minReplicas }}
maxReplicas: {{ .Values.global.kubernetes.horizontalPodAutoScaler.backend.maxReplicas }}
targetCPUUtilizationPercentage: {{ .Values.global.kubernetes.horizontalPodAutoScaler.backend.targetCPUUtilizationPercentage }}
{{- end -}}
{{- define "openmatch.HorizontalPodAutoscaler.query.spec.common" -}}
minReplicas: {{ .Values.global.kubernetes.horizontalPodAutoScaler.query.minReplicas }}
maxReplicas: {{ .Values.global.kubernetes.horizontalPodAutoScaler.query.maxReplicas }}
targetCPUUtilizationPercentage: {{ .Values.global.kubernetes.horizontalPodAutoScaler.query.targetCPUUtilizationPercentage }}
{{- end -}}
{{- define "openmatch.HorizontalPodAutoscaler.evaluator.spec.common" -}}
minReplicas: {{ .Values.global.kubernetes.horizontalPodAutoScaler.evaluator.minReplicas }}
maxReplicas: {{ .Values.global.kubernetes.horizontalPodAutoScaler.evaluator.maxReplicas }}
targetCPUUtilizationPercentage: {{ .Values.global.kubernetes.horizontalPodAutoScaler.evaluator.targetCPUUtilizationPercentage }}
{{- end -}}
{{- define "openmatch.HorizontalPodAutoscaler.matchfunction.spec.common" -}}
minReplicas: {{ .Values.global.kubernetes.horizontalPodAutoScaler.matchfunction.minReplicas }}
maxReplicas: {{ .Values.global.kubernetes.horizontalPodAutoScaler.matchfunction.maxReplicas }}
targetCPUUtilizationPercentage: {{ .Values.global.kubernetes.horizontalPodAutoScaler.matchfunction.targetCPUUtilizationPercentage }}
{{- define "openmatch.HorizontalPodAutoscaler.spec.common" -}}
minReplicas: {{ .Values.global.kubernetes.horizontalPodAutoScaler.minReplicas }}
maxReplicas: {{ .Values.global.kubernetes.horizontalPodAutoScaler.maxReplicas }}
targetCPUUtilizationPercentage: {{ .Values.global.kubernetes.horizontalPodAutoScaler.targetCPUUtilizationPercentage }}
{{- end -}}
{{- define "openmatch.serviceAccount.name" -}}
{{- .Values.global.kubernetes.serviceAccount | default (printf "%s-unprivileged-service" (include "openmatch.fullname" . ) ) -}}
{{- end -}}
{{- define "openmatch.serviceAccountAnnotations" -}}
{{- if .Values.global.kubernetes.serviceAccountAnnotations -}}
{{- toYaml (.Values.global.kubernetes.serviceAccountAnnotations) | nindent 4 -}}
{{- end -}}
{{- end -}}
{{- define "openmatch.swaggerui.hostName" -}}
{{- .Values.swaggerui.hostName | default (printf "%s-swaggerui" (include "openmatch.fullname" . ) ) -}}
{{- end -}}
@ -222,9 +192,25 @@ targetCPUUtilizationPercentage: {{ .Values.global.kubernetes.horizontalPodAutoSc
{{- printf "%s-configmap-override" (include "openmatch.fullname" . ) -}}
{{- end -}}
{{- define "openmatch.jaeger.agent" -}}
{{- if index .Values "open-match-telemetry" "enabled" -}}
{{- if index .Values "open-match-telemetry" "jaeger" "enabled" -}}
{{ include "call-nested" (list . "open-match-telemetry.jaeger" "jaeger.agent.name") }}:6831
{{- end -}}
{{- end -}}
{{- end -}}
{{- define "openmatch.jaeger.collector" -}}
{{- if index .Values "open-match-telemetry" "enabled" -}}
{{- if index .Values "open-match-telemetry" "jaeger" "enabled" -}}
http://{{ include "call-nested" (list . "open-match-telemetry.jaeger" "jaeger.collector.name") }}:14268/api/traces
{{- end -}}
{{- end -}}
{{- end -}}
{{/*
Call templates from sub-charts in a synthesized context, workaround for https://github.com/helm/helm/issues/3920
Mainly useful for things like `{{ include "call-nested" (list . "redis" "common.names.fullname") }}`
Mainly useful for things like `{{ include "call-nested" (list . "redis" "redis.fullname") }}`
https://github.com/helm/helm/issues/4535#issuecomment-416022809
https://github.com/helm/helm/issues/4535#issuecomment-477778391
*/}}
@ -237,4 +223,4 @@ https://github.com/helm/helm/issues/4535#issuecomment-477778391
{{- $values = index $values . }}
{{- end }}
{{- include $template (dict "Chart" (dict "Name" (last $subchart)) "Values" $values "Release" $dot.Release "Capabilities" $dot.Capabilities) }}
{{- end }}
{{- end }}

View File

@ -51,7 +51,7 @@ spec:
apiVersion: apps/v1
kind: Deployment
name: {{ include "openmatch.backend.hostName" . }}
{{- include "openmatch.HorizontalPodAutoscaler.backend.spec.common" . | nindent 2 }}
{{- include "openmatch.HorizontalPodAutoscaler.spec.common" . | nindent 2 }}
---
apiVersion: apps/v1
kind: Deployment

View File

@ -51,7 +51,7 @@ spec:
apiVersion: apps/v1
kind: Deployment
name: {{ include "openmatch.frontend.hostName" . }}
{{- include "openmatch.HorizontalPodAutoscaler.frontend.spec.common" . | nindent 2 }}
{{- include "openmatch.HorizontalPodAutoscaler.spec.common" . | nindent 2 }}
---
apiVersion: apps/v1
kind: Deployment

View File

@ -26,11 +26,7 @@ metadata:
data:
matchmaker_config_default.yaml: |-
logging:
{{- if .Values.global.logging.level }}
level: {{ .Values.global.logging.level }}
{{- else }}
level: debug
{{- end }}
{{- if .Values.global.telemetry.stackdriverMetrics.enabled }}
format: stackdriver
{{- else }}
@ -94,25 +90,13 @@ data:
{{- if index .Values "redis" "sentinel" "enabled"}}
sentinelPort: {{ .Values.redis.sentinel.port }}
sentinelMaster: {{ .Values.redis.sentinel.masterSet }}
sentinelHostname: {{ include "call-nested" (list . "redis" "common.names.fullname") }}
sentinelHostname: {{ include "call-nested" (list . "redis" "redis.fullname") }}
sentinelUsePassword: {{ .Values.redis.sentinel.usePassword }}
{{- else}}
# Open Match's default Redis setups
hostname: {{ include "call-nested" (list . "redis" "common.names.fullname") }}-master.{{ .Release.Namespace }}.svc.cluster.local
{{- if .Values.redis.redisPort }}
# source value: redis.redisPort = {{ .Values.redis.redisPort }}
hostname: {{ include "call-nested" (list . "redis" "redis.fullname") }}-master.{{ .Release.Namespace }}.svc.cluster.local
port: {{ .Values.redis.redisPort }}
{{- else if index .Values "open-match-core" "redis" "port" }}
# source value: open-match-core.redis.port = {{ index .Values "open-match-core" "redis" "port"}}
port: {{ index .Values "open-match-core" "redis" "port" }}
{{- end }}
{{- if .Values.redis.user }}
# source value: redis.user = {{ .Values.redis.user }}
user: {{ .Values.redis.user }}
{{- else if index .Values "open-match-core" "redis" "user" }}
# source value: open-match-core.redis.user = {{ index .Values "open-match-core" "redis" "user"}}
user: {{ index .Values "open-match-core" "redis" "user"}}
{{- end }}
{{- end}}
{{- else }}
# BYO Redis setups
@ -120,7 +104,7 @@ data:
port: {{ index .Values "open-match-core" "redis" "port" }}
user: {{ index .Values "open-match-core" "redis" "user" }}
{{- end }}
usePassword: {{ .Values.redis.auth.enabled }}
usePassword: {{ .Values.redis.usePassword }}
passwordPath: {{ .Values.redis.secretMountPath }}/redis-password
pool:
maxIdle: {{ index .Values "open-match-core" "redis" "pool" "maxIdle" }}
@ -133,6 +117,15 @@ data:
traceSamplingFraction: "{{ .Values.global.telemetry.traceSamplingFraction }}"
zpages:
enable: "{{ .Values.global.telemetry.zpages.enabled }}"
jaeger:
enable: "{{ .Values.global.telemetry.jaeger.enabled }}"
{{- if .Values.global.telemetry.jaeger.enabled }}
agentEndpoint: "{{ tpl .Values.global.telemetry.jaeger.agentEndpoint . }}"
collectorEndpoint: "{{ tpl .Values.global.telemetry.jaeger.collectorEndpoint . }}"
{{- else }}
agentEndpoint: ""
collectorEndpoint: ""
{{- end }}
prometheus:
enable: "{{ .Values.global.telemetry.prometheus.enabled }}"
endpoint: "{{ .Values.global.telemetry.prometheus.endpoint }}"

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
{{- if index .Values "open-match-override" "enabled" }}
{{- if index .Values "open-match-override" }}
apiVersion: v1
kind: ConfigMap
metadata:

View File

@ -0,0 +1,140 @@
# 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.
{{- if index .Values "open-match-core" "enabled" }}
{{- if empty .Values.ci }}
# This is the least restricted PSP used to create privileged pods to disable THP in host kernel.
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
name: {{ include "openmatch.fullname" . }}-redis-podsecuritypolicy
namespace: {{ .Release.Namespace }}
annotations:
{{- include "openmatch.chartmeta" . | nindent 4 }}
seccomp.security.alpha.kubernetes.io/allowedProfileNames: '*'
labels:
app: {{ template "openmatch.name" . }}
release: {{ .Release.Name }}
spec:
privileged: true
allowPrivilegeEscalation: true
allowedCapabilities:
- '*'
volumes:
- '*'
hostNetwork: true
hostPorts:
# Redis
- min: 6379
max: 6379
- min: 9121
max: 9121
hostIPC: true
hostPID: true
runAsUser:
rule: 'RunAsAny'
seLinux:
rule: 'RunAsAny'
supplementalGroups:
rule: 'RunAsAny'
fsGroup:
rule: 'RunAsAny'
---
# This does not allow creating privileged pods and restrict binded pods to use the specified port ranges.
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
name: {{ include "openmatch.fullname" . }}-core-podsecuritypolicy
namespace: {{ .Release.Namespace }}
annotations: {{- include "openmatch.chartmeta" . | nindent 4 }}
labels:
app: {{ template "openmatch.name" . }}
release: {{ .Release.Name }}
spec:
allowPrivilegeEscalation: false
defaultAllowPrivilegeEscalation: false
forbiddenSysctls:
- "*"
fsGroup:
rule: "MustRunAs"
ranges:
- min: 1
max: 65535
hostIPC: false
hostNetwork: false
hostPID: false
hostPorts:
# Open Match Services
- min: 50500
max: 50510
- min: 51500
max: 51510
# Cassandra
- min: 7000
max: 7001
- min: 7199
max: 7199
- min: 9042
max: 9042
- min: 9160
max: 9160
# Grafana
- min: 3000
max: 3000
# Jaeger
- min: 5775
max: 5778
- min: 6831
max: 6832
- min: 14267
max: 14268
- min: 9411
max: 9411
- min: 16686
max: 16686
# Prometheus
- min: 9090
max: 9093
- min: 9100
max: 9100
- min: 8080
max: 8080
privileged: false # Prevents creation of privileged Pods
readOnlyRootFilesystem: false
# Capabilities Reference: https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities
# TODO: Open Match itself doesn't need any capabilties but its dependencies do. We should split out the service accounts later.
allowedCapabilities:
- CHOWN
#requiredDropCapabilities:
#- ALL
runAsUser:
rule: "RunAsAny"
# Blocked on isolating the open match services from dependencies (Redis, Prometheus, etc.)
# Require the container to run without root privileges.
#rule: 'MustRunAsNonRoot'
seLinux:
# This policy assumes the nodes are using AppArmor rather than SELinux.
rule: 'RunAsAny'
supplementalGroups:
rule: RunAsAny
volumes:
- 'configMap'
- 'emptyDir'
- 'projected'
- 'secret'
- 'downwardAPI'
# Assume that persistentVolumes set up by the cluster admin are safe to use.
- 'persistentVolumeClaim'
{{- end }}
{{- end }}

View File

@ -51,7 +51,7 @@ spec:
apiVersion: apps/v1
kind: Deployment
name: {{ include "openmatch.query.hostName" . }}
{{- include "openmatch.HorizontalPodAutoscaler.query.spec.common" . | nindent 2 }}
{{- include "openmatch.HorizontalPodAutoscaler.spec.common" . | nindent 2 }}
---
apiVersion: apps/v1
kind: Deployment

View File

@ -23,8 +23,6 @@ metadata:
labels:
app: {{ template "openmatch.name" . }}
release: {{ .Release.Name }}
pod-security.kubernetes.io/enforce: baseline
pod-security.kubernetes.io/warn: baseline
{{- end }}
---
# Create a universal service account for open-match-core services.
@ -33,12 +31,85 @@ kind: ServiceAccount
metadata:
name: {{ include "openmatch.serviceAccount.name" . }}
namespace: {{ .Release.Namespace }}
annotations:
{{- include "openmatch.chartmeta" . | nindent 4 }}
{{- include "openmatch.serviceAccountAnnotations" . }}
annotations: {{- include "openmatch.chartmeta" . | nindent 4 }}
labels:
app: {{ template "openmatch.name" . }}
release: {{ .Release.Name }}
automountServiceAccountToken: true
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ include "openmatch.fullname" . }}-service-role
namespace: {{ .Release.Namespace }}
annotations: {{- include "openmatch.chartmeta" . | nindent 4 }}
labels:
app: {{ template "openmatch.name" . }}
release: {{ .Release.Name }}
rules:
- apiGroups:
- extensions
resources:
- podsecuritypolicies
resourceNames:
- {{ include "openmatch.fullname" . }}-core-podsecuritypolicy
verbs:
- use
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ include "openmatch.fullname" . }}-service-role-binding
namespace: {{ .Release.Namespace }}
annotations: {{- include "openmatch.chartmeta" . | nindent 4 }}
labels:
app: {{ template "openmatch.name" . }}
release: {{ .Release.Name }}
subjects:
- kind: Group
name: system:authenticated # All authenticated users
apiGroup: rbac.authorization.k8s.io
roleRef:
kind: Role
name: {{ include "openmatch.fullname" . }}-service-role
apiGroup: rbac.authorization.k8s.io
---
{{- if index .Values "open-match-core" "redis" "enabled" }}
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ include "openmatch.fullname" . }}-redis-role
namespace: {{ .Release.Namespace }}
annotations: {{- include "openmatch.chartmeta" . | nindent 4 }}
labels:
app: {{ template "openmatch.name" . }}
release: {{ .Release.Name }}
rules:
- apiGroups:
- extensions
resources:
- podsecuritypolicies
resourceNames:
- {{ include "openmatch.fullname" . }}-redis-podsecuritypolicy
verbs:
- use
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ include "openmatch.fullname" . }}-redis-role-binding
namespace: {{ .Release.Namespace }}
annotations: {{- include "openmatch.chartmeta" . | nindent 4 }}
labels:
app: {{ template "openmatch.name" . }}
release: {{ .Release.Name }}
subjects:
- kind: ServiceAccount
name: {{ include "call-nested" (list . "redis" "redis.serviceAccountName") }}
namespace: {{ .Release.Namespace }}
roleRef:
kind: Role
name: {{ include "openmatch.fullname" . }}-redis-role
apiGroup: rbac.authorization.k8s.io
{{- end }}
{{- end }}

View File

@ -24,6 +24,14 @@ metadata:
app: {{ template "openmatch.name" . }}
release: {{ .Release.Name }}
rules:
- apiGroups:
- extensions
resources:
- podsecuritypolicies
resourceNames:
- {{ include "openmatch.fullname" . }}-core-podsecuritypolicy
verbs:
- use
# Grant this role get & list permission for k8s endpoints and pods resources
# Required for e2e in-cluster testing.
- apiGroups:

View File

@ -91,7 +91,7 @@ spec:
command: ["go"]
args:
- "test"
- "./testing/e2e"
- "./internal/testing/e2e"
- "-v"
- "-timeout"
- "150s"

View File

@ -106,12 +106,17 @@ configs:
# https://hub.helm.sh/charts/stable/redis
# https://github.com/helm/charts/tree/master/stable/redis
redis:
architecture: standalone
auth:
enabled: false
redisPort: 6379
usePassword: false
usePasswordFile: false
secretMountPath: /opt/bitnami/redis/secrets
configmap: |
maxclients 100000
maxmemory 500000000
sentinel:
enabled: true
masterSet: om-redis-master
port: 26379
master:
disableCommands: [] # don't disable 'FLUSH-' commands
resources:
@ -125,6 +130,20 @@ redis:
enabled: false
metrics:
enabled: true
cluster:
slaveCount: 3
serviceAccount:
create: true
slave:
persistence:
enabled: false
resources:
requests:
memory: 1Gi
cpu: 1
limits:
memory: 2Gi
cpu: 2
sysctlImage:
# Enable this setting in production if you are running Open Match under Linux environment
enabled: true
@ -209,10 +228,6 @@ open-match-customize:
# function:
# image: [YOUR_MMF_IMAGE]
# Controls if users need to install open-match-override ConfigMap.
open-match-override:
enabled: false
# Global configurations that are visible to all subcharts
global:
kubernetes:
@ -223,26 +238,9 @@ global:
# https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
affinity: {}
horizontalPodAutoScaler:
frontend:
minReplicas: 3
maxReplicas: 10
targetCPUUtilizationPercentage: 60
backend:
minReplicas: 3
maxReplicas: 10
targetCPUUtilizationPercentage: 60
query:
minReplicas: 5
maxReplicas: 10
targetCPUUtilizationPercentage: 60
evaluator:
minReplicas: 3
maxReplicas: 10
targetCPUUtilizationPercentage: 60
matchfunction:
minReplicas: 3
maxReplicas: 10
targetCPUUtilizationPercentage: 60
minReplicas: 3
maxReplicas: 10
targetCPUUtilizationPercentage: 60
resources:
requests:
memory: 1.5Gi
@ -252,8 +250,6 @@ global:
cpu: 2
# Overrides the name of the service account which provides an identity for processes that run in a Pod in Open Match.
serviceAccount:
# Adds custom annotations to the Open Match service account.
serviceAccountAnnotations: {}
# Use this field if you need to override the port type for all services defined in this chart
service:
portType:
@ -286,6 +282,10 @@ global:
traceSamplingFraction: 0.005 # What fraction of traces to sample.
zpages:
enabled: true
jaeger:
enabled: false
agentEndpoint: '{{ include "openmatch.jaeger.agent" . }}'
collectorEndpoint: '{{ include "openmatch.jaeger.collector" . }}'
prometheus:
enabled: false
endpoint: "/metrics"

View File

@ -103,38 +103,40 @@ configs:
configName: '{{ include "openmatch.configmap.override" . }}'
# Override Redis settings
# https://github.com/bitnami/charts/tree/ba40e46ec6831e039f5bf213ab10e9748603ce6c/bitnami/redis
# https://hub.helm.sh/charts/stable/redis
# https://github.com/helm/charts/tree/master/stable/redis
redis:
architecture: standalone
auth:
enabled: false
commonConfiguration: |
redisPort: 6379
usePassword: false
usePasswordFile: false
secretMountPath: /opt/bitnami/redis/secrets
configmap: |
maxclients 100000
maxmemory 300000000
sentinel:
enabled: true
masterSet: om-redis-master
port: 26379
usePassword: false
master:
disableCommands: [] # don't disable 'FLUSH-' commands
persistence:
enabled: false
resources:
requests:
memory: 300Mi
cpu: 0.5
replica:
disableCommands: [] # don't disable 'FLUSH-' commands
replicaCount: 3
resources:
requests:
memory: 300Mi
cpu: 0.5
metrics:
enabled: true
cluster:
slaveCount: 2
serviceAccount:
create: true
sysctlImage:
# Disable this setting in production if you are not running Redis in Linux
enabled: true
# Enable this setting in production if you are running Open Match under Linux environment
enabled: false
mountHostSys: true
# Redis may require some changes in the kernel of the host machine to work as expected,
# in particular increasing the somaxconn value and disabling transparent huge pages.
# https://docs.bitnami.com/kubernetes/infrastructure/redis/administration/configure-kernel-settings/
# https://github.com/helm/charts/tree/master/stable/redis#host-kernel-settings
command:
- /bin/sh
- -c
@ -212,10 +214,6 @@ open-match-customize:
# function:
# image: [YOUR_MMF_IMAGE]
# Controls if users need to install open-match-override ConfigMap.
open-match-override:
enabled: false
# Global configurations that are visible to all subcharts
global:
kubernetes:
@ -226,26 +224,9 @@ global:
# https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
affinity: {}
horizontalPodAutoScaler:
frontend:
minReplicas: 1
maxReplicas: 10
targetCPUUtilizationPercentage: 80
backend:
minReplicas: 1
maxReplicas: 10
targetCPUUtilizationPercentage: 80
query:
minReplicas: 3
maxReplicas: 10
targetCPUUtilizationPercentage: 80
evaluator:
minReplicas: 1
maxReplicas: 10
targetCPUUtilizationPercentage: 80
matchfunction:
minReplicas: 1
maxReplicas: 10
targetCPUUtilizationPercentage: 80
minReplicas: 1
maxReplicas: 10
targetCPUUtilizationPercentage: 80
resources:
requests:
memory: 100Mi
@ -255,8 +236,6 @@ global:
cpu: 100m
# Overrides the name of the service account which provides an identity for processes that run in a Pod in Open Match.
serviceAccount:
# Adds custom annotations to the Open Match service account.
serviceAccountAnnotations: {}
# Use this field if you need to override the port type for all services defined in this chart
service:
portType:
@ -278,7 +257,7 @@ global:
# Use this field if you need to override the image registry and image tag for all services defined in this chart
image:
registry: gcr.io/open-match-public-images
tag: 1.8.0
tag: 1.2.0
pullPolicy: Always
# Expose the telemetry configurations to all subcharts because prometheus, for example,
@ -289,6 +268,10 @@ global:
traceSamplingFraction: 0.01 # What fraction of traces to sample.
zpages:
enabled: true
jaeger:
enabled: false
agentEndpoint: '{{ include "openmatch.jaeger.agent" . }}'
collectorEndpoint: '{{ include "openmatch.jaeger.collector" . }}'
prometheus:
enabled: false
endpoint: "/metrics"

View File

@ -27,6 +27,7 @@ admissionWhitelistPatterns:
- namePattern: docker.io/bitnami/redis:*
- namePattern: docker.io/oliver006/redis_exporter:*
- namePattern: registry.hub.docker.com/grafana/*
- namePattern: registry.hub.docker.com/jaegertracing/*
- namePattern: registry.hub.docker.com/jimmidyson/configmap-reload:*
- namePattern: registry.hub.docker.com/kiwigrid/k8s-sidecar:*
- namePattern: registry.hub.docker.com/prom/*

View File

@ -96,6 +96,11 @@ resource "google_container_cluster" "ci_cluster" {
identity_namespace = "${var.gcp_project_id}.svc.id.goog"
}
# Enable PodSecurityPolicy
pod_security_policy_config {
enabled = "true"
}
node_config {
oauth_scopes = [
"https://www.googleapis.com/auth/devstorage.read_only",

View File

@ -27,6 +27,8 @@ import (
"go.opencensus.io/stats"
"github.com/golang/protobuf/jsonpb"
"github.com/golang/protobuf/proto"
"github.com/golang/protobuf/ptypes"
"github.com/pkg/errors"
"github.com/rs/xid"
"github.com/sirupsen/logrus"
@ -34,8 +36,6 @@ import (
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/types/known/timestamppb"
"open-match.dev/open-match/internal/appmain/contextcause"
"open-match.dev/open-match/internal/ipb"
"open-match.dev/open-match/internal/rpc"
@ -279,8 +279,6 @@ func callHTTPMmf(ctx context.Context, cc *rpc.ClientCache, profile *pb.MatchProf
if err != nil {
return status.Errorf(codes.FailedPrecondition, "failed to create mmf http request for profile %s: %s", profile.GetName(), err.Error())
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Transfer-Encoding", "chunked")
resp, err := client.Do(req.WithContext(ctx))
if err != nil {
@ -371,7 +369,7 @@ func (s *backendService) AssignTickets(ctx context.Context, req *pb.AssignTicket
func createOrUpdateBackfill(ctx context.Context, backfill *pb.Backfill, ticketIds []string, store statestore.Service) error {
if backfill.Id == "" {
backfill.Id = xid.New().String()
backfill.CreateTime = timestamppb.Now()
backfill.CreateTime = ptypes.TimestampNow()
backfill.Generation = 1
err := store.CreateBackfill(ctx, backfill, ticketIds)
if err != nil {
@ -388,7 +386,7 @@ func createOrUpdateBackfill(ctx context.Context, backfill *pb.Backfill, ticketId
}
defer func() {
_, unlockErr := m.Unlock(context.Background())
_, unlockErr := m.Unlock(ctx)
if unlockErr != nil {
logger.WithFields(logrus.Fields{"backfill_id": backfill.Id}).WithError(unlockErr).Error("failed to make unlock")
}
@ -461,7 +459,10 @@ func recordTimeToAssignment(ctx context.Context, ticket *pb.Ticket) error {
}
now := time.Now()
created := ticket.CreateTime.AsTime()
created, err := ptypes.Timestamp(ticket.CreateTime)
if err != nil {
return err
}
stats.Record(ctx, ticketsTimeToAssignment.M(now.Sub(created).Milliseconds()))

View File

@ -22,6 +22,7 @@ import (
"go.opencensus.io/stats"
"github.com/golang/protobuf/ptypes"
"github.com/sirupsen/logrus"
"go.opencensus.io/stats/view"
"open-match.dev/open-match/internal/app/evaluator"
@ -72,7 +73,7 @@ func evaluate(ctx context.Context, in <-chan *pb.Match, out chan<- string) error
}
if a, ok := m.Extensions["evaluation_input"]; ok {
err := a.UnmarshalTo(inp)
err := ptypes.UnmarshalAny(a, inp)
if err != nil {
logger.WithFields(logrus.Fields{
"match_id": m.MatchId,

View File

@ -18,14 +18,15 @@ import (
"context"
"testing"
"github.com/golang/protobuf/proto"
"github.com/golang/protobuf/ptypes"
"github.com/golang/protobuf/ptypes/any"
"github.com/stretchr/testify/require"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/types/known/anypb"
"open-match.dev/open-match/pkg/pb"
)
func mustAny(m proto.Message) *anypb.Any {
result, err := anypb.New(m)
func mustAny(m proto.Message) *any.Any {
result, err := ptypes.MarshalAny(m)
if err != nil {
panic(err)
}
@ -43,7 +44,7 @@ func TestEvaluate(t *testing.T) {
ticket12Score1 := &pb.Match{
MatchId: "ticket12Score1",
Tickets: []*pb.Ticket{ticket1, ticket2},
Extensions: map[string]*anypb.Any{
Extensions: map[string]*any.Any{
"evaluation_input": mustAny(&pb.DefaultEvaluationCriteria{
Score: 1,
}),
@ -53,7 +54,7 @@ func TestEvaluate(t *testing.T) {
ticket12Score10 := &pb.Match{
MatchId: "ticket12Score10",
Tickets: []*pb.Ticket{ticket2, ticket1},
Extensions: map[string]*anypb.Any{
Extensions: map[string]*any.Any{
"evaluation_input": mustAny(&pb.DefaultEvaluationCriteria{
Score: 10,
}),
@ -63,7 +64,7 @@ func TestEvaluate(t *testing.T) {
ticket123Score5 := &pb.Match{
MatchId: "ticket123Score5",
Tickets: []*pb.Ticket{ticket1, ticket2, ticket3},
Extensions: map[string]*anypb.Any{
Extensions: map[string]*any.Any{
"evaluation_input": mustAny(&pb.DefaultEvaluationCriteria{
Score: 5,
}),
@ -73,7 +74,7 @@ func TestEvaluate(t *testing.T) {
ticket3Score50 := &pb.Match{
MatchId: "ticket3Score50",
Tickets: []*pb.Ticket{ticket3},
Extensions: map[string]*anypb.Any{
Extensions: map[string]*any.Any{
"evaluation_input": mustAny(&pb.DefaultEvaluationCriteria{
Score: 50,
}),
@ -84,7 +85,7 @@ func TestEvaluate(t *testing.T) {
MatchId: "ticket1Backfill0Score1",
Tickets: []*pb.Ticket{ticket1},
Backfill: backfill0,
Extensions: map[string]*anypb.Any{
Extensions: map[string]*any.Any{
"evaluation_input": mustAny(&pb.DefaultEvaluationCriteria{
Score: 1,
}),
@ -95,7 +96,7 @@ func TestEvaluate(t *testing.T) {
MatchId: "ticket2Backfill0Score1",
Tickets: []*pb.Ticket{ticket2},
Backfill: backfill0,
Extensions: map[string]*anypb.Any{
Extensions: map[string]*any.Any{
"evaluation_input": mustAny(&pb.DefaultEvaluationCriteria{
Score: 1,
}),
@ -106,7 +107,7 @@ func TestEvaluate(t *testing.T) {
MatchId: "ticket12Bacfill1Score1",
Tickets: []*pb.Ticket{ticket1, ticket2},
Backfill: backfill1,
Extensions: map[string]*anypb.Any{
Extensions: map[string]*any.Any{
"evaluation_input": mustAny(&pb.DefaultEvaluationCriteria{
Score: 1,
}),
@ -117,7 +118,7 @@ func TestEvaluate(t *testing.T) {
MatchId: "ticket12Bacfill1Score1",
Tickets: []*pb.Ticket{ticket1, ticket2},
Backfill: backfill1,
Extensions: map[string]*anypb.Any{
Extensions: map[string]*any.Any{
"evaluation_input": mustAny(&pb.DefaultEvaluationCriteria{
Score: 10,
}),
@ -128,7 +129,7 @@ func TestEvaluate(t *testing.T) {
MatchId: "ticket12Backfill2Score5",
Tickets: []*pb.Ticket{ticket1, ticket2},
Backfill: backfill2,
Extensions: map[string]*anypb.Any{
Extensions: map[string]*any.Any{
"evaluation_input": mustAny(&pb.DefaultEvaluationCriteria{
Score: 5,
}),

View File

@ -46,7 +46,7 @@ var (
func BindServiceFor(eval Evaluator) appmain.Bind {
return func(p *appmain.Params, b *appmain.Bindings) error {
b.AddHandleFunc(func(s *grpc.Server) {
pb.RegisterEvaluatorServer(s, &evaluatorService{evaluate: eval})
pb.RegisterEvaluatorServer(s, &evaluatorService{eval})
}, pb.RegisterEvaluatorHandlerFromEndpoint)
b.RegisterViews(
matchesPerEvaluateRequestView,

View File

@ -17,15 +17,15 @@ package frontend
import (
"context"
"github.com/golang/protobuf/proto"
"github.com/golang/protobuf/ptypes"
"github.com/golang/protobuf/ptypes/empty"
"github.com/rs/xid"
"github.com/sirupsen/logrus"
"go.opencensus.io/stats"
"go.opencensus.io/trace"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/types/known/emptypb"
"google.golang.org/protobuf/types/known/timestamppb"
"open-match.dev/open-match/internal/config"
"open-match.dev/open-match/internal/statestore"
"open-match.dev/open-match/pkg/pb"
@ -72,7 +72,7 @@ func doCreateTicket(ctx context.Context, req *pb.CreateTicketRequest, store stat
}
ticket.Id = xid.New().String()
ticket.CreateTime = timestamppb.Now()
ticket.CreateTime = ptypes.TimestampNow()
sfCount := 0
sfCount += len(ticket.GetSearchFields().GetDoubleArgs())
@ -122,7 +122,7 @@ func doCreateBackfill(ctx context.Context, req *pb.CreateBackfillRequest, store
}
backfill.Id = xid.New().String()
backfill.CreateTime = timestamppb.Now()
backfill.CreateTime = ptypes.TimestampNow()
backfill.Generation = 1
sfCount := 0
@ -171,7 +171,7 @@ func (s *frontendService) UpdateBackfill(ctx context.Context, req *pb.UpdateBack
return nil, err
}
defer func() {
if _, err = m.Unlock(context.Background()); err != nil {
if _, err = m.Unlock(ctx); err != nil {
logger.WithError(err).Error("error on mutex unlock")
}
}()
@ -183,7 +183,6 @@ func (s *frontendService) UpdateBackfill(ctx context.Context, req *pb.UpdateBack
// Update generation here, because Frontend is used by GameServer only
bfStored.SearchFields = backfill.SearchFields
bfStored.Extensions = backfill.Extensions
bfStored.PersistentField = backfill.PersistentField
// Autoincrement generation, input backfill generation validation is performed
// on Backend only (after MMF round)
bfStored.Generation++
@ -209,7 +208,7 @@ func (s *frontendService) UpdateBackfill(ctx context.Context, req *pb.UpdateBack
}
// DeleteBackfill deletes a Backfill by its ID.
func (s *frontendService) DeleteBackfill(ctx context.Context, req *pb.DeleteBackfillRequest) (*emptypb.Empty, error) {
func (s *frontendService) DeleteBackfill(ctx context.Context, req *pb.DeleteBackfillRequest) (*empty.Empty, error) {
bfID := req.GetBackfillId()
if bfID == "" {
return nil, status.Errorf(codes.InvalidArgument, ".BackfillId is required")
@ -222,20 +221,19 @@ func (s *frontendService) DeleteBackfill(ctx context.Context, req *pb.DeleteBack
"error": err.Error(),
}).Error("error on DeleteBackfill")
}
return &emptypb.Empty{}, nil
return &empty.Empty{}, nil
}
// 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.
// - If SearchFields exist in a Ticket, DeleteTicket will deindex the fields lazily.
//
// Users may still be able to assign/get a ticket after calling DeleteTicket on it.
func (s *frontendService) DeleteTicket(ctx context.Context, req *pb.DeleteTicketRequest) (*emptypb.Empty, error) {
func (s *frontendService) DeleteTicket(ctx context.Context, req *pb.DeleteTicketRequest) (*empty.Empty, error) {
err := doDeleteTicket(ctx, req.GetTicketId(), s.store)
if err != nil {
return nil, err
}
return &emptypb.Empty{}, nil
return &empty.Empty{}, nil
}
func doDeleteTicket(ctx context.Context, id string, store statestore.Service) error {
@ -279,37 +277,39 @@ func (s *frontendService) GetTicket(ctx context.Context, req *pb.GetTicketReques
// - If the Assignment is not updated, GetAssignment will retry using the configured backoff strategy.
func (s *frontendService) WatchAssignments(req *pb.WatchAssignmentsRequest, stream pb.FrontendService_WatchAssignmentsServer) error {
ctx := stream.Context()
sender := func(assignment *pb.Assignment) error {
return stream.Send(&pb.WatchAssignmentsResponse{Assignment: assignment})
for {
select {
case <-ctx.Done():
return ctx.Err()
default:
sender := func(assignment *pb.Assignment) error {
return stream.Send(&pb.WatchAssignmentsResponse{Assignment: assignment})
}
return doWatchAssignments(ctx, req.GetTicketId(), sender, s.store)
}
}
return doWatchAssignments(ctx, req.GetTicketId(), sender, s.store)
}
func doWatchAssignments(ctx context.Context, id string, sender func(*pb.Assignment) error, store statestore.Service) error {
var currAssignment *pb.Assignment
var ok bool
callback := func(assignment *pb.Assignment) error {
select {
case <-ctx.Done():
if ctx.Err() != nil {
return status.Errorf(codes.Aborted, ctx.Err().Error())
default:
if ctx.Err() != nil {
return status.Errorf(codes.Aborted, ctx.Err().Error())
}
if (currAssignment == nil && assignment != nil) || !proto.Equal(currAssignment, assignment) {
currAssignment, ok = proto.Clone(assignment).(*pb.Assignment)
if !ok {
return status.Error(codes.Internal, "failed to cast the assignment object")
}
err := sender(currAssignment)
if err != nil {
return status.Errorf(codes.Aborted, err.Error())
}
}
return nil
}
if (currAssignment == nil && assignment != nil) || !proto.Equal(currAssignment, assignment) {
currAssignment, ok = proto.Clone(assignment).(*pb.Assignment)
if !ok {
return status.Error(codes.Internal, "failed to cast the assignment object")
}
err := sender(currAssignment)
if err != nil {
return status.Errorf(codes.Aborted, err.Error())
}
}
return nil
}
return store.GetAssignments(ctx, id, callback)
@ -317,7 +317,7 @@ func doWatchAssignments(ctx context.Context, id string, sender func(*pb.Assignme
// AcknowledgeBackfill is used to notify OpenMatch about GameServer connection info.
// This triggers an assignment process.
func (s *frontendService) AcknowledgeBackfill(ctx context.Context, req *pb.AcknowledgeBackfillRequest) (*pb.AcknowledgeBackfillResponse, error) {
func (s *frontendService) AcknowledgeBackfill(ctx context.Context, req *pb.AcknowledgeBackfillRequest) (*pb.Backfill, error) {
if req.GetBackfillId() == "" {
return nil, status.Errorf(codes.InvalidArgument, ".BackfillId is required")
}
@ -332,7 +332,7 @@ func (s *frontendService) AcknowledgeBackfill(ctx context.Context, req *pb.Ackno
return nil, err
}
defer func() {
if _, err = m.Unlock(context.Background()); err != nil {
if _, err = m.Unlock(ctx); err != nil {
logger.WithError(err).Error("error on mutex unlock")
}
}()
@ -347,23 +347,16 @@ func (s *frontendService) AcknowledgeBackfill(ctx context.Context, req *pb.Ackno
return nil, err
}
resp := &pb.AcknowledgeBackfillResponse{
Backfill: bf,
Tickets: make([]*pb.Ticket, 0),
}
if len(associatedTickets) != 0 {
setResp, tickets, err := s.store.UpdateAssignments(ctx, &pb.AssignTicketsRequest{
resp, _, err := s.store.UpdateAssignments(ctx, &pb.AssignTicketsRequest{
Assignments: []*pb.AssignmentGroup{{TicketIds: associatedTickets, Assignment: req.GetAssignment()}},
})
if err != nil {
return nil, err
}
resp.Tickets = tickets
// log errors returned from UpdateAssignments to track tickets with NotFound errors
for _, f := range setResp.Failures {
for _, f := range resp.Failures {
logger.Errorf("failed to assign ticket %s, cause %d", f.TicketId, f.Cause)
}
for _, id := range associatedTickets {
@ -381,7 +374,7 @@ func (s *frontendService) AcknowledgeBackfill(ctx context.Context, req *pb.Ackno
}
}
return resp, nil
return bf, nil
}
// GetBackfill fetches a Backfill object by its ID.

View File

@ -22,11 +22,11 @@ import (
"testing"
"time"
"github.com/golang/protobuf/ptypes"
"github.com/spf13/viper"
"github.com/stretchr/testify/require"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/types/known/timestamppb"
"open-match.dev/open-match/internal/statestore"
statestoreTesting "open-match.dev/open-match/internal/statestore/testing"
utilTesting "open-match.dev/open-match/internal/util/testing"
@ -94,7 +94,7 @@ func TestCreateBackfill(t *testing.T) {
store, closer := statestoreTesting.NewStoreServiceForTesting(t, cfg)
defer closer()
ctx := utilTesting.NewContext(t)
fs := frontendService{cfg: cfg, store: store}
fs := frontendService{cfg, store}
var testCases = []struct {
description string
request *pb.CreateBackfillRequest
@ -116,7 +116,7 @@ func TestCreateBackfill(t *testing.T) {
},
{
description: "createTime should not exist in input",
request: &pb.CreateBackfillRequest{Backfill: &pb.Backfill{CreateTime: timestamppb.Now()}},
request: &pb.CreateBackfillRequest{Backfill: &pb.Backfill{CreateTime: ptypes.TimestampNow()}},
expectedCode: codes.InvalidArgument,
expectedMessage: "backfills cannot be created with create time set",
},
@ -157,7 +157,7 @@ func TestCreateBackfill(t *testing.T) {
// expect error with canceled context
store, closer = statestoreTesting.NewStoreServiceForTesting(t, cfg)
defer closer()
fs = frontendService{cfg: cfg, store: store}
fs = frontendService{cfg, store}
ctx, cancel := context.WithCancel(context.Background())
cancel()
@ -178,7 +178,7 @@ func TestUpdateBackfill(t *testing.T) {
store, closer := statestoreTesting.NewStoreServiceForTesting(t, cfg)
defer closer()
ctx := utilTesting.NewContext(t)
fs := frontendService{cfg: cfg, store: store}
fs := frontendService{cfg, store}
res, err := fs.CreateBackfill(ctx, &pb.CreateBackfillRequest{
Backfill: &pb.Backfill{
SearchFields: &pb.SearchFields{
@ -248,7 +248,7 @@ func TestUpdateBackfill(t *testing.T) {
// expect error with canceled context
store, closer = statestoreTesting.NewStoreServiceForTesting(t, cfg)
fs = frontendService{cfg: cfg, store: store}
fs = frontendService{cfg, store}
defer closer()
ctx, cancel := context.WithCancel(context.Background())
cancel()
@ -370,7 +370,7 @@ func TestAcknowledgeBackfillValidation(t *testing.T) {
store, closer := statestoreTesting.NewStoreServiceForTesting(t, cfg)
defer closer()
fs := frontendService{cfg: cfg, store: store}
fs := frontendService{cfg, store}
bf, err := fs.AcknowledgeBackfill(ctx, test.request)
require.Equal(t, codes.InvalidArgument.String(), status.Convert(err).Code().String())
require.Equal(t, test.expectedMessage, status.Convert(err).Message())
@ -399,18 +399,16 @@ func TestAcknowledgeBackfill(t *testing.T) {
}
err := store.CreateBackfill(ctx, fakeBackfill, []string{})
require.NoError(t, err)
fs := frontendService{cfg: cfg, store: store}
fs := frontendService{cfg, store}
resp, err := fs.AcknowledgeBackfill(ctx, &pb.AcknowledgeBackfillRequest{BackfillId: fakeBackfill.Id, Assignment: &pb.Assignment{Connection: "10.0.0.1"}})
bf, err := fs.AcknowledgeBackfill(ctx, &pb.AcknowledgeBackfillRequest{BackfillId: fakeBackfill.Id, Assignment: &pb.Assignment{Connection: "10.0.0.1"}})
require.NoError(t, err)
require.NotNil(t, resp)
require.NotNil(t, resp.Backfill)
require.NotNil(t, resp.Tickets)
require.NotNil(t, bf)
// Use wrong BackfillID, error is returned
resp, err = fs.AcknowledgeBackfill(ctx, &pb.AcknowledgeBackfillRequest{BackfillId: "42", Assignment: &pb.Assignment{Connection: "10.0.0.1"}})
bf, err = fs.AcknowledgeBackfill(ctx, &pb.AcknowledgeBackfillRequest{BackfillId: "42", Assignment: &pb.Assignment{Connection: "10.0.0.1"}})
require.Error(t, err)
require.Nil(t, resp)
require.Nil(t, bf)
require.Equal(t, "Backfill id: 42 not found", status.Convert(err).Message())
time.Sleep(cfg.GetDuration("pendingReleaseTimeout"))
@ -418,8 +416,8 @@ func TestAcknowledgeBackfill(t *testing.T) {
require.NoError(t, err)
require.Len(t, ids, 1)
resp, err = fs.AcknowledgeBackfill(ctx, &pb.AcknowledgeBackfillRequest{BackfillId: fakeBackfill.Id, Assignment: &pb.Assignment{Connection: "10.0.0.1"}})
require.Nil(t, resp)
bf, err = fs.AcknowledgeBackfill(ctx, &pb.AcknowledgeBackfillRequest{BackfillId: fakeBackfill.Id, Assignment: &pb.Assignment{Connection: "10.0.0.1"}})
require.Nil(t, bf)
require.Error(t, err)
require.Equal(t, codes.Unavailable.String(), status.Convert(err).Code().String())
require.Contains(t, status.Convert(err).Message(), "can not acknowledge an expired backfill, id: 1")
@ -580,7 +578,7 @@ func TestGetBackfill(t *testing.T) {
ctx, cancel := context.WithCancel(utilTesting.NewContext(t))
store, closer := statestoreTesting.NewStoreServiceForTesting(t, viper.New())
defer closer()
fs := frontendService{cfg: cfg, store: store}
fs := frontendService{cfg, store}
test.preAction(ctx, cancel, store)
@ -613,7 +611,7 @@ func TestDoDeleteBackfill(t *testing.T) {
require.NoError(t, err)
cfg := viper.New()
fs := frontendService{cfg: cfg, store: store}
fs := frontendService{cfg, store}
tests := []struct {
description string

View File

@ -177,10 +177,8 @@ func updateTicketCache(store statestore.Service, value interface{}) error {
}
stats.Record(context.Background(), cacheTotalItems.M(int64(previousCount)))
stats.Record(context.Background(), totalActiveTickets.M(int64(len(currentAll))))
stats.Record(context.Background(), cacheFetchedItems.M(int64(len(toFetch))))
stats.Record(context.Background(), cacheUpdateLatency.M(float64(time.Since(t))/float64(time.Millisecond)))
stats.Record(context.Background(), totalPendingTickets.M(int64(len(toFetch))))
logger.Debugf("Ticket Cache update: Previous %d, Deleted %d, Fetched %d, Current %d", previousCount, deletedCount, len(toFetch), len(tickets))
return nil
@ -244,7 +242,6 @@ func updateBackfillCache(store statestore.Service, value interface{}) error {
}
stats.Record(context.Background(), cacheTotalItems.M(int64(previousCount)))
stats.Record(context.Background(), totalBackfillsTickets.M(int64(len(backfills))))
stats.Record(context.Background(), cacheFetchedItems.M(int64(len(toFetch))))
stats.Record(context.Background(), cacheUpdateLatency.M(float64(time.Since(t))/float64(time.Millisecond)))

View File

@ -25,15 +25,12 @@ import (
)
var (
ticketsPerQuery = stats.Int64("open-match.dev/query/tickets_per_query", "Number of tickets per query", stats.UnitDimensionless)
totalActiveTickets = stats.Int64("open-match.dev/query/total_active_tickets", "Number of tickets", stats.UnitDimensionless)
backfillsPerQuery = stats.Int64("open-match.dev/query/backfills_per_query", "Number of backfills per query", stats.UnitDimensionless)
totalBackfillsTickets = stats.Int64("open-match.dev/query/total_backfill_tickets", "Number of current backfills", stats.UnitDimensionless)
totalPendingTickets = stats.Int64("open-match.dev/query/tickets_pending_release", "Number of tickets per query", stats.UnitDimensionless)
cacheTotalItems = stats.Int64("open-match.dev/query/total_cache_items", "Total number of items query service cached", stats.UnitDimensionless)
cacheFetchedItems = stats.Int64("open-match.dev/query/fetched_items", "Number of fetched items in total", stats.UnitDimensionless)
cacheWaitingQueries = stats.Int64("open-match.dev/query/waiting_queries", "Number of waiting queries in the last update", stats.UnitDimensionless)
cacheUpdateLatency = stats.Float64("open-match.dev/query/update_latency", "Time elapsed of each query cache update", stats.UnitMilliseconds)
ticketsPerQuery = stats.Int64("open-match.dev/query/tickets_per_query", "Number of tickets per query", stats.UnitDimensionless)
backfillsPerQuery = stats.Int64("open-match.dev/query/backfills_per_query", "Number of backfills per query", stats.UnitDimensionless)
cacheTotalItems = stats.Int64("open-match.dev/query/total_cache_items", "Total number of items query service cached", stats.UnitDimensionless)
cacheFetchedItems = stats.Int64("open-match.dev/query/fetched_items", "Number of fetched items in total", stats.UnitDimensionless)
cacheWaitingQueries = stats.Int64("open-match.dev/query/waiting_queries", "Number of waiting queries in the last update", stats.UnitDimensionless)
cacheUpdateLatency = stats.Float64("open-match.dev/query/update_latency", "Time elapsed of each query cache update", stats.UnitMilliseconds)
ticketsPerQueryView = &view.View{
Measure: ticketsPerQuery,
@ -41,30 +38,12 @@ var (
Description: "Tickets per query",
Aggregation: telemetry.DefaultCountDistribution,
}
ticketsActiveTotalView = &view.View{
Measure: totalActiveTickets,
Name: "open-match.dev/query/total_active_tickets",
Description: "Total tickets",
Aggregation: view.LastValue(),
}
backfillsPerQueryView = &view.View{
Measure: ticketsPerQuery,
Name: "open-match.dev/query/backfills_per_query",
Description: "Backfills per query",
Aggregation: telemetry.DefaultCountDistribution,
}
backfillTotalTicketsView = &view.View{
Measure: totalBackfillsTickets,
Name: "open-match.dev/query/total_backfill_tickets",
Description: "Total number of backfill tickets",
Aggregation: view.LastValue(),
}
pendingTotalTicketsView = &view.View{
Measure: totalPendingTickets,
Name: "open-match.dev/query/total_pending_tickets",
Description: "Total number of pending tickets",
Aggregation: view.LastValue(),
}
cacheTotalItemsView = &view.View{
Measure: cacheTotalItems,
Name: "open-match.dev/query/total_cached_items",
@ -111,10 +90,7 @@ func BindService(p *appmain.Params, b *appmain.Bindings) error {
}, pb.RegisterQueryServiceHandlerFromEndpoint)
b.RegisterViews(
ticketsPerQueryView,
ticketsActiveTotalView,
backfillsPerQueryView,
backfillTotalTicketsView,
pendingTotalTicketsView,
cacheTotalItemsView,
cacheUpdateView,
cacheFetchedItemsView,

View File

@ -133,7 +133,7 @@ var getTests = []struct {
},
}
// nolint: gocritic, staticcheck
//nolint: gocritic, staticcheck
func Test_Get(t *testing.T) {
for _, tt := range getTests {
tt := tt

View File

@ -58,30 +58,6 @@ func Read() (*viper.Viper, error) {
return nil, fmt.Errorf("fatal error reading override config file, desc: %s", err.Error())
}
if !cfg.IsSet("registrationInterval") {
log.Printf("config: registrationInterval is not set in matchmaker_config_override.yaml")
}
if !cfg.IsSet("proposalCollectionInterval") {
log.Printf("config: proposalCollectionInterval is not set in matchmaker_config_override.yaml")
}
if !cfg.IsSet("pendingReleaseTimeout") {
log.Printf("config: pendingReleaseTimeout is not set in matchmaker_config_override.yaml")
}
if !cfg.IsSet("assignedDeleteTimeout") {
log.Printf("config: assignedDeleteTimeout is not set in matchmaker_config_override.yaml")
}
if !cfg.IsSet("queryPageSize") {
log.Printf("config: queryPageSize is not set in matchmaker_config_override.yaml")
}
if !cfg.IsSet("backfillLockTimeout") {
log.Printf("config: backfillLockTimeout is not set in matchmaker_config_override.yaml")
}
// Look for updates to the config; in Kubernetes, this is implemented using
// a ConfigMap that is written to the matchmaker_config_override.yaml file, which is
// what the Open Match components using Viper monitor for changes.

View File

@ -1,4 +1,3 @@
//go:build !race
// +build !race
// Copyright 2019 Google LLC

View File

@ -20,10 +20,11 @@ package filter
import (
"time"
"github.com/golang/protobuf/ptypes"
"github.com/golang/protobuf/ptypes/timestamp"
"github.com/sirupsen/logrus"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/types/known/timestamppb"
"open-match.dev/open-match/pkg/pb"
)
@ -52,17 +53,15 @@ func NewPoolFilter(pool *pb.Pool) (*PoolFilter, error) {
var err error
if pool.GetCreatedBefore() != nil {
if err = pool.GetCreatedBefore().CheckValid(); err != nil {
if cb, err = ptypes.Timestamp(pool.GetCreatedBefore()); err != nil {
return nil, status.Error(codes.InvalidArgument, ".invalid created_before value")
}
cb = pool.GetCreatedBefore().AsTime()
}
if pool.GetCreatedAfter() != nil {
if err = pool.GetCreatedAfter().CheckValid(); err != nil {
if ca, err = ptypes.Timestamp(pool.GetCreatedAfter()); err != nil {
return nil, status.Error(codes.InvalidArgument, ".invalid created_after value")
}
ca = pool.GetCreatedAfter().AsTime()
}
return &PoolFilter{
@ -77,7 +76,7 @@ func NewPoolFilter(pool *pb.Pool) (*PoolFilter, error) {
type filteredEntity interface {
GetId() string
GetSearchFields() *pb.SearchFields
GetCreateTime() *timestamppb.Timestamp
GetCreateTime() *timestamp.Timestamp
}
// In returns true if the Ticket meets all the criteria for this PoolFilter.
@ -90,8 +89,7 @@ func (pf *PoolFilter) In(entity filteredEntity) bool {
if !pf.CreatedAfter.IsZero() || !pf.CreatedBefore.IsZero() {
// CreateTime is only populated by Open Match and hence expected to be valid.
if err := entity.GetCreateTime().CheckValid(); err == nil {
ct := entity.GetCreateTime().AsTime()
if ct, err := ptypes.Timestamp(entity.GetCreateTime()); err == nil {
if !pf.CreatedAfter.IsZero() {
if !ct.After(pf.CreatedAfter) {
return false

View File

@ -17,10 +17,11 @@ package filter
import (
"testing"
"github.com/golang/protobuf/ptypes"
"github.com/golang/protobuf/ptypes/timestamp"
"github.com/stretchr/testify/require"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/types/known/timestamppb"
"open-match.dev/open-match/internal/filter/testcases"
"open-match.dev/open-match/pkg/pb"
)
@ -42,11 +43,11 @@ func TestMeetsCriteria(t *testing.T) {
t.Run(tc.Name, func(t *testing.T) {
testInclusion(t, tc.Pool, &pb.Ticket{
SearchFields: tc.SearchFields,
CreateTime: timestamppb.Now(),
CreateTime: ptypes.TimestampNow(),
})
testInclusion(t, tc.Pool, &pb.Backfill{
SearchFields: tc.SearchFields,
CreateTime: timestamppb.Now(),
CreateTime: ptypes.TimestampNow(),
})
})
}
@ -67,11 +68,11 @@ func TestMeetsCriteria(t *testing.T) {
t.Run(tc.Name, func(t *testing.T) {
testExclusion(t, tc.Pool, &pb.Ticket{
SearchFields: tc.SearchFields,
CreateTime: timestamppb.Now(),
CreateTime: ptypes.TimestampNow(),
})
testExclusion(t, tc.Pool, &pb.Backfill{
SearchFields: tc.SearchFields,
CreateTime: timestamppb.Now(),
CreateTime: ptypes.TimestampNow(),
})
})
}
@ -87,7 +88,7 @@ func TestValidPoolFilter(t *testing.T) {
{
"invalid create before",
&pb.Pool{
CreatedBefore: &timestamppb.Timestamp{Nanos: -1},
CreatedBefore: &timestamp.Timestamp{Nanos: -1},
},
codes.InvalidArgument,
".invalid created_before value",
@ -95,7 +96,7 @@ func TestValidPoolFilter(t *testing.T) {
{
"invalid create after",
&pb.Pool{
CreatedAfter: &timestamppb.Timestamp{Nanos: -1},
CreatedAfter: &timestamp.Timestamp{Nanos: -1},
},
codes.InvalidArgument,
".invalid created_after value",

View File

@ -20,7 +20,8 @@ import (
"math"
"time"
"google.golang.org/protobuf/types/known/timestamppb"
"github.com/golang/protobuf/ptypes"
tspb "github.com/golang/protobuf/ptypes/timestamp"
"open-match.dev/open-match/pkg/pb"
)
@ -446,9 +447,9 @@ func multipleFilters(doubleRange, stringEquals, tagPresent bool) TestCase {
}
}
func timestamp(t time.Time) *timestamppb.Timestamp {
tsp := timestamppb.New(t)
if err := tsp.CheckValid(); err != nil {
func timestamp(t time.Time) *tspb.Timestamp {
tsp, err := ptypes.TimestampProto(t)
if err != nil {
panic(err)
}

View File

@ -14,8 +14,8 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc v4.24.0
// protoc-gen-go v1.25.0-devel
// protoc v3.10.1
// source: internal/api/messages.proto
package ipb

View File

@ -14,13 +14,17 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc v4.24.0
// protoc-gen-go v1.25.0-devel
// protoc v3.10.1
// source: internal/api/synchronizer.proto
package ipb
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
pb "open-match.dev/open-match/pkg/pb"
@ -262,3 +266,119 @@ func file_internal_api_synchronizer_proto_init() {
file_internal_api_synchronizer_proto_goTypes = nil
file_internal_api_synchronizer_proto_depIdxs = nil
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConnInterface
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion6
// SynchronizerClient is the client API for Synchronizer service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type SynchronizerClient interface {
// Synchronize signals the caller when it is safe to run mmfs, collects the
// mmfs' proposals, and returns the evaluated matches.
Synchronize(ctx context.Context, opts ...grpc.CallOption) (Synchronizer_SynchronizeClient, error)
}
type synchronizerClient struct {
cc grpc.ClientConnInterface
}
func NewSynchronizerClient(cc grpc.ClientConnInterface) SynchronizerClient {
return &synchronizerClient{cc}
}
func (c *synchronizerClient) Synchronize(ctx context.Context, opts ...grpc.CallOption) (Synchronizer_SynchronizeClient, error) {
stream, err := c.cc.NewStream(ctx, &_Synchronizer_serviceDesc.Streams[0], "/openmatch.internal.Synchronizer/Synchronize", opts...)
if err != nil {
return nil, err
}
x := &synchronizerSynchronizeClient{stream}
return x, nil
}
type Synchronizer_SynchronizeClient interface {
Send(*SynchronizeRequest) error
Recv() (*SynchronizeResponse, error)
grpc.ClientStream
}
type synchronizerSynchronizeClient struct {
grpc.ClientStream
}
func (x *synchronizerSynchronizeClient) Send(m *SynchronizeRequest) error {
return x.ClientStream.SendMsg(m)
}
func (x *synchronizerSynchronizeClient) Recv() (*SynchronizeResponse, error) {
m := new(SynchronizeResponse)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// SynchronizerServer is the server API for Synchronizer service.
type SynchronizerServer interface {
// Synchronize signals the caller when it is safe to run mmfs, collects the
// mmfs' proposals, and returns the evaluated matches.
Synchronize(Synchronizer_SynchronizeServer) error
}
// UnimplementedSynchronizerServer can be embedded to have forward compatible implementations.
type UnimplementedSynchronizerServer struct {
}
func (*UnimplementedSynchronizerServer) Synchronize(Synchronizer_SynchronizeServer) error {
return status.Errorf(codes.Unimplemented, "method Synchronize not implemented")
}
func RegisterSynchronizerServer(s *grpc.Server, srv SynchronizerServer) {
s.RegisterService(&_Synchronizer_serviceDesc, srv)
}
func _Synchronizer_Synchronize_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(SynchronizerServer).Synchronize(&synchronizerSynchronizeServer{stream})
}
type Synchronizer_SynchronizeServer interface {
Send(*SynchronizeResponse) error
Recv() (*SynchronizeRequest, error)
grpc.ServerStream
}
type synchronizerSynchronizeServer struct {
grpc.ServerStream
}
func (x *synchronizerSynchronizeServer) Send(m *SynchronizeResponse) error {
return x.ServerStream.SendMsg(m)
}
func (x *synchronizerSynchronizeServer) Recv() (*SynchronizeRequest, error) {
m := new(SynchronizeRequest)
if err := x.ServerStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
var _Synchronizer_serviceDesc = grpc.ServiceDesc{
ServiceName: "openmatch.internal.Synchronizer",
HandlerType: (*SynchronizerServer)(nil),
Methods: []grpc.MethodDesc{},
Streams: []grpc.StreamDesc{
{
StreamName: "Synchronize",
Handler: _Synchronizer_Synchronize_Handler,
ServerStreams: true,
ClientStreams: true,
},
},
Metadata: "internal/api/synchronizer.proto",
}

View File

@ -1,157 +0,0 @@
// 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.
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc v4.24.0
// source: internal/api/synchronizer.proto
package ipb
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
const (
Synchronizer_Synchronize_FullMethodName = "/openmatch.internal.Synchronizer/Synchronize"
)
// SynchronizerClient is the client API for Synchronizer service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type SynchronizerClient interface {
// Synchronize signals the caller when it is safe to run mmfs, collects the
// mmfs' proposals, and returns the evaluated matches.
Synchronize(ctx context.Context, opts ...grpc.CallOption) (Synchronizer_SynchronizeClient, error)
}
type synchronizerClient struct {
cc grpc.ClientConnInterface
}
func NewSynchronizerClient(cc grpc.ClientConnInterface) SynchronizerClient {
return &synchronizerClient{cc}
}
func (c *synchronizerClient) Synchronize(ctx context.Context, opts ...grpc.CallOption) (Synchronizer_SynchronizeClient, error) {
stream, err := c.cc.NewStream(ctx, &Synchronizer_ServiceDesc.Streams[0], Synchronizer_Synchronize_FullMethodName, opts...)
if err != nil {
return nil, err
}
x := &synchronizerSynchronizeClient{stream}
return x, nil
}
type Synchronizer_SynchronizeClient interface {
Send(*SynchronizeRequest) error
Recv() (*SynchronizeResponse, error)
grpc.ClientStream
}
type synchronizerSynchronizeClient struct {
grpc.ClientStream
}
func (x *synchronizerSynchronizeClient) Send(m *SynchronizeRequest) error {
return x.ClientStream.SendMsg(m)
}
func (x *synchronizerSynchronizeClient) Recv() (*SynchronizeResponse, error) {
m := new(SynchronizeResponse)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// SynchronizerServer is the server API for Synchronizer service.
// All implementations should embed UnimplementedSynchronizerServer
// for forward compatibility
type SynchronizerServer interface {
// Synchronize signals the caller when it is safe to run mmfs, collects the
// mmfs' proposals, and returns the evaluated matches.
Synchronize(Synchronizer_SynchronizeServer) error
}
// UnimplementedSynchronizerServer should be embedded to have forward compatible implementations.
type UnimplementedSynchronizerServer struct {
}
func (UnimplementedSynchronizerServer) Synchronize(Synchronizer_SynchronizeServer) error {
return status.Errorf(codes.Unimplemented, "method Synchronize not implemented")
}
// UnsafeSynchronizerServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to SynchronizerServer will
// result in compilation errors.
type UnsafeSynchronizerServer interface {
mustEmbedUnimplementedSynchronizerServer()
}
func RegisterSynchronizerServer(s grpc.ServiceRegistrar, srv SynchronizerServer) {
s.RegisterService(&Synchronizer_ServiceDesc, srv)
}
func _Synchronizer_Synchronize_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(SynchronizerServer).Synchronize(&synchronizerSynchronizeServer{stream})
}
type Synchronizer_SynchronizeServer interface {
Send(*SynchronizeResponse) error
Recv() (*SynchronizeRequest, error)
grpc.ServerStream
}
type synchronizerSynchronizeServer struct {
grpc.ServerStream
}
func (x *synchronizerSynchronizeServer) Send(m *SynchronizeResponse) error {
return x.ServerStream.SendMsg(m)
}
func (x *synchronizerSynchronizeServer) Recv() (*SynchronizeRequest, error) {
m := new(SynchronizeRequest)
if err := x.ServerStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// Synchronizer_ServiceDesc is the grpc.ServiceDesc for Synchronizer service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Synchronizer_ServiceDesc = grpc.ServiceDesc{
ServiceName: "openmatch.internal.Synchronizer",
HandlerType: (*SynchronizerServer)(nil),
Methods: []grpc.MethodDesc{},
Streams: []grpc.StreamDesc{
{
StreamName: "Synchronize",
Handler: _Synchronizer_Synchronize_Handler,
ServerStreams: true,
ClientStreams: true,
},
},
Metadata: "internal/api/synchronizer.proto",
}

View File

@ -24,8 +24,8 @@ import (
)
// ConfigureLogging sets up open match logrus instance using the logging section of the matchmaker_config.json
// - log line format (text[default] or json)
// - min log level to include (debug, info [default], warn, error, fatal, panic)
// - log line format (text[default] or json)
// - min log level to include (debug, info [default], warn, error, fatal, panic)
func ConfigureLogging(cfg config.View) {
logrus.SetFormatter(newFormatter(cfg.GetString("logging.format")))
level := toLevel(cfg.GetString("logging.level"))

View File

@ -37,7 +37,6 @@ import (
"go.opencensus.io/plugin/ochttp"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/credentials/insecure"
"google.golang.org/grpc/keepalive"
"google.golang.org/grpc/resolver"
"open-match.dev/open-match/internal/config"
@ -135,7 +134,7 @@ func GRPCClientFromEndpoint(cfg config.View, address string) (*grpc.ClientConn,
grpcOptions = append(grpcOptions, grpc.WithTransportCredentials(tc))
} else {
grpcOptions = append(grpcOptions, grpc.WithTransportCredentials(insecure.NewCredentials()))
grpcOptions = append(grpcOptions, grpc.WithInsecure())
}
return grpc.Dial(address, grpcOptions...)
@ -153,7 +152,7 @@ func GRPCClientFromParams(params *ClientParams) (*grpc.ClientConn, error) {
}
grpcOptions = append(grpcOptions, grpc.WithTransportCredentials(credentials.NewClientTLSFromCert(trustedCertPool, "")))
} else {
grpcOptions = append(grpcOptions, grpc.WithTransportCredentials(insecure.NewCredentials()))
grpcOptions = append(grpcOptions, grpc.WithInsecure())
}
return grpc.Dial(params.Address, grpcOptions...)

View File

@ -30,9 +30,9 @@ import (
"google.golang.org/grpc"
"open-match.dev/open-match/internal/config"
"open-match.dev/open-match/internal/telemetry"
shellTesting "open-match.dev/open-match/internal/testing"
utilTesting "open-match.dev/open-match/internal/util/testing"
"open-match.dev/open-match/pkg/pb"
shellTesting "open-match.dev/open-match/testing"
certgenTesting "open-match.dev/open-match/tools/certgen/testing"
)

View File

@ -22,7 +22,6 @@ import (
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
"github.com/pkg/errors"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
"google.golang.org/protobuf/encoding/protojson"
"open-match.dev/open-match/internal/telemetry"
)
@ -74,7 +73,7 @@ func (s *insecureServer) start(params *ServerParams) error {
for _, handlerFunc := range params.handlersForGrpcProxy {
dialOpts := newGRPCDialOptions(params.enableMetrics, params.enableRPCLogging, params.enableRPCPayloadLogging)
dialOpts = append(dialOpts, grpc.WithTransportCredentials(insecure.NewCredentials()))
dialOpts = append(dialOpts, grpc.WithInsecure())
if err := handlerFunc(ctx, s.proxyMux, s.grpcListener.Addr().String(), dialOpts); err != nil {
cancel()
return errors.WithStack(err)

View File

@ -24,8 +24,7 @@ import (
"github.com/stretchr/testify/require"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
shellTesting "open-match.dev/open-match/testing"
shellTesting "open-match.dev/open-match/internal/testing"
)
func TestInsecureStartStop(t *testing.T) {
@ -43,7 +42,7 @@ func TestInsecureStartStop(t *testing.T) {
err := s.start(params)
require.Nil(err)
conn, err := grpc.Dial(fmt.Sprintf(":%s", MustGetPortNumber(grpcL)), grpc.WithTransportCredentials(insecure.NewCredentials()))
conn, err := grpc.Dial(fmt.Sprintf(":%s", MustGetPortNumber(grpcL)), grpc.WithInsecure())
require.Nil(err)
defer conn.Close()

View File

@ -24,11 +24,10 @@ import (
"github.com/stretchr/testify/require"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
"open-match.dev/open-match/internal/telemetry"
shellTesting "open-match.dev/open-match/internal/testing"
utilTesting "open-match.dev/open-match/internal/util/testing"
"open-match.dev/open-match/pkg/pb"
shellTesting "open-match.dev/open-match/testing"
)
func TestStartStopServer(t *testing.T) {
@ -47,7 +46,7 @@ func TestStartStopServer(t *testing.T) {
err := s.Start(params)
require.Nil(err)
conn, err := grpc.Dial(fmt.Sprintf(":%s", MustGetPortNumber(grpcL)), grpc.WithTransportCredentials(insecure.NewCredentials()))
conn, err := grpc.Dial(fmt.Sprintf(":%s", MustGetPortNumber(grpcL)), grpc.WithInsecure())
require.Nil(err)
endpoint := fmt.Sprintf("http://localhost:%s", MustGetPortNumber(httpL))

View File

@ -25,8 +25,8 @@ import (
"github.com/stretchr/testify/require"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
shellTesting "open-match.dev/open-match/internal/testing"
"open-match.dev/open-match/pkg/pb"
shellTesting "open-match.dev/open-match/testing"
certgenTesting "open-match.dev/open-match/tools/certgen/testing"
)

View File

@ -20,12 +20,12 @@ import (
"sync"
"time"
"github.com/golang/protobuf/proto"
"github.com/gomodule/redigo/redis"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/proto"
"open-match.dev/open-match/internal/config"
"open-match.dev/open-match/internal/ipb"
"open-match.dev/open-match/pkg/pb"
@ -193,7 +193,7 @@ func (rb *redisBackend) UpdateBackfill(ctx context.Context, backfill *pb.Backfil
}
defer handleConnectionClose(&redisConn)
expired, err := isBackfillExpired(redisConn, backfill.Id, getBackfillReleaseTimeoutFraction(rb.cfg))
expired, err := isBackfillExpired(redisConn, backfill.Id, getBackfillReleaseTimeout(rb.cfg))
if err != nil {
return err
}
@ -242,7 +242,7 @@ func (rb *redisBackend) DeleteBackfillCompletely(ctx context.Context, id string)
}
defer func() {
if _, err = m.Unlock(context.Background()); err != nil {
if _, err = m.Unlock(ctx); err != nil {
logger.WithError(err).Error("error on mutex unlock")
}
}()
@ -332,7 +332,7 @@ func (rb *redisBackend) UpdateAcknowledgmentTimestamp(ctx context.Context, id st
}
defer handleConnectionClose(&redisConn)
expired, err := isBackfillExpired(redisConn, id, getBackfillReleaseTimeoutFraction(rb.cfg))
expired, err := isBackfillExpired(redisConn, id, getBackfillReleaseTimeout(rb.cfg))
if err != nil {
return err
}
@ -364,7 +364,7 @@ func (rb *redisBackend) GetExpiredBackfillIDs(ctx context.Context) ([]string, er
}
defer handleConnectionClose(&redisConn)
ttl := getBackfillReleaseTimeoutFraction(rb.cfg)
ttl := getBackfillReleaseTimeout(rb.cfg)
curTime := time.Now()
endTimeInt := curTime.Add(-ttl).UnixNano()
startTimeInt := 0
@ -431,7 +431,7 @@ func (rb *redisBackend) GetIndexedBackfills(ctx context.Context) (map[string]int
}
defer handleConnectionClose(&redisConn)
ttl := getBackfillReleaseTimeoutFraction(rb.cfg)
ttl := getBackfillReleaseTimeout(rb.cfg)
curTime := time.Now()
endTimeInt := curTime.Add(time.Hour).UnixNano()
startTimeInt := curTime.Add(-ttl).UnixNano()
@ -463,22 +463,7 @@ func (rb *redisBackend) GetIndexedBackfills(ctx context.Context) (map[string]int
}
func getBackfillReleaseTimeout(cfg config.View) time.Duration {
const (
name = "pendingReleaseTimeout"
// Default timeout to release backfill. This value
// will be used if pendingReleaseTimeout is not configured.
defaultpendingReleaseTimeout time.Duration = 1 * time.Minute
)
if !cfg.IsSet(name) {
return defaultpendingReleaseTimeout
}
return cfg.GetDuration(name)
}
func getBackfillReleaseTimeoutFraction(cfg config.View) time.Duration {
// Use a fraction 80% of pendingRelease Tickets TTL
ttl := getBackfillReleaseTimeout(cfg) / 5 * 4
ttl := cfg.GetDuration("pendingReleaseTimeout") / 5 * 4
return ttl
}

View File

@ -21,13 +21,14 @@ import (
"testing"
"time"
"github.com/golang/protobuf/ptypes"
"github.com/golang/protobuf/ptypes/any"
"github.com/golang/protobuf/ptypes/wrappers"
"github.com/gomodule/redigo/redis"
"github.com/spf13/viper"
"github.com/stretchr/testify/require"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/types/known/anypb"
"google.golang.org/protobuf/types/known/wrapperspb"
"open-match.dev/open-match/internal/config"
utilTesting "open-match.dev/open-match/internal/util/testing"
"open-match.dev/open-match/pkg/pb"
@ -126,8 +127,8 @@ func TestUpdateExistingBackfillNoError(t *testing.T) {
ctx := utilTesting.NewContext(t)
// ARRANGE
v := &wrapperspb.DoubleValue{Value: 123}
a, err := anypb.New(v)
v := &wrappers.DoubleValue{Value: 123}
a, err := ptypes.MarshalAny(v)
require.NoError(t, err)
existingBF := pb.Backfill{
@ -136,7 +137,7 @@ func TestUpdateExistingBackfillNoError(t *testing.T) {
SearchFields: &pb.SearchFields{
Tags: []string{"123"},
},
Extensions: map[string]*anypb.Any{
Extensions: map[string]*any.Any{
"qwe": a,
},
}
@ -150,7 +151,7 @@ func TestUpdateExistingBackfillNoError(t *testing.T) {
SearchFields: &pb.SearchFields{
Tags: []string{"456"},
},
Extensions: map[string]*anypb.Any{
Extensions: map[string]*any.Any{
"xyz": a,
},
}
@ -171,8 +172,8 @@ func TestUpdateExistingBackfillNoError(t *testing.T) {
require.NotNil(t, backfillActual.SearchFields)
require.Equal(t, updateBF.SearchFields.Tags, backfillActual.SearchFields.Tags)
res := &wrapperspb.DoubleValue{}
err = backfillActual.Extensions["xyz"].UnmarshalTo(res)
res := &wrappers.DoubleValue{}
err = ptypes.UnmarshalAny(backfillActual.Extensions["xyz"], res)
require.NoError(t, err)
require.Equal(t, v.Value, res.Value)
}
@ -185,8 +186,8 @@ func TestUpdateBackfillDoNotExistCanNotUpdate(t *testing.T) {
defer service.Close()
ctx := utilTesting.NewContext(t)
v := &wrapperspb.DoubleValue{Value: 123}
a, err := anypb.New(v)
v := &wrappers.DoubleValue{Value: 123}
a, err := ptypes.MarshalAny(v)
require.NoError(t, err)
updateBF := pb.Backfill{
@ -195,7 +196,7 @@ func TestUpdateBackfillDoNotExistCanNotUpdate(t *testing.T) {
SearchFields: &pb.SearchFields{
Tags: []string{"456"},
},
Extensions: map[string]*anypb.Any{
Extensions: map[string]*any.Any{
"xyz": a,
},
}

View File

@ -41,11 +41,11 @@ var (
// NewMutex returns a new distributed mutex with given name
func (rb *redisBackend) NewMutex(key string) RedisLocker {
m := redsync.NewMutex(fmt.Sprintf("lock/%s", key), rs.WithExpiry(getBackfillLockTimeout(rb.cfg)))
m := redsync.NewMutex(fmt.Sprintf("lock/%s", key), rs.WithExpiry(rb.cfg.GetDuration("backfillLockTimeout")))
return redisBackend{mutex: m}
}
// Lock locks r. In case it returns an error on failure, you may retry to acquire the lock by calling this method again.
//Lock locks r. In case it returns an error on failure, you may retry to acquire the lock by calling this method again.
func (rb redisBackend) Lock(ctx context.Context) error {
return rb.mutex.LockContext(ctx)
}
@ -246,18 +246,3 @@ func handleConnectionClose(conn *redis.Conn) {
}).Debug("failed to close redis client connection.")
}
}
func getBackfillLockTimeout(cfg config.View) time.Duration {
const (
name = "backfillLockTimeout"
// Default timeout to lock backfill. This value
// will be used if backfillLockTimeout is not configured.
defaultBackfillLockTimeout time.Duration = 1 * time.Minute
)
if !cfg.IsSet(name) {
return defaultBackfillLockTimeout
}
return cfg.GetDuration(name)
}

View File

@ -20,12 +20,11 @@ import (
"time"
"github.com/cenkalti/backoff"
"github.com/golang/protobuf/proto"
"github.com/gomodule/redigo/redis"
"github.com/pkg/errors"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/proto"
"open-match.dev/open-match/internal/config"
"open-match.dev/open-match/pkg/pb"
)
@ -36,7 +35,6 @@ const (
// CreateTicket creates a new Ticket in the state storage. If the id already exists, it will be overwritten.
func (rb *redisBackend) CreateTicket(ctx context.Context, ticket *pb.Ticket) error {
redisConn, err := rb.redisPool.GetContext(ctx)
if err != nil {
return status.Errorf(codes.Unavailable, "CreateTicket, id: %s, failed to connect to redis: %v", ticket.GetId(), err)
@ -49,10 +47,6 @@ func (rb *redisBackend) CreateTicket(ctx context.Context, ticket *pb.Ticket) err
return status.Errorf(codes.Internal, "%v", err)
}
if value == nil {
return status.Errorf(codes.Internal, "failed to marshal the ticket proto, id: %s: proto: Marshal called with nil", ticket.GetId())
}
_, err = redisConn.Do("SET", ticket.GetId(), value)
if err != nil {
err = errors.Wrapf(err, "failed to set the value for ticket, id: %s", ticket.GetId())
@ -160,7 +154,7 @@ func (rb *redisBackend) GetIndexedIDSet(ctx context.Context) (map[string]struct{
}
defer handleConnectionClose(&redisConn)
ttl := getBackfillReleaseTimeout(rb.cfg)
ttl := rb.cfg.GetDuration("pendingReleaseTimeout")
curTime := time.Now()
endTimeInt := curTime.Add(time.Hour).UnixNano()
startTimeInt := curTime.Add(-ttl).UnixNano()
@ -261,10 +255,6 @@ func (rb *redisBackend) UpdateAssignments(ctx context.Context, req *pb.AssignTic
}
}
if len(idsI) == 0 {
return nil, nil, status.Error(codes.InvalidArgument, "AssignmentGroupTicketIds is empty")
}
ticketBytes, err := redis.ByteSlices(redisConn.Do("MGET", idsI...))
if err != nil {
return nil, nil, err
@ -288,7 +278,7 @@ func (rb *redisBackend) UpdateAssignments(ctx context.Context, req *pb.AssignTic
tickets = append(tickets, t)
}
}
assignmentTimeout := getAssignedDeleteTimeout(rb.cfg) / time.Millisecond
assignmentTimeout := rb.cfg.GetDuration("assignedDeleteTimeout") / time.Millisecond
err = redisConn.Send("MULTI")
if err != nil {
return nil, nil, errors.Wrap(err, "error starting redis multi")
@ -452,18 +442,3 @@ func (rb *redisBackend) newExponentialBackoffStrategy() backoff.BackOff {
backoffStrat.MaxElapsedTime = rb.cfg.GetDuration("backoff.maxElapsedTime")
return backoff.BackOff(backoffStrat)
}
func getAssignedDeleteTimeout(cfg config.View) time.Duration {
const (
name = "assignedDeleteTimeout"
// Default timeout to delete tickets after assignment. This value
// will be used if assignedDeleteTimeout is not configured.
defaultAssignedDeleteTimeout time.Duration = 10 * time.Minute
)
if !cfg.IsSet(name) {
return defaultAssignedDeleteTimeout
}
return cfg.GetDuration(name)
}

View File

@ -228,23 +228,6 @@ func TestUpdateAssignments(t *testing.T) {
assignedTicketsIDs: []string{"1"},
},
},
{
description: "empty ticketIds, error expected",
request: &pb.AssignTicketsRequest{
Assignments: []*pb.AssignmentGroup{
{
TicketIds: []string{},
Assignment: &pb.Assignment{Connection: "2"},
},
},
},
expected: expected{
resp: nil,
errCode: codes.InvalidArgument,
errMessage: "AssignmentGroupTicketIds is empty",
assignedTicketsIDs: nil,
},
},
{
description: "nil assignment, error expected",
request: &pb.AssignTicketsRequest{
@ -974,7 +957,7 @@ func createRedis(t *testing.T, withSentinel bool, withPassword string) (config.V
}
}
// nolint: unparam
//nolint: unparam
// generateTickets creates a proper amount of ticket, returns a slice of tickets and a slice of tickets ids
func generateTickets(ctx context.Context, t *testing.T, service Service, amount int) ([]*pb.Ticket, []string) {
tickets := make([]*pb.Ticket, 0, amount)

View File

@ -0,0 +1,57 @@
// 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 telemetry
import (
"contrib.go.opencensus.io/exporter/jaeger"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"go.opencensus.io/trace"
)
func bindJaeger(p Params, b Bindings) error {
cfg := p.Config()
if !cfg.GetBool("telemetry.jaeger.enable") {
logger.Info("Jaeger Tracing: Disabled")
return nil
}
agentEndpointURI := cfg.GetString("telemetry.jaeger.agentEndpoint")
collectorEndpointURI := cfg.GetString("telemetry.jaeger.collectorEndpoint")
serviceName := p.ServiceName()
logger.WithFields(logrus.Fields{
"agentEndpoint": agentEndpointURI,
"collectorEndpoint": collectorEndpointURI,
"serviceName": serviceName,
}).Info("Jaeger Tracing: ENABLED")
je, err := jaeger.NewExporter(jaeger.Options{
AgentEndpoint: agentEndpointURI,
CollectorEndpoint: collectorEndpointURI,
ServiceName: serviceName,
})
if err != nil {
return errors.Wrap(err, "Failed to create the Jaeger exporter")
}
trace.RegisterExporter(je)
b.AddCloser(func() {
trace.UnregisterExporter(je)
})
return nil
}

View File

@ -36,6 +36,7 @@ var (
func Setup(p Params, b Bindings) error {
bindings := []func(p Params, b Bindings) error{
configureOpenCensus,
bindJaeger,
bindPrometheus,
bindStackDriverMetrics,
bindOpenCensusAgent,

View File

@ -17,8 +17,8 @@ of running the tests in a realistic setting where requests may not be routed to
For a new test package under test/e2e/ do the following:
Copy the contents of testing/e2e/main_test.go and change the package name and add
the `open-match.dev/open-match/testing/e2e` import.
Copy the contents of internal/testing/e2e/main_test.go and change the package name and add
the `open-match.dev/open-match/internal/testing/e2e` import.
Example (may be out of date):
```golang
@ -39,7 +39,7 @@ Example (may be out of date):
package tickets
import (
"open-match.dev/open-match/testing/e2e"
"open-match.dev/open-match/internal/testing/e2e"
"testing"
)
@ -61,10 +61,10 @@ Minimatch mode essentially binds all the services that Open Match provides
into a single gRPC/HTTP server. The magic happens in the `internal/app/minimatch/minimatch.go`'s
`BindService()` method.
In addition, there's an in-memory Redis instance that's initialized and bound in `testing/e2e/in_memory.go`.
In addition, there's an in-memory Redis instance that's initialized and bound in `internal/testing/e2e/in_memory.go`.
From here the `OM` instance encapsulates the details of communicating with these components.
## Kubernetes Cluster
Kubernetes cluster mode is managed via `testing/e2e/cluster.go`
Kubernetes cluster mode is managed via `internal/testing/e2e/cluster.go`

View File

@ -20,13 +20,15 @@ import (
"io"
"regexp"
"testing"
"time"
"github.com/golang/protobuf/proto"
"github.com/golang/protobuf/ptypes"
"github.com/golang/protobuf/ptypes/any"
"github.com/stretchr/testify/require"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/types/known/anypb"
"google.golang.org/protobuf/types/known/timestamppb"
"open-match.dev/open-match/pkg/pb"
)
@ -89,13 +91,13 @@ func TestBackfillFrontendLifecycle(t *testing.T) {
createdBf.SearchFields.StringArgs["key"] = "val"
orig := &anypb.Any{Value: []byte("test")}
val, err := anypb.New(orig)
val, err := ptypes.MarshalAny(orig)
require.NoError(t, err)
// Create a different Backfill, but with the same ID
// Pass different time
bf2 := &pb.Backfill{
CreateTime: timestamppb.Now(),
CreateTime: ptypes.TimestampNow(),
Id: createdBf.Id,
SearchFields: &pb.SearchFields{
StringArgs: map[string]string{
@ -104,7 +106,7 @@ func TestBackfillFrontendLifecycle(t *testing.T) {
},
},
Generation: 42,
Extensions: map[string]*anypb.Any{"key": val},
Extensions: map[string]*any.Any{"key": val},
}
updatedBf, err := om.Frontend().UpdateBackfill(ctx, &pb.UpdateBackfillRequest{Backfill: bf2})
require.NoError(t, err)
@ -118,7 +120,7 @@ func TestBackfillFrontendLifecycle(t *testing.T) {
require.Equal(t, bf2.SearchFields.StringArgs, get.SearchFields.StringArgs)
unpacked := &anypb.Any{}
err = get.Extensions["key"].UnmarshalTo(unpacked)
err = ptypes.UnmarshalAny(get.Extensions["key"], unpacked)
require.NoError(t, err)
require.Equal(t, unpacked.Value, orig.Value)
@ -148,33 +150,23 @@ func TestAcknowledgeBackfill(t *testing.T) {
ticketIDs := createMatchWithBackfill(ctx, om, createdBf, t)
conn := "127.0.0.1:4242"
getResp, err := om.Frontend().AcknowledgeBackfill(ctx, &pb.AcknowledgeBackfillRequest{
getBF, err := om.Frontend().AcknowledgeBackfill(ctx, &pb.AcknowledgeBackfillRequest{
BackfillId: createdBf.Id,
Assignment: &pb.Assignment{
Connection: conn,
Extensions: map[string]*anypb.Any{
Extensions: map[string]*any.Any{
"evaluation_input": mustAny(&pb.DefaultEvaluationCriteria{
Score: 10,
}),
},
},
})
require.NotNil(t, getResp)
require.NotNil(t, getResp.Backfill)
require.NotNil(t, getResp.Tickets)
require.Equal(t, len(ticketIDs), len(getResp.Tickets))
require.NotNil(t, getBF)
require.NoError(t, err)
respTicketIds := make([]string, len(getResp.Tickets))
for _, rt := range getResp.Tickets {
respTicketIds = append(respTicketIds, rt.Id)
}
for _, v := range ticketIDs {
ticket, err := om.Frontend().GetTicket(ctx, &pb.GetTicketRequest{TicketId: v})
require.NoError(t, err)
require.Contains(t, respTicketIds, ticket.Id)
require.NotNil(t, ticket.Assignment)
require.Equal(t, conn, ticket.Assignment.Connection)
}
@ -201,14 +193,12 @@ func TestAcknowledgeBackfillDeletedTicket(t *testing.T) {
// Delete 1st ticket
om.Frontend().DeleteTicket(ctx, &pb.DeleteTicketRequest{TicketId: ticketIDs[0]})
conn := "127.0.0.1:4242"
getResp, err := om.Frontend().AcknowledgeBackfill(ctx, &pb.AcknowledgeBackfillRequest{BackfillId: createdBf.Id, Assignment: &pb.Assignment{Connection: conn, Extensions: map[string]*anypb.Any{
getBF, err := om.Frontend().AcknowledgeBackfill(ctx, &pb.AcknowledgeBackfillRequest{BackfillId: createdBf.Id, Assignment: &pb.Assignment{Connection: conn, Extensions: map[string]*any.Any{
"evaluation_input": mustAny(&pb.DefaultEvaluationCriteria{
Score: 10,
}),
}}})
require.NotNil(t, getResp)
require.NotNil(t, getResp.Backfill)
require.NotNil(t, getResp.Tickets)
require.NotNil(t, getBF)
require.NoError(t, err)
// Check that an error on 1st ticket assignment does not change 2nd ticket assignment
@ -413,7 +403,7 @@ func TestProposedBackfillUpdate(t *testing.T) {
},
}
//using DefaultEvaluationCriteria just for testing purposes only
b.Extensions = map[string]*anypb.Any{
b.Extensions = map[string]*any.Any{
"evaluation_input": mustAny(&pb.DefaultEvaluationCriteria{
Score: 10,
}),
@ -558,6 +548,62 @@ func TestBackfillGenerationMismatch(t *testing.T) {
}
}
func TestCleanUpExpiredBackfills(t *testing.T) {
ctx := context.Background()
om := newOM(t)
t1, err := om.Frontend().CreateTicket(ctx, &pb.CreateTicketRequest{Ticket: &pb.Ticket{}})
require.NoError(t, err)
require.NotNil(t, t1)
b1, err := om.Frontend().CreateBackfill(ctx, &pb.CreateBackfillRequest{Backfill: &pb.Backfill{
SearchFields: &pb.SearchFields{
StringArgs: map[string]string{
"search": "me",
},
}}})
require.NoError(t, err)
require.NotNil(t, b1)
om.SetMMF(func(ctx context.Context, profile *pb.MatchProfile, out chan<- *pb.Match) error {
return nil
})
om.SetEvaluator(func(ctx context.Context, in <-chan *pb.Match, out chan<- string) error {
return nil
})
// wait until backfill is expired, then try to get it
time.Sleep(pendingReleaseTimeout * 2)
// statestore.CleanupBackfills is called at the end of each synchronizer cycle after fetch matches call, so expired backfill will be removed
stream, err := om.Backend().FetchMatches(ctx, &pb.FetchMatchesRequest{
Config: om.MMFConfigGRPC(),
Profile: &pb.MatchProfile{},
})
require.NoError(t, err)
resp, err := stream.Recv()
require.Nil(t, resp)
require.Error(t, err)
require.Equal(t, io.EOF.Error(), err.Error())
// call FetchMatches twice in order to give backfills time to be completely cleaned up
stream, err = om.Backend().FetchMatches(ctx, &pb.FetchMatchesRequest{
Config: om.MMFConfigGRPC(),
Profile: &pb.MatchProfile{},
})
require.NoError(t, err)
resp, err = stream.Recv()
require.Nil(t, resp)
require.Error(t, err)
require.Equal(t, io.EOF.Error(), err.Error())
_, err = om.Frontend().GetBackfill(ctx, &pb.GetBackfillRequest{BackfillId: b1.Id})
require.Error(t, err)
require.Equal(t, fmt.Sprintf("rpc error: code = NotFound desc = Backfill id: %s not found", b1.Id), err.Error())
}
func TestBackfillSkipNotfoundError(t *testing.T) {
ctx := context.Background()
om := newOM(t)
@ -613,8 +659,8 @@ func TestBackfillSkipNotfoundError(t *testing.T) {
require.Equal(t, fmt.Sprintf("rpc error: code = NotFound desc = Backfill id: %s not found", b1.Id), err.Error())
}
func mustAny(m proto.Message) *anypb.Any {
result, err := anypb.New(m)
func mustAny(m proto.Message) *any.Any {
result, err := ptypes.MarshalAny(m)
if err != nil {
panic(err)
}

View File

@ -1,4 +1,3 @@
//go:build e2ecluster
// +build e2ecluster
// Copyright 2019 Google LLC
@ -26,7 +25,7 @@ import (
"open-match.dev/open-match/internal/app/evaluator"
"open-match.dev/open-match/internal/config"
"open-match.dev/open-match/internal/statestore"
mmfService "open-match.dev/open-match/testing/mmf"
mmfService "open-match.dev/open-match/internal/testing/mmf"
)
func start(t *testing.T, eval evaluator.Evaluator, mmf mmfService.MatchFunction) (config.View, func(time.Duration)) {

View File

@ -1,4 +1,3 @@
//go:build e2ecluster
// +build e2ecluster
// Copyright 2019 Google LLC
@ -21,16 +20,20 @@ import (
"context"
"fmt"
"os"
"strings"
"testing"
"github.com/spf13/viper"
"github.com/stretchr/testify/require"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
"open-match.dev/open-match/internal/app/evaluator"
"open-match.dev/open-match/internal/appmain/apptest"
"open-match.dev/open-match/internal/config"
mmfService "open-match.dev/open-match/internal/testing/mmf"
"open-match.dev/open-match/pkg/pb"
mmfService "open-match.dev/open-match/testing/mmf"
)
func TestServiceHealth(t *testing.T) {
@ -46,7 +49,7 @@ func TestServiceHealth(t *testing.T) {
namespace := os.Getenv("NAMESPACE")
podList, err := kubeClient.CoreV1().Pods(namespace).List(context.Background(), metav1.ListOptions{})
podList, err := kubeClient.CoreV1().Pods(namespace).List(metav1.ListOptions{})
if err != nil {
t.Fatal(err)
}
@ -83,3 +86,21 @@ func TestMain(m *testing.M) {
os.Exit(exitCode)
}
// TestConfigMatch covers that the config file used for local in memory e2e
// tests matches the configs used for the in cluster tests, to avoid drift.
func TestConfigMatch(t *testing.T) {
cfg, err := config.Read()
if err != nil {
t.Fatal(err)
}
cfgMemory := viper.New()
cfgMemory.SetConfigType("yaml")
err = cfgMemory.ReadConfig(strings.NewReader(configFile))
if err != nil {
t.Fatal(err)
}
require.Equal(t, cfgMemory.AllSettings(), cfg.AllSettings())
}

View File

@ -25,8 +25,8 @@ import (
"open-match.dev/open-match/internal/app/evaluator"
"open-match.dev/open-match/internal/appmain/apptest"
"open-match.dev/open-match/internal/config"
mmfService "open-match.dev/open-match/internal/testing/mmf"
"open-match.dev/open-match/pkg/pb"
mmfService "open-match.dev/open-match/testing/mmf"
)
var (
@ -219,9 +219,12 @@ api:
httpport: "51509"
redis:
port: 6379
sentinelPort: 26379
sentinelMaster: om-redis-master
sentinelHostname: open-match-redis
sentinelUsePassword: false
usePassword: false
passwordPath: /redis-password
passwordPath: /opt/bitnami/redis/secrets/redis-password
pool:
maxIdle: 200
maxActive: 0
@ -233,6 +236,10 @@ telemetry:
traceSamplingFraction: "0.01"
zpages:
enable: "true"
jaeger:
enable: "false"
agentEndpoint: ""
collectorEndpoint: ""
prometheus:
enable: "false"
endpoint: "/metrics"

View File

@ -21,11 +21,11 @@ import (
"testing"
"time"
"github.com/golang/protobuf/proto"
"github.com/pkg/errors"
"github.com/stretchr/testify/require"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/proto"
"open-match.dev/open-match/pkg/matchfunction"
"open-match.dev/open-match/pkg/pb"
)

View File

@ -1,4 +1,3 @@
//go:build !e2ecluster
// +build !e2ecluster
// Copyright 2019 Google LLC
@ -32,7 +31,7 @@ import (
"open-match.dev/open-match/internal/config"
"open-match.dev/open-match/internal/rpc"
"open-match.dev/open-match/internal/telemetry"
mmfService "open-match.dev/open-match/testing/mmf"
mmfService "open-match.dev/open-match/internal/testing/mmf"
)
func start(t *testing.T, eval evaluator.Evaluator, mmf mmfService.MatchFunction) (config.View, func(time.Duration)) {
@ -43,12 +42,12 @@ func start(t *testing.T, eval evaluator.Evaluator, mmf mmfService.MatchFunction)
}
t.Cleanup(mredis.Close)
msentinel := minisentinel.NewSentinel(mredis)
err = msentinel.StartAddr("localhost:0")
msentinal := minisentinel.NewSentinel(mredis)
err = msentinal.StartAddr("localhost:0")
if err != nil {
t.Fatalf("failed to start minisentinel, %v", err)
}
t.Cleanup(msentinel.Close)
t.Cleanup(msentinal.Close)
grpcListener, err := net.Listen("tcp", ":0")
if err != nil {
@ -75,9 +74,9 @@ func start(t *testing.T, eval evaluator.Evaluator, mmf mmfService.MatchFunction)
t.Fatal(err)
}
cfg.Set("redis.sentinelHostname", msentinel.Host())
cfg.Set("redis.sentinelPort", msentinel.Port())
cfg.Set("redis.sentinelMaster", msentinel.MasterInfo().Name)
cfg.Set("redis.sentinelHostname", msentinal.Host())
cfg.Set("redis.sentinelPort", msentinal.Port())
cfg.Set("redis.sentinelMaster", msentinal.MasterInfo().Name)
services := []string{apptest.ServiceName, "synchronizer", "backend", "frontend", "query", "evaluator"}
for _, name := range services {
cfg.Set("api."+name+".hostname", "localhost")

View File

@ -19,10 +19,10 @@ import (
"io"
"testing"
"github.com/golang/protobuf/proto"
"github.com/stretchr/testify/require"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/proto"
"open-match.dev/open-match/pkg/pb"
)

View File

@ -22,8 +22,8 @@ import (
"time"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/types/known/timestamppb"
"github.com/golang/protobuf/ptypes"
"github.com/stretchr/testify/require"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
@ -74,27 +74,6 @@ func TestAssignTickets(t *testing.T) {
require.Equal(t, "b", get.Assignment.Connection)
}
// TestAssignTicketsEmpty covers calls to assign when empty TicketIds
func TestAssignTicketsEmpty(t *testing.T) {
om := newOM(t)
ctx := context.Background()
req := &pb.AssignTicketsRequest{
Assignments: []*pb.AssignmentGroup{
{
TicketIds: []string{},
Assignment: &pb.Assignment{Connection: "a"},
},
},
}
resp, err := om.Backend().AssignTickets(ctx, req)
require.Nil(t, resp)
require.Equal(t, codes.InvalidArgument.String(), status.Convert(err).Code().String())
require.Equal(t, "AssignmentGroupTicketIds is empty", status.Convert(err).Message())
}
// TestAssignTicketsInvalidArgument covers various invalid calls to assign
// tickets.
func TestAssignTicketsInvalidArgument(t *testing.T) {
@ -429,7 +408,6 @@ func TestTicketReleaseByTimeout(t *testing.T) {
{ // Create ticket
var err error
ticket, err = om.Frontend().CreateTicket(ctx, &pb.CreateTicketRequest{Ticket: &pb.Ticket{}})
fmt.Println("------------------- ", err)
require.Nil(t, err)
require.NotEmpty(t, ticket.Id)
}
@ -540,7 +518,7 @@ func TestCreateTicketErrors(t *testing.T) {
"already has create time",
&pb.CreateTicketRequest{
Ticket: &pb.Ticket{
CreateTime: timestamppb.Now(),
CreateTime: ptypes.TimestampNow(),
},
},
"tickets cannot be created with create time set",

View File

@ -18,9 +18,9 @@ package testing
import (
"context"
"github.com/golang/protobuf/ptypes/empty"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/types/known/emptypb"
"open-match.dev/open-match/pkg/pb"
)
@ -40,7 +40,7 @@ func (s *FakeFrontend) CreateTicket(ctx context.Context, req *pb.CreateTicketReq
// DeleteTicket removes the Ticket from state storage and from corresponding
// configured indices. Deleting the ticket stops the ticket from being
// considered for future matchmaking requests.
func (s *FakeFrontend) DeleteTicket(ctx context.Context, req *pb.DeleteTicketRequest) (*emptypb.Empty, error) {
func (s *FakeFrontend) DeleteTicket(ctx context.Context, req *pb.DeleteTicketRequest) (*empty.Empty, error) {
return nil, status.Error(codes.Unimplemented, "not implemented")
}
@ -57,7 +57,7 @@ func (s *FakeFrontend) WatchAssignments(req *pb.WatchAssignmentsRequest, stream
// AcknowledgeBackfill is used to notify OpenMatch about GameServer connection info.
// This triggers an assignment process.
func (s *FakeFrontend) AcknowledgeBackfill(ctx context.Context, req *pb.AcknowledgeBackfillRequest) (*pb.AcknowledgeBackfillResponse, error) {
func (s *FakeFrontend) AcknowledgeBackfill(ctx context.Context, req *pb.AcknowledgeBackfillRequest) (*pb.Backfill, error) {
return nil, status.Error(codes.Unimplemented, "not implemented")
}
@ -67,7 +67,7 @@ func (s *FakeFrontend) CreateBackfill(ctx context.Context, req *pb.CreateBackfil
}
// DeleteBackfill deletes a Backfill by its ID.
func (s *FakeFrontend) DeleteBackfill(ctx context.Context, req *pb.DeleteBackfillRequest) (*emptypb.Empty, error) {
func (s *FakeFrontend) DeleteBackfill(ctx context.Context, req *pb.DeleteBackfillRequest) (*empty.Empty, error) {
return nil, status.Error(codes.Unimplemented, "not implemented")
}

View File

@ -24,7 +24,6 @@ import (
grpc_validator "github.com/grpc-ecosystem/go-grpc-middleware/validator"
"github.com/sirupsen/logrus"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
"google.golang.org/grpc/keepalive"
"google.golang.org/grpc/resolver"
)
@ -51,7 +50,7 @@ func NewGRPCDialOptions(grpcLogger *logrus.Entry) []grpc.DialOption {
grpc_tracing.UnaryClientInterceptor(),
}
opts := []grpc.DialOption{
grpc.WithTransportCredentials(insecure.NewCredentials()),
grpc.WithInsecure(),
grpc.WithStreamInterceptor(grpc_middleware.ChainStreamClient(si...)),
grpc.WithUnaryInterceptor(grpc_middleware.ChainUnaryClient(ui...)),
grpc.WithDefaultServiceConfig(`{"loadBalancingPolicy":"round_robin"}`),

View File

@ -14,15 +14,19 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc v4.24.0
// protoc-gen-go v1.25.0-devel
// protoc v3.10.1
// source: api/backend.proto
package pb
import (
context "context"
_ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options"
_ "google.golang.org/genproto/googleapis/api/annotations"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
@ -744,60 +748,60 @@ var file_api_backend_proto_rawDesc = []byte{
0x74, 0x63, 0x68, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x1a, 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x46, 0x65,
0x74, 0x63, 0x68, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x22, 0x2b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x3a, 0x01, 0x2a, 0x22, 0x20, 0x2f,
0x76, 0x31, 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63,
0x65, 0x2f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x3a, 0x66, 0x65, 0x74, 0x63, 0x68, 0x30,
0x73, 0x65, 0x22, 0x2b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x22, 0x20, 0x2f, 0x76, 0x31, 0x2f,
0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x6d,
0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x3a, 0x66, 0x65, 0x74, 0x63, 0x68, 0x3a, 0x01, 0x2a, 0x30,
0x01, 0x12, 0x80, 0x01, 0x0a, 0x0d, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x54, 0x69, 0x63, 0x6b,
0x65, 0x74, 0x73, 0x12, 0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x2e,
0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x6d, 0x61, 0x74, 0x63, 0x68,
0x2e, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x52, 0x65,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x3a, 0x01,
0x2a, 0x22, 0x21, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x73, 0x65,
0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x3a, 0x61, 0x73,
0x73, 0x69, 0x67, 0x6e, 0x12, 0x84, 0x01, 0x0a, 0x0e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x22, 0x21,
0x2f, 0x76, 0x31, 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x73, 0x65, 0x72, 0x76, 0x69,
0x63, 0x65, 0x2f, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x3a, 0x61, 0x73, 0x73, 0x69, 0x67,
0x6e, 0x3a, 0x01, 0x2a, 0x12, 0x84, 0x01, 0x0a, 0x0e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65,
0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x12, 0x20, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x6d, 0x61,
0x74, 0x63, 0x68, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x54, 0x69, 0x63, 0x6b, 0x65,
0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6f, 0x70, 0x65, 0x6e,
0x6d, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x54, 0x69, 0x63,
0x6b, 0x65, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2d, 0x82, 0xd3,
0xe4, 0x93, 0x02, 0x27, 0x3a, 0x01, 0x2a, 0x22, 0x22, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x61, 0x63,
0x6b, 0x65, 0x6e, 0x64, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x74, 0x69, 0x63, 0x6b,
0x65, 0x74, 0x73, 0x3a, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x90, 0x01, 0x0a, 0x11,
0xe4, 0x93, 0x02, 0x27, 0x22, 0x22, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e,
0x64, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x73,
0x3a, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x3a, 0x01, 0x2a, 0x12, 0x90, 0x01, 0x0a, 0x11,
0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x41, 0x6c, 0x6c, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74,
0x73, 0x12, 0x23, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x52, 0x65,
0x6c, 0x65, 0x61, 0x73, 0x65, 0x41, 0x6c, 0x6c, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x6d, 0x61, 0x74,
0x63, 0x68, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x41, 0x6c, 0x6c, 0x54, 0x69, 0x63,
0x6b, 0x65, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x30, 0x82, 0xd3,
0xe4, 0x93, 0x02, 0x2a, 0x3a, 0x01, 0x2a, 0x22, 0x25, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x61, 0x63,
0x6b, 0x65, 0x6e, 0x64, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x74, 0x69, 0x63, 0x6b,
0x65, 0x74, 0x73, 0x3a, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x61, 0x6c, 0x6c, 0x42, 0x8a,
0x03, 0x92, 0x41, 0xd8, 0x02, 0x12, 0xb1, 0x01, 0x0a, 0x07, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e,
0x64, 0x22, 0x49, 0x0a, 0x0a, 0x4f, 0x70, 0x65, 0x6e, 0x20, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x12,
0x16, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x2d, 0x6d, 0x61,
0x74, 0x63, 0x68, 0x2e, 0x64, 0x65, 0x76, 0x1a, 0x23, 0x6f, 0x70, 0x65, 0x6e, 0x2d, 0x6d, 0x61,
0x74, 0x63, 0x68, 0x2d, 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x40, 0x67, 0x6f, 0x6f, 0x67,
0x6c, 0x65, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2a, 0x56, 0x0a, 0x12,
0x41, 0x70, 0x61, 0x63, 0x68, 0x65, 0x20, 0x32, 0x2e, 0x30, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e,
0x73, 0x65, 0x12, 0x40, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68,
0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x66, 0x6f, 0x72,
0x67, 0x61, 0x6d, 0x65, 0x73, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x2d, 0x6d, 0x61, 0x74, 0x63, 0x68,
0x2f, 0x62, 0x6c, 0x6f, 0x62, 0x2f, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x2f, 0x4c, 0x49, 0x43,
0x45, 0x4e, 0x53, 0x45, 0x32, 0x03, 0x31, 0x2e, 0x30, 0x2a, 0x02, 0x01, 0x02, 0x32, 0x10, 0x61,
0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a,
0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f,
0x6e, 0x52, 0x3b, 0x0a, 0x03, 0x34, 0x30, 0x34, 0x12, 0x34, 0x0a, 0x2a, 0x52, 0x65, 0x74, 0x75,
0x72, 0x6e, 0x65, 0x64, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65,
0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20,
0x65, 0x78, 0x69, 0x73, 0x74, 0x2e, 0x12, 0x06, 0x0a, 0x04, 0x9a, 0x02, 0x01, 0x07, 0x72, 0x3d,
0x0a, 0x18, 0x4f, 0x70, 0x65, 0x6e, 0x20, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x20, 0x44, 0x6f, 0x63,
0x75, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x68, 0x74, 0x74, 0x70,
0x73, 0x3a, 0x2f, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x2d, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x64,
0x65, 0x76, 0x2f, 0x73, 0x69, 0x74, 0x65, 0x2f, 0x64, 0x6f, 0x63, 0x73, 0x2f, 0x5a, 0x20, 0x6f,
0x70, 0x65, 0x6e, 0x2d, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x64, 0x65, 0x76, 0x2f, 0x6f, 0x70,
0x65, 0x6e, 0x2d, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x62, 0xaa,
0x02, 0x09, 0x4f, 0x70, 0x65, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x62, 0x06, 0x70, 0x72, 0x6f,
0xe4, 0x93, 0x02, 0x2a, 0x22, 0x25, 0x2f, 0x76, 0x31, 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e,
0x64, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x73,
0x3a, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x61, 0x6c, 0x6c, 0x3a, 0x01, 0x2a, 0x42, 0x8a,
0x03, 0x5a, 0x20, 0x6f, 0x70, 0x65, 0x6e, 0x2d, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x64, 0x65,
0x76, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x2d, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x2f, 0x70, 0x6b, 0x67,
0x2f, 0x70, 0x62, 0xaa, 0x02, 0x09, 0x4f, 0x70, 0x65, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x92,
0x41, 0xd8, 0x02, 0x12, 0xb1, 0x01, 0x0a, 0x07, 0x42, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x22,
0x49, 0x0a, 0x0a, 0x4f, 0x70, 0x65, 0x6e, 0x20, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x12, 0x16, 0x68,
0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x2d, 0x6d, 0x61, 0x74, 0x63,
0x68, 0x2e, 0x64, 0x65, 0x76, 0x1a, 0x23, 0x6f, 0x70, 0x65, 0x6e, 0x2d, 0x6d, 0x61, 0x74, 0x63,
0x68, 0x2d, 0x64, 0x69, 0x73, 0x63, 0x75, 0x73, 0x73, 0x40, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2a, 0x56, 0x0a, 0x12, 0x41, 0x70,
0x61, 0x63, 0x68, 0x65, 0x20, 0x32, 0x2e, 0x30, 0x20, 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65,
0x12, 0x40, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62,
0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x66, 0x6f, 0x72, 0x67, 0x61,
0x6d, 0x65, 0x73, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x2d, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x2f, 0x62,
0x6c, 0x6f, 0x62, 0x2f, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x2f, 0x4c, 0x49, 0x43, 0x45, 0x4e,
0x53, 0x45, 0x32, 0x03, 0x31, 0x2e, 0x30, 0x2a, 0x02, 0x01, 0x02, 0x32, 0x10, 0x61, 0x70, 0x70,
0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x10, 0x61,
0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x52,
0x3b, 0x0a, 0x03, 0x34, 0x30, 0x34, 0x12, 0x34, 0x0a, 0x2a, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e,
0x65, 0x64, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, 0x6f,
0x75, 0x72, 0x63, 0x65, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x65, 0x78,
0x69, 0x73, 0x74, 0x2e, 0x12, 0x06, 0x0a, 0x04, 0x9a, 0x02, 0x01, 0x07, 0x72, 0x3d, 0x0a, 0x18,
0x4f, 0x70, 0x65, 0x6e, 0x20, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x20, 0x44, 0x6f, 0x63, 0x75, 0x6d,
0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a,
0x2f, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x2d, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x64, 0x65, 0x76,
0x2f, 0x73, 0x69, 0x74, 0x65, 0x2f, 0x64, 0x6f, 0x63, 0x73, 0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
}
@ -1017,3 +1021,249 @@ func file_api_backend_proto_init() {
file_api_backend_proto_goTypes = nil
file_api_backend_proto_depIdxs = nil
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConnInterface
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion6
// BackendServiceClient is the client API for BackendService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type BackendServiceClient interface {
// FetchMatches triggers a MatchFunction with the specified MatchProfile and
// returns a set of matches generated by the Match Making Function, and
// accepted by the evaluator.
// Tickets in matches returned by FetchMatches are moved from active to
// pending, and will not be returned by query.
FetchMatches(ctx context.Context, in *FetchMatchesRequest, opts ...grpc.CallOption) (BackendService_FetchMatchesClient, error)
// AssignTickets overwrites the Assignment field of the input TicketIds.
AssignTickets(ctx context.Context, in *AssignTicketsRequest, opts ...grpc.CallOption) (*AssignTicketsResponse, error)
// ReleaseTickets moves tickets from the pending state, to the active state.
// This enables them to be returned by query, and find different matches.
// BETA FEATURE WARNING: This call and the associated Request and Response
// messages are not finalized and still subject to possible change or removal.
ReleaseTickets(ctx context.Context, in *ReleaseTicketsRequest, opts ...grpc.CallOption) (*ReleaseTicketsResponse, error)
// ReleaseAllTickets moves all tickets from the pending state, to the active
// state. This enables them to be returned by query, and find different
// matches.
// BETA FEATURE WARNING: This call and the associated Request and Response
// messages are not finalized and still subject to possible change or removal.
ReleaseAllTickets(ctx context.Context, in *ReleaseAllTicketsRequest, opts ...grpc.CallOption) (*ReleaseAllTicketsResponse, error)
}
type backendServiceClient struct {
cc grpc.ClientConnInterface
}
func NewBackendServiceClient(cc grpc.ClientConnInterface) BackendServiceClient {
return &backendServiceClient{cc}
}
func (c *backendServiceClient) FetchMatches(ctx context.Context, in *FetchMatchesRequest, opts ...grpc.CallOption) (BackendService_FetchMatchesClient, error) {
stream, err := c.cc.NewStream(ctx, &_BackendService_serviceDesc.Streams[0], "/openmatch.BackendService/FetchMatches", opts...)
if err != nil {
return nil, err
}
x := &backendServiceFetchMatchesClient{stream}
if err := x.ClientStream.SendMsg(in); err != nil {
return nil, err
}
if err := x.ClientStream.CloseSend(); err != nil {
return nil, err
}
return x, nil
}
type BackendService_FetchMatchesClient interface {
Recv() (*FetchMatchesResponse, error)
grpc.ClientStream
}
type backendServiceFetchMatchesClient struct {
grpc.ClientStream
}
func (x *backendServiceFetchMatchesClient) Recv() (*FetchMatchesResponse, error) {
m := new(FetchMatchesResponse)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *backendServiceClient) AssignTickets(ctx context.Context, in *AssignTicketsRequest, opts ...grpc.CallOption) (*AssignTicketsResponse, error) {
out := new(AssignTicketsResponse)
err := c.cc.Invoke(ctx, "/openmatch.BackendService/AssignTickets", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *backendServiceClient) ReleaseTickets(ctx context.Context, in *ReleaseTicketsRequest, opts ...grpc.CallOption) (*ReleaseTicketsResponse, error) {
out := new(ReleaseTicketsResponse)
err := c.cc.Invoke(ctx, "/openmatch.BackendService/ReleaseTickets", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *backendServiceClient) ReleaseAllTickets(ctx context.Context, in *ReleaseAllTicketsRequest, opts ...grpc.CallOption) (*ReleaseAllTicketsResponse, error) {
out := new(ReleaseAllTicketsResponse)
err := c.cc.Invoke(ctx, "/openmatch.BackendService/ReleaseAllTickets", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// BackendServiceServer is the server API for BackendService service.
type BackendServiceServer interface {
// FetchMatches triggers a MatchFunction with the specified MatchProfile and
// returns a set of matches generated by the Match Making Function, and
// accepted by the evaluator.
// Tickets in matches returned by FetchMatches are moved from active to
// pending, and will not be returned by query.
FetchMatches(*FetchMatchesRequest, BackendService_FetchMatchesServer) error
// AssignTickets overwrites the Assignment field of the input TicketIds.
AssignTickets(context.Context, *AssignTicketsRequest) (*AssignTicketsResponse, error)
// ReleaseTickets moves tickets from the pending state, to the active state.
// This enables them to be returned by query, and find different matches.
// BETA FEATURE WARNING: This call and the associated Request and Response
// messages are not finalized and still subject to possible change or removal.
ReleaseTickets(context.Context, *ReleaseTicketsRequest) (*ReleaseTicketsResponse, error)
// ReleaseAllTickets moves all tickets from the pending state, to the active
// state. This enables them to be returned by query, and find different
// matches.
// BETA FEATURE WARNING: This call and the associated Request and Response
// messages are not finalized and still subject to possible change or removal.
ReleaseAllTickets(context.Context, *ReleaseAllTicketsRequest) (*ReleaseAllTicketsResponse, error)
}
// UnimplementedBackendServiceServer can be embedded to have forward compatible implementations.
type UnimplementedBackendServiceServer struct {
}
func (*UnimplementedBackendServiceServer) FetchMatches(*FetchMatchesRequest, BackendService_FetchMatchesServer) error {
return status.Errorf(codes.Unimplemented, "method FetchMatches not implemented")
}
func (*UnimplementedBackendServiceServer) AssignTickets(context.Context, *AssignTicketsRequest) (*AssignTicketsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method AssignTickets not implemented")
}
func (*UnimplementedBackendServiceServer) ReleaseTickets(context.Context, *ReleaseTicketsRequest) (*ReleaseTicketsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ReleaseTickets not implemented")
}
func (*UnimplementedBackendServiceServer) ReleaseAllTickets(context.Context, *ReleaseAllTicketsRequest) (*ReleaseAllTicketsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ReleaseAllTickets not implemented")
}
func RegisterBackendServiceServer(s *grpc.Server, srv BackendServiceServer) {
s.RegisterService(&_BackendService_serviceDesc, srv)
}
func _BackendService_FetchMatches_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(FetchMatchesRequest)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(BackendServiceServer).FetchMatches(m, &backendServiceFetchMatchesServer{stream})
}
type BackendService_FetchMatchesServer interface {
Send(*FetchMatchesResponse) error
grpc.ServerStream
}
type backendServiceFetchMatchesServer struct {
grpc.ServerStream
}
func (x *backendServiceFetchMatchesServer) Send(m *FetchMatchesResponse) error {
return x.ServerStream.SendMsg(m)
}
func _BackendService_AssignTickets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AssignTicketsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BackendServiceServer).AssignTickets(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/openmatch.BackendService/AssignTickets",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BackendServiceServer).AssignTickets(ctx, req.(*AssignTicketsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _BackendService_ReleaseTickets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ReleaseTicketsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BackendServiceServer).ReleaseTickets(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/openmatch.BackendService/ReleaseTickets",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BackendServiceServer).ReleaseTickets(ctx, req.(*ReleaseTicketsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _BackendService_ReleaseAllTickets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ReleaseAllTicketsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BackendServiceServer).ReleaseAllTickets(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/openmatch.BackendService/ReleaseAllTickets",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BackendServiceServer).ReleaseAllTickets(ctx, req.(*ReleaseAllTicketsRequest))
}
return interceptor(ctx, in, info, handler)
}
var _BackendService_serviceDesc = grpc.ServiceDesc{
ServiceName: "openmatch.BackendService",
HandlerType: (*BackendServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "AssignTickets",
Handler: _BackendService_AssignTickets_Handler,
},
{
MethodName: "ReleaseTickets",
Handler: _BackendService_ReleaseTickets_Handler,
},
{
MethodName: "ReleaseAllTickets",
Handler: _BackendService_ReleaseAllTickets_Handler,
},
},
Streams: []grpc.StreamDesc{
{
StreamName: "FetchMatches",
Handler: _BackendService_FetchMatches_Handler,
ServerStreams: true,
},
},
Metadata: "api/backend.proto",
}

View File

@ -177,22 +177,20 @@ func RegisterBackendServiceHandlerServer(ctx context.Context, mux *runtime.Serve
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/openmatch.BackendService/AssignTickets", runtime.WithHTTPPathPattern("/v1/backendservice/tickets:assign"))
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/openmatch.BackendService/AssignTickets")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_BackendService_AssignTickets_0(annotatedContext, inboundMarshaler, server, req, pathParams)
resp, md, err := local_request_BackendService_AssignTickets_0(rctx, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_BackendService_AssignTickets_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
forward_BackendService_AssignTickets_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
@ -202,22 +200,20 @@ func RegisterBackendServiceHandlerServer(ctx context.Context, mux *runtime.Serve
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/openmatch.BackendService/ReleaseTickets", runtime.WithHTTPPathPattern("/v1/backendservice/tickets:release"))
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/openmatch.BackendService/ReleaseTickets")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_BackendService_ReleaseTickets_0(annotatedContext, inboundMarshaler, server, req, pathParams)
resp, md, err := local_request_BackendService_ReleaseTickets_0(rctx, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_BackendService_ReleaseTickets_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
forward_BackendService_ReleaseTickets_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
@ -227,22 +223,20 @@ func RegisterBackendServiceHandlerServer(ctx context.Context, mux *runtime.Serve
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/openmatch.BackendService/ReleaseAllTickets", runtime.WithHTTPPathPattern("/v1/backendservice/tickets:releaseall"))
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/openmatch.BackendService/ReleaseAllTickets")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_BackendService_ReleaseAllTickets_0(annotatedContext, inboundMarshaler, server, req, pathParams)
resp, md, err := local_request_BackendService_ReleaseAllTickets_0(rctx, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_BackendService_ReleaseAllTickets_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
forward_BackendService_ReleaseAllTickets_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
@ -252,7 +246,7 @@ func RegisterBackendServiceHandlerServer(ctx context.Context, mux *runtime.Serve
// RegisterBackendServiceHandlerFromEndpoint is same as RegisterBackendServiceHandler but
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterBackendServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
conn, err := grpc.DialContext(ctx, endpoint, opts...)
conn, err := grpc.Dial(endpoint, opts...)
if err != nil {
return err
}
@ -291,21 +285,19 @@ func RegisterBackendServiceHandlerClient(ctx context.Context, mux *runtime.Serve
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/openmatch.BackendService/FetchMatches", runtime.WithHTTPPathPattern("/v1/backendservice/matches:fetch"))
rctx, err := runtime.AnnotateContext(ctx, mux, req, "/openmatch.BackendService/FetchMatches")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_BackendService_FetchMatches_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
resp, md, err := request_BackendService_FetchMatches_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_BackendService_FetchMatches_0(annotatedContext, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...)
forward_BackendService_FetchMatches_0(ctx, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...)
})
@ -313,21 +305,19 @@ func RegisterBackendServiceHandlerClient(ctx context.Context, mux *runtime.Serve
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/openmatch.BackendService/AssignTickets", runtime.WithHTTPPathPattern("/v1/backendservice/tickets:assign"))
rctx, err := runtime.AnnotateContext(ctx, mux, req, "/openmatch.BackendService/AssignTickets")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_BackendService_AssignTickets_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
resp, md, err := request_BackendService_AssignTickets_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_BackendService_AssignTickets_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
forward_BackendService_AssignTickets_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
@ -335,21 +325,19 @@ func RegisterBackendServiceHandlerClient(ctx context.Context, mux *runtime.Serve
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/openmatch.BackendService/ReleaseTickets", runtime.WithHTTPPathPattern("/v1/backendservice/tickets:release"))
rctx, err := runtime.AnnotateContext(ctx, mux, req, "/openmatch.BackendService/ReleaseTickets")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_BackendService_ReleaseTickets_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
resp, md, err := request_BackendService_ReleaseTickets_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_BackendService_ReleaseTickets_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
forward_BackendService_ReleaseTickets_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
@ -357,21 +345,19 @@ func RegisterBackendServiceHandlerClient(ctx context.Context, mux *runtime.Serve
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/openmatch.BackendService/ReleaseAllTickets", runtime.WithHTTPPathPattern("/v1/backendservice/tickets:releaseall"))
rctx, err := runtime.AnnotateContext(ctx, mux, req, "/openmatch.BackendService/ReleaseAllTickets")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_BackendService_ReleaseAllTickets_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
resp, md, err := request_BackendService_ReleaseAllTickets_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_BackendService_ReleaseAllTickets_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
forward_BackendService_ReleaseAllTickets_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})

Some files were not shown because too many files have changed in this diff Show More