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

Counts and Lists Aggregate Values for Fleet Status and GameServerSet Status #3180

Merged
merged 9 commits into from Jun 1, 2023

Conversation

igooch
Copy link
Collaborator

@igooch igooch commented May 23, 2023

What type of PR is this?

/kind feature

What this PR does / Why we need it:

Aggregates the Counter (Count/Capacity) and List (Capacity/Values) across GamerServerSets and Fleet.

Counters and Lists are only aggregated on GamerServerSets when GameServer.Status is Allocated, Ready, or Reserved.

Updates the Fleet and GameServerSet CRDs to aggregate the List values to a total Count rather than listing all values in an array, which could get extremely long. This change is in keeping with the sample Fleet Status outlined in #2716.

Which issue(s) this PR fixes:

Working on #2716

Special notes for your reviewer:

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 4f5ff05b-d303-4195-91dc-eb4e73a62589

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 2 times, most recently from 40b9ce9 to ddf3781 Compare May 23, 2023 23:03
@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: b2ec6976-4774-440e-8072-a181a314dbdc

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

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 27f89878-c098-4d70-9023-d23fed6679f2

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

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 77a0bc76-00a0-4c3e-b6f9-74347132b322

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

pkg/fleets/controller.go Outdated Show resolved Hide resolved
pkg/fleets/controller.go Outdated Show resolved Hide resolved
pkg/gameserversets/controller.go Outdated Show resolved Hide resolved
@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: bd09a83d-38d2-4f24-b8e7-4fe2a8c524c3

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/3180/head:pr_3180 && git checkout pr_3180
  • 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.33.0-d8769a2-amd64

@igooch igooch force-pushed the arbitrary-counts-lists-2716 branch from d8769a2 to 425a146 Compare May 24, 2023 22:04
@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: a61b96d0-a486-432b-a554-fee23ef7c6cb

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/3180/head:pr_3180 && git checkout pr_3180
  • 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.33.0-425a146-amd64

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 6c72e72e-af6a-4318-95c5-485fdc19fe63

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/3180/head:pr_3180 && git checkout pr_3180
  • 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.33.0-1d97ba6-amd64

@igooch igooch force-pushed the arbitrary-counts-lists-2716 branch from c3c60d7 to 4b03d48 Compare May 25, 2023 17:20
@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 70b93287-ec31-4465-990b-d1ca65346263

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 2 times, most recently from 5d2ace3 to 869a816 Compare May 25, 2023 21:09
@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: c654502f-86bc-4215-967a-31c2220e4a61

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/3180/head:pr_3180 && git checkout pr_3180
  • 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.33.0-869a816-amd64

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 474199c6-5c97-4a15-b0e9-caad66b87c7c

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

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: b23a65e9-8c70-475d-ab1b-e3db5ed0cf47

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/3180/head:pr_3180 && git checkout pr_3180
  • 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.33.0-30e170f-amd64

@igooch igooch force-pushed the arbitrary-counts-lists-2716 branch from 30e170f to 84c2677 Compare May 26, 2023 18:25
@google-oss-prow google-oss-prow bot removed the lgtm label May 26, 2023
@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 4a67bb25-db02-4e13-8740-d5772d131df1

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

@markmandel
Copy link
Member

Looks like that's a pretty consistent failure:

--- FAIL: TestControllerUpdateFleetPlayerStatus (0.13s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x22c5eb9]

goroutine 9 [running]:
testing.tRunner.func1.2({0x24b8740, 0x37be820})
	/usr/local/go/src/testing/testing.go:1526 +0x372
testing.tRunner.func1()
	/usr/local/go/src/testing/testing.go:1529 +0x650
panic({0x24b8740, 0x37be820})
	/usr/local/go/src/runtime/panic.go:890 +0x263
agones.dev/agones/pkg/fleets.TestControllerUpdateFleetPlayerStatus.func2({0x2a6f6b8?, 0xc00021cc40})
	/go/src/agones.dev/agones/pkg/fleets/controller_test.go:675 +0x199
k8s.io/client-go/testing.(*SimpleReactor).React(0xc00081e720, {0x2a6f6b8, 0xc00021cc40})
	/go/src/agones.dev/agones/vendor/k8s.io/client-go/testing/fixture.go:530 +0x5d
k8s.io/client-go/testing.(*Fake).Invokes(0xc0001248f0, {0x2a6f6b8, 0xc00021c9a0}, {0x2a56638, 0xc0001df200})
	/go/src/agones.dev/agones/vendor/k8s.io/client-go/testing/fake.go:145 +0x34b
agones.dev/agones/pkg/client/clientset/versioned/typed/agones/v1/fake.(*FakeFleets).UpdateStatus(0xc000d64108, {0x4adb65?, 0x5bc951?}, 0xc0001dec00, {{{0x0, 0x0}, {0x0, 0x0}}, {0x0, 0x0, ...}, ...})
	/go/src/agones.dev/agones/pkg/client/clientset/versioned/typed/agones/v1/fake/fake_fleet.go:110 +0x24a
agones.dev/agones/pkg/fleets.(*Controller).updateFleetStatus(0xc00039fe80, {0x2a6c7a8, 0xc00081e750}, 0xc0006bac00)
	/go/src/agones.dev/agones/pkg/fleets/controller.go:683 +0x9d3
agones.dev/agones/pkg/fleets.TestControllerUpdateFleetPlayerStatus(0xc000102680)
	/go/src/agones.dev/agones/pkg/fleets/controller_test.go:684 +0xc3e
testing.tRunner(0xc000102680, 0x27f1210)
	/usr/local/go/src/testing/testing.go:1576 +0x217
created by testing.(*T).Run
	/usr/local/go/src/testing/testing.go:1629 +0x806

@igooch
Copy link
Collaborator Author

igooch commented May 30, 2023

Looks like that's a pretty consistent failure:

--- FAIL: TestControllerUpdateFleetPlayerStatus (0.13s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference

Yeah, when each unit test is run individually the tests pass, but when run as a file at least one of CounterStatus or ListStatus or Players fails with the expected result field being nil. I'm guessing this is some sort of issue with the mocks being run in parallel and field value getting overridden. I can't figure out how to run the debugger on multiple tests at once, so I've been unsuccessful in finding where exactly this is going wrong. I'm going to update the CounterStatus and ListStatus tests to mimic the Players test setup which seems to resolve the issue.

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: af40d7be-c40d-45de-929f-947c9cf90c32

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 2f734a2 to e1fb905 Compare May 30, 2023 19:22
@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 95e0a11f-9865-4358-b279-a7068d5f071e

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/3180/head:pr_3180 && git checkout pr_3180
  • 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.33.0-e1fb905-amd64

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: dc8a5fb9-e311-42b0-b87a-36f85800a2fd

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/3180/head:pr_3180 && git checkout pr_3180
  • 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.33.0-3380463-amd64

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.

Approved!

Left a few non-blocking questions for you in case they made sense.

pkg/fleets/controller.go Show resolved Hide resolved
pkg/fleets/controller_test.go Outdated Show resolved Hide resolved
pkg/gameserversets/controller.go Outdated Show resolved Hide resolved
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.

Approved!

Left a few non-blocking questions for you in case they made sense.

@google-oss-prow google-oss-prow bot added the lgtm label Jun 1, 2023
@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gongmax, igooch, markmandel

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

1 similar comment
@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gongmax, igooch, markmandel

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow
Copy link

New changes are detected. LGTM label has been removed.

@google-oss-prow google-oss-prow bot removed the lgtm label Jun 1, 2023
@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 7f3a2954-896a-4b3f-a477-10fa7c1d95e5

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

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 7b127aa0-2b88-4788-9758-c2ce8250b024

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

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: e72fe129-9886-46ac-8acf-caddad92fa13

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

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 1eaeb6bb-3223-496e-a065-744be16278c4

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/3180/head:pr_3180 && git checkout pr_3180
  • 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.33.0-31614a8-amd64

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 3ed9a08d-a02c-4ed3-926f-ed89201c1474

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/3180/head:pr_3180 && git checkout pr_3180
  • 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.33.0-702d346-amd64

@gongmax gongmax merged commit 02365d2 into googleforgames:main Jun 1, 2023
2 checks passed
@Kalaiselvi84 Kalaiselvi84 added the kind/feature New features for Agones label Jul 5, 2023
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.

None yet

5 participants