Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implements GetCounter and UpdateCounter on the SDK Server #3322

Merged
merged 18 commits into from
Sep 11, 2023

Conversation

igooch
Copy link
Collaborator

@igooch igooch commented Aug 11, 2023

What type of PR is this?

/kind feature

What this PR does / Why we need it:

Implements GetCounter and UpdateCounter on the SDK Server for feature Counts and Lists.
Removes the LocalSDKServer code for UpdateCounter as this followed the previous version of the alpha.proto.

Which issue(s) this PR fixes:

Working on #2716

Special notes for your reviewer:

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 42f7ef43-2752-41fd-b50f-c88a99a53b5d

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@igooch igooch force-pushed the arbitrary-counts-lists-2716 branch from 7bcc72d to afe8590 Compare August 11, 2023 21:20
@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: ed0533ab-072b-48d1-ae7c-9a221c392268

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/googleforgames/agones.git pull/3322/head:pr_3322 && git checkout pr_3322
  • helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.34.0-dev-5fac84a-amd64

@igooch igooch force-pushed the arbitrary-counts-lists-2716 branch from 5fac84a to 074353c Compare August 18, 2023 23:17
@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 521463c0-afcf-4c92-a1ca-200096e28e9f

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/googleforgames/agones.git pull/3322/head:pr_3322 && git checkout pr_3322
  • helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.35.0-dev-074353c-amd64

@google-oss-prow google-oss-prow bot added size/XL and removed size/L labels Aug 22, 2023
@igooch igooch force-pushed the arbitrary-counts-lists-2716 branch from 87fdb29 to c843318 Compare August 22, 2023 17:08
@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 456b779f-4fc0-4967-85ac-1f789239d1ee

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 73ff5c59-740b-43b4-8272-c422c2e7c752

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

Copy link
Member

@markmandel markmandel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Dropped a bunch of comments mostly around how we can avoid some race conditions as part of the process of batching and keeping an in memory cache, and hopefully some help with some simplification.

pkg/sdkserver/sdkserver.go Outdated Show resolved Hide resolved
pkg/sdkserver/sdkserver.go Outdated Show resolved Hide resolved
pkg/sdkserver/sdkserver.go Outdated Show resolved Hide resolved
pkg/sdkserver/sdkserver.go Show resolved Hide resolved
pkg/sdkserver/sdkserver.go Show resolved Hide resolved
pkg/sdkserver/sdkserver.go Outdated Show resolved Hide resolved
pkg/sdkserver/sdkserver.go Outdated Show resolved Hide resolved
pkg/sdkserver/sdkserver.go Outdated Show resolved Hide resolved
@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 2a3ee945-f307-47b6-9248-1a5e4261c1ee

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 8788b57b-a7d9-4916-a1d2-841bbd5d5af3

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@igooch igooch force-pushed the arbitrary-counts-lists-2716 branch from a9169c9 to 4a45e93 Compare August 25, 2023 22:26
@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 444f2a60-415e-46a9-82d0-adad0a318946

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 1c32d065-5350-4064-aaa1-fb5490152739

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: fb5db2c6-7c11-4137-bfa5-62de6c6a741a

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@igooch igooch force-pushed the arbitrary-counts-lists-2716 branch from cd75892 to db7b6c4 Compare August 28, 2023 22:26
@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: bd7aaa9f-1748-4263-bb39-8c417e2c4719

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: ead5eefd-49eb-421d-bb14-86edc3c51181

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

pkg/sdkserver/sdkserver.go Outdated Show resolved Hide resolved
@google-oss-prow
Copy link

New changes are detected. LGTM label has been removed.

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 448b6b4a-b634-4989-ac4f-fc79216fff1f

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@markmandel
Copy link
Member

sigh

   gameserver_test.go:953: 
        	Error Trace:	/go/src/agones.dev/agones/test/e2e/gameserver_test.go:953
        	Error:      	Not equal: 
        	            	expected: "spec.template.spec.containers[0].resources.requests[cpu]"
        	            	actual  : "spec.template.spec.containers[0].resources.requests"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -1 +1 @@
        	            	-spec.template.spec.containers[0].resources.requests[cpu]
        	            	+spec.template.spec.containers[0].resources.requests
        	Test:       	TestGameServerResourceValidation

If the GameServer has been successfully updated by the client in the updateCounter this updated version is stored in the SDK. If the s.gameServer() is called and the Generation of the gameServer is less than (older than) the version stored in the SDK, then the SDK version is returned.
The diff will be a single aggregated number that may be truncated if final Count of the Counter would be less than zero or greater than capacity. This means a request to increment or decrement a Counter may only be partially applied.
…ater than Capacity after decrementation

Also adds tests.
This logic followed a previous version of the proto for UpdateCounter.
Largest change is to truncate any existing Count to the Capacity, so that Count is always less than or equal to Capacity on any change.
@markmandel
Copy link
Member

Sorry - should have been clear - the sigh was because the flake is showing up. This PR is great 😄

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 5c115fa5-b443-4ce8-938f-5076991bf05a

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: a02ec040-866e-4706-a9be-fffc85696203

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/googleforgames/agones.git pull/3322/head:pr_3322 && git checkout pr_3322
  • helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.35.0-dev-802f1cb-amd64

@markmandel markmandel merged commit 9deb15f into googleforgames:main Sep 11, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants