Skip to content

Commit 4b8761a

Browse files
mriduljikemurayamasyntxerror
authored
release 1.6.0-rc.1 changes (#1510)
* Default values of configs (#1508) * setting validation and default values of configs * config check in internal/config package * Add open-match-override setting (#1490) * Add open-match-override setting * Added enabled Co-authored-by: Jon Foust <38893532+syntxerror@users.noreply.github.com> Co-authored-by: Mridul Goswami <mridulgoswami@google.com> * shifted e2e tests to project root (#1481) * release 1.6.0-rc.1 changes * release changes for tutorials * remaining changes Co-authored-by: kemurayama <7068107+kemurayama@users.noreply.github.com> Co-authored-by: Jon Foust <38893532+syntxerror@users.noreply.github.com>
1 parent 1e51ad8 commit 4b8761a

File tree

55 files changed

+149
-32
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+149
-32
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
# If you want information on how to edit this file checkout,
5454
# http://makefiletutorial.com/
5555

56-
BASE_VERSION = 0.0.0-dev
56+
BASE_VERSION = 1.6.0-rc.1
5757
SHORT_SHA = $(shell git rev-parse --short=7 HEAD | tr -d [:punct:])
5858
BRANCH_NAME = $(shell git rev-parse --abbrev-ref HEAD | tr -d [:punct:])
5959
VERSION = $(BASE_VERSION)-$(SHORT_SHA)

cloudbuild.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ artifacts:
164164
- install/yaml/06-open-match-override-configmap.yaml
165165

166166
substitutions:
167-
_OM_VERSION: "0.0.0-dev"
167+
_OM_VERSION: "1.6.0-rc.1"
168168
_GCB_POST_SUBMIT: "0"
169169
_GCB_LATEST_VERSION: "undefined"
170170
_ARTIFACTS_BUCKET: "gs://open-match-build-artifacts/output/"

install/helm/open-match/Chart.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
# limitations under the License.
1414

1515
apiVersion: v2
16-
appVersion: "0.0.0-dev"
17-
version: 0.0.0-dev
16+
appVersion: "1.6.0-rc.1"
17+
version: 1.6.0-rc.1
1818
name: open-match
1919
dependencies:
2020
- name: redis

install/helm/open-match/templates/om-configmap-override.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
{{- if index .Values "open-match-override" }}
15+
{{- if index .Values "open-match-override" "enabled" }}
1616
apiVersion: v1
1717
kind: ConfigMap
1818
metadata:

install/helm/open-match/templates/tests/om-test.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ spec:
9191
command: ["go"]
9292
args:
9393
- "test"
94-
- "./internal/testing/e2e"
94+
- "./testing/e2e"
9595
- "-v"
9696
- "-timeout"
9797
- "150s"

install/helm/open-match/values-production.yaml

+5-1
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,10 @@ open-match-customize:
230230
# function:
231231
# image: [YOUR_MMF_IMAGE]
232232

233+
# Controls if users need to install open-match-override ConfigMap.
234+
open-match-override:
235+
enabled: false
236+
233237
# Global configurations that are visible to all subcharts
234238
global:
235239
kubernetes:
@@ -292,7 +296,7 @@ global:
292296
# Use this field if you need to override the image registry and image tag for all services defined in this chart
293297
image:
294298
registry: gcr.io/open-match-public-images
295-
tag: 0.0.0-dev
299+
tag: 1.6.0-rc.1
296300
pullPolicy: Always
297301

298302
# Expose the telemetry configurations to all subcharts because prometheus, for example,

install/helm/open-match/values.yaml

+5-1
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,10 @@ open-match-customize:
228228
# function:
229229
# image: [YOUR_MMF_IMAGE]
230230

231+
# Controls if users need to install open-match-override ConfigMap.
232+
open-match-override:
233+
enabled: false
234+
231235
# Global configurations that are visible to all subcharts
232236
global:
233237
kubernetes:
@@ -290,7 +294,7 @@ global:
290294
# Use this field if you need to override the image registry and image tag for all services defined in this chart
291295
image:
292296
registry: gcr.io/open-match-public-images
293-
tag: 0.0.0-dev
297+
tag: 1.6.0-rc.1
294298
pullPolicy: Always
295299

296300
# Expose the telemetry configurations to all subcharts because prometheus, for example,

internal/config/config.go

+24
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,30 @@ func Read() (*viper.Viper, error) {
5858
return nil, fmt.Errorf("fatal error reading override config file, desc: %s", err.Error())
5959
}
6060

61+
if !cfg.IsSet("registrationInterval") {
62+
log.Printf("config: registrationInterval is not set in matchmaker_config_override.yaml")
63+
}
64+
65+
if !cfg.IsSet("proposalCollectionInterval") {
66+
log.Printf("config: proposalCollectionInterval is not set in matchmaker_config_override.yaml")
67+
}
68+
69+
if !cfg.IsSet("pendingReleaseTimeout") {
70+
log.Printf("config: pendingReleaseTimeout is not set in matchmaker_config_override.yaml")
71+
}
72+
73+
if !cfg.IsSet("assignedDeleteTimeout") {
74+
log.Printf("config: assignedDeleteTimeout is not set in matchmaker_config_override.yaml")
75+
}
76+
77+
if !cfg.IsSet("queryPageSize") {
78+
log.Printf("config: queryPageSize is not set in matchmaker_config_override.yaml")
79+
}
80+
81+
if !cfg.IsSet("backfillLockTimeout") {
82+
log.Printf("config: backfillLockTimeout is not set in matchmaker_config_override.yaml")
83+
}
84+
6185
// Look for updates to the config; in Kubernetes, this is implemented using
6286
// a ConfigMap that is written to the matchmaker_config_override.yaml file, which is
6387
// what the Open Match components using Viper monitor for changes.

internal/rpc/clients_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ import (
3030
"google.golang.org/grpc"
3131
"open-match.dev/open-match/internal/config"
3232
"open-match.dev/open-match/internal/telemetry"
33-
shellTesting "open-match.dev/open-match/internal/testing"
3433
utilTesting "open-match.dev/open-match/internal/util/testing"
3534
"open-match.dev/open-match/pkg/pb"
35+
shellTesting "open-match.dev/open-match/testing"
3636
certgenTesting "open-match.dev/open-match/tools/certgen/testing"
3737
)
3838

internal/rpc/insecure_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424

2525
"github.com/stretchr/testify/require"
2626
"google.golang.org/grpc"
27-
shellTesting "open-match.dev/open-match/internal/testing"
27+
shellTesting "open-match.dev/open-match/testing"
2828
)
2929

3030
func TestInsecureStartStop(t *testing.T) {

internal/rpc/server_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ import (
2525
"github.com/stretchr/testify/require"
2626
"google.golang.org/grpc"
2727
"open-match.dev/open-match/internal/telemetry"
28-
shellTesting "open-match.dev/open-match/internal/testing"
2928
utilTesting "open-match.dev/open-match/internal/util/testing"
3029
"open-match.dev/open-match/pkg/pb"
30+
shellTesting "open-match.dev/open-match/testing"
3131
)
3232

3333
func TestStartStopServer(t *testing.T) {

internal/rpc/tls_server_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ import (
2525
"github.com/stretchr/testify/require"
2626
"google.golang.org/grpc"
2727
"google.golang.org/grpc/credentials"
28-
shellTesting "open-match.dev/open-match/internal/testing"
2928
"open-match.dev/open-match/pkg/pb"
29+
shellTesting "open-match.dev/open-match/testing"
3030
certgenTesting "open-match.dev/open-match/tools/certgen/testing"
3131
)
3232

internal/statestore/backfill.go

+20-5
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ func (rb *redisBackend) UpdateBackfill(ctx context.Context, backfill *pb.Backfil
193193
}
194194
defer handleConnectionClose(&redisConn)
195195

196-
expired, err := isBackfillExpired(redisConn, backfill.Id, getBackfillReleaseTimeout(rb.cfg))
196+
expired, err := isBackfillExpired(redisConn, backfill.Id, getBackfillReleaseTimeoutFraction(rb.cfg))
197197
if err != nil {
198198
return err
199199
}
@@ -332,7 +332,7 @@ func (rb *redisBackend) UpdateAcknowledgmentTimestamp(ctx context.Context, id st
332332
}
333333
defer handleConnectionClose(&redisConn)
334334

335-
expired, err := isBackfillExpired(redisConn, id, getBackfillReleaseTimeout(rb.cfg))
335+
expired, err := isBackfillExpired(redisConn, id, getBackfillReleaseTimeoutFraction(rb.cfg))
336336
if err != nil {
337337
return err
338338
}
@@ -364,7 +364,7 @@ func (rb *redisBackend) GetExpiredBackfillIDs(ctx context.Context) ([]string, er
364364
}
365365
defer handleConnectionClose(&redisConn)
366366

367-
ttl := getBackfillReleaseTimeout(rb.cfg)
367+
ttl := getBackfillReleaseTimeoutFraction(rb.cfg)
368368
curTime := time.Now()
369369
endTimeInt := curTime.Add(-ttl).UnixNano()
370370
startTimeInt := 0
@@ -431,7 +431,7 @@ func (rb *redisBackend) GetIndexedBackfills(ctx context.Context) (map[string]int
431431
}
432432
defer handleConnectionClose(&redisConn)
433433

434-
ttl := getBackfillReleaseTimeout(rb.cfg)
434+
ttl := getBackfillReleaseTimeoutFraction(rb.cfg)
435435
curTime := time.Now()
436436
endTimeInt := curTime.Add(time.Hour).UnixNano()
437437
startTimeInt := curTime.Add(-ttl).UnixNano()
@@ -463,7 +463,22 @@ func (rb *redisBackend) GetIndexedBackfills(ctx context.Context) (map[string]int
463463
}
464464

465465
func getBackfillReleaseTimeout(cfg config.View) time.Duration {
466+
const (
467+
name = "pendingReleaseTimeout"
468+
// Default timeout to release backfill. This value
469+
// will be used if pendingReleaseTimeout is not configured.
470+
defaultpendingReleaseTimeout time.Duration = 1 * time.Minute
471+
)
472+
473+
if !cfg.IsSet(name) {
474+
return defaultpendingReleaseTimeout
475+
}
476+
477+
return cfg.GetDuration(name)
478+
}
479+
480+
func getBackfillReleaseTimeoutFraction(cfg config.View) time.Duration {
466481
// Use a fraction 80% of pendingRelease Tickets TTL
467-
ttl := cfg.GetDuration("pendingReleaseTimeout") / 5 * 4
482+
ttl := getBackfillReleaseTimeout(cfg) / 5 * 4
468483
return ttl
469484
}

internal/statestore/redis.go

+17-2
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ var (
4141

4242
// NewMutex returns a new distributed mutex with given name
4343
func (rb *redisBackend) NewMutex(key string) RedisLocker {
44-
m := redsync.NewMutex(fmt.Sprintf("lock/%s", key), rs.WithExpiry(rb.cfg.GetDuration("backfillLockTimeout")))
44+
m := redsync.NewMutex(fmt.Sprintf("lock/%s", key), rs.WithExpiry(getBackfillLockTimeout(rb.cfg)))
4545
return redisBackend{mutex: m}
4646
}
4747

48-
//Lock locks r. In case it returns an error on failure, you may retry to acquire the lock by calling this method again.
48+
// Lock locks r. In case it returns an error on failure, you may retry to acquire the lock by calling this method again.
4949
func (rb redisBackend) Lock(ctx context.Context) error {
5050
return rb.mutex.LockContext(ctx)
5151
}
@@ -246,3 +246,18 @@ func handleConnectionClose(conn *redis.Conn) {
246246
}).Debug("failed to close redis client connection.")
247247
}
248248
}
249+
250+
func getBackfillLockTimeout(cfg config.View) time.Duration {
251+
const (
252+
name = "backfillLockTimeout"
253+
// Default timeout to lock backfill. This value
254+
// will be used if backfillLockTimeout is not configured.
255+
defaultBackfillLockTimeout time.Duration = 1 * time.Minute
256+
)
257+
258+
if !cfg.IsSet(name) {
259+
return defaultBackfillLockTimeout
260+
}
261+
262+
return cfg.GetDuration(name)
263+
}

internal/statestore/ticket.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ func (rb *redisBackend) GetIndexedIDSet(ctx context.Context) (map[string]struct{
155155
}
156156
defer handleConnectionClose(&redisConn)
157157

158-
ttl := rb.cfg.GetDuration("pendingReleaseTimeout")
158+
ttl := getBackfillReleaseTimeout(rb.cfg)
159159
curTime := time.Now()
160160
endTimeInt := curTime.Add(time.Hour).UnixNano()
161161
startTimeInt := curTime.Add(-ttl).UnixNano()

internal/testing/e2e/README.md testing/e2e/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ of running the tests in a realistic setting where requests may not be routed to
1818
For a new test package under test/e2e/ do the following:
1919

2020
Copy the contents of internal/testing/e2e/main_test.go and change the package name and add
21-
the `open-match.dev/open-match/internal/testing/e2e` import.
21+
the `open-match.dev/open-match/testing/e2e` import.
2222

2323
Example (may be out of date):
2424
```golang
@@ -39,7 +39,7 @@ Example (may be out of date):
3939
package tickets
4040

4141
import (
42-
"open-match.dev/open-match/internal/testing/e2e"
42+
"open-match.dev/open-match/testing/e2e"
4343
"testing"
4444
)
4545

File renamed without changes.

internal/testing/e2e/cluster.go testing/e2e/cluster.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build e2ecluster
12
// +build e2ecluster
23

34
// Copyright 2019 Google LLC
@@ -25,7 +26,7 @@ import (
2526
"open-match.dev/open-match/internal/app/evaluator"
2627
"open-match.dev/open-match/internal/config"
2728
"open-match.dev/open-match/internal/statestore"
28-
mmfService "open-match.dev/open-match/internal/testing/mmf"
29+
mmfService "open-match.dev/open-match/testing/mmf"
2930
)
3031

3132
func start(t *testing.T, eval evaluator.Evaluator, mmf mmfService.MatchFunction) (config.View, func(time.Duration)) {

internal/testing/e2e/cluster_test.go testing/e2e/cluster_test.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build e2ecluster
12
// +build e2ecluster
23

34
// Copyright 2019 Google LLC
@@ -32,8 +33,8 @@ import (
3233
"open-match.dev/open-match/internal/app/evaluator"
3334
"open-match.dev/open-match/internal/appmain/apptest"
3435
"open-match.dev/open-match/internal/config"
35-
mmfService "open-match.dev/open-match/internal/testing/mmf"
3636
"open-match.dev/open-match/pkg/pb"
37+
mmfService "open-match.dev/open-match/testing/mmf"
3738
)
3839

3940
func TestServiceHealth(t *testing.T) {

internal/testing/e2e/common.go testing/e2e/common.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ import (
2525
"open-match.dev/open-match/internal/app/evaluator"
2626
"open-match.dev/open-match/internal/appmain/apptest"
2727
"open-match.dev/open-match/internal/config"
28-
mmfService "open-match.dev/open-match/internal/testing/mmf"
2928
"open-match.dev/open-match/pkg/pb"
29+
mmfService "open-match.dev/open-match/testing/mmf"
3030
)
3131

3232
var (
File renamed without changes.

internal/testing/e2e/in_memory.go testing/e2e/in_memory.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build !e2ecluster
12
// +build !e2ecluster
23

34
// Copyright 2019 Google LLC
@@ -31,7 +32,7 @@ import (
3132
"open-match.dev/open-match/internal/config"
3233
"open-match.dev/open-match/internal/rpc"
3334
"open-match.dev/open-match/internal/telemetry"
34-
mmfService "open-match.dev/open-match/internal/testing/mmf"
35+
mmfService "open-match.dev/open-match/testing/mmf"
3536
)
3637

3738
func start(t *testing.T, eval evaluator.Evaluator, mmf mmfService.MatchFunction) (config.View, func(time.Duration)) {
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

third_party/swaggerui/config.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"urls": [
3-
{"name": "Frontend", "url": "https://open-match.dev/api/v0.0.0-dev/frontend.swagger.json"},
4-
{"name": "Backend", "url": "https://open-match.dev/api/v0.0.0-dev/backend.swagger.json"},
5-
{"name": "Query", "url": "https://open-match.dev/api/v0.0.0-dev/query.swagger.json"},
6-
{"name": "MatchFunction", "url": "https://open-match.dev/api/v0.0.0-dev/matchfunction.swagger.json"},
7-
{"name": "Synchronizer", "url": "https://open-match.dev/api/v0.0.0-dev/synchronizer.swagger.json"},
8-
{"name": "Evaluator", "url": "https://open-match.dev/api/v0.0.0-dev/evaluator.swagger.json"}
3+
{"name": "Frontend", "url": "https://open-match.dev/api/v1.6.0-rc.1/frontend.swagger.json"},
4+
{"name": "Backend", "url": "https://open-match.dev/api/v1.6.0-rc.1/backend.swagger.json"},
5+
{"name": "Query", "url": "https://open-match.dev/api/v1.6.0-rc.1/query.swagger.json"},
6+
{"name": "MatchFunction", "url": "https://open-match.dev/api/v1.6.0-rc.1/matchfunction.swagger.json"},
7+
{"name": "Synchronizer", "url": "https://open-match.dev/api/v1.6.0-rc.1/synchronizer.swagger.json"},
8+
{"name": "Evaluator", "url": "https://open-match.dev/api/v1.6.0-rc.1/evaluator.swagger.json"}
99
]
1010
}

tutorials/custom_evaluator/director/Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ WORKDIR /app
1717
ENV GO111MODULE=on
1818

1919
COPY . .
20+
RUN go mod edit -replace open-match.dev/open-match@v0.0.0-dev=open-match.dev/open-match@v1.6.0-rc.1
21+
RUN go mod tidy
2022
RUN go build -o director .
2123

2224
CMD ["/app/director"]

tutorials/custom_evaluator/evaluator/Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ WORKDIR /app
1717
ENV GO111MODULE=on
1818

1919
COPY . .
20+
RUN go mod edit -replace open-match.dev/open-match@v0.0.0-dev=open-match.dev/open-match@v1.6.0-rc.1
21+
RUN go mod tidy
2022
RUN go build -o evaluator .
2123

2224
CMD ["/app/evaluator"]

tutorials/custom_evaluator/frontend/Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ WORKDIR /app
1717
ENV GO111MODULE=on
1818

1919
COPY . .
20+
RUN go mod edit -replace open-match.dev/open-match@v0.0.0-dev=open-match.dev/open-match@v1.6.0-rc.1
21+
RUN go mod tidy
2022
RUN go build -o frontend .
2123

2224
CMD ["/app/frontend"]

tutorials/custom_evaluator/matchfunction/Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ WORKDIR /app
1717
ENV GO111MODULE=on
1818

1919
COPY . .
20+
RUN go mod edit -replace open-match.dev/open-match@v0.0.0-dev=open-match.dev/open-match@v1.6.0-rc.1
21+
RUN go mod tidy
2022
RUN go build -o matchfunction .
2123

2224
CMD ["/app/matchfunction"]

tutorials/custom_evaluator/solution/director/Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ WORKDIR /app
1717
ENV GO111MODULE=on
1818

1919
COPY . .
20+
RUN go mod edit -replace open-match.dev/open-match@v0.0.0-dev=open-match.dev/open-match@v1.6.0-rc.1
21+
RUN go mod tidy
2022
RUN go build -o director .
2123

2224
CMD ["/app/director"]

0 commit comments

Comments
 (0)