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

Test in place upgrades run tests #3991

Merged
merged 9 commits into from
Sep 23, 2024

Conversation

igooch
Copy link
Collaborator

@igooch igooch commented Sep 20, 2024

What type of PR is this?

/kind feature

What this PR does / Why we need it:

  • Creates Game Server that run the sdk-client-test through Agones upgrades. The test fails if too many Game Servers end up in a CrashBackOff loop. It is expected that 0-2 Game Servers per version will not be healthy, as the first Game Server created immediately following an Agones installation may fail due to the cluster not being scaled up.
  • This tests that the Game Servers continue to function during upgrade, and that Game Servers with an older binary version continue to function with newer SDK versions.
  • Templates the Counters and Lists in the game server. We need these values templated because the sdk-client-test must have this Counter and List defined in the Game Server when CountsAndLists is enabled, and the Game Server cannot be applied to a cluster if a Counter or List is defined and CountsAndLists is not enabled.

Which issue(s) this PR fixes:

Working on #3795

Special notes for your reviewer:

The us-docker.pkg.dev/agones-images/ci/sdk-client-test still needs to be created, and have the sdk-client-test built at each release version noted in the versionMap and pushed to the new repo.

@igooch igooch requested a review from gongmax September 20, 2024 17:59
@github-actions github-actions bot added kind/feature New features for Agones size/M labels Sep 20, 2024
@agones-bot
Copy link
Collaborator

Build Failed 😭

Build Id: 8699fd0e-6194-4109-b397-5419d75b2fd9

Status: FAILURE

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

@igooch igooch force-pushed the testInPlaceUpgrades branch from 89b7238 to cc8e2b2 Compare September 20, 2024 18:32
@@ -105,6 +105,9 @@ func main() {
testLists(sdk)
}

// Delay before shutdown to prevent Game Servers from churning too quickly on a running cluster
time.Sleep(8 * time.Second)
Copy link
Collaborator

Choose a reason for hiding this comment

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

How is this value decided? Just curious whether make it configurable can make it easy to use.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

From manually testing different values. 5 seconds led to more unhealthy game servers, and same for 10 seconds. It would be nice to have it configurable, but that might be hard to do since the sdk-client-test binary is built at a release version (1.38, 1.39, etc.), and not at run time.

@@ -337,3 +370,96 @@ func createGameServerFile(agonesVersion string) string {

return gsPath
}

// Create a game server every ten seconds until the context is cancelled. The game server container
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you have a sense how many gameservers are created for each Agones version?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It takes ~1 min to install Agones, so ~60 sec / 10 sec per version. We can certainly up that value (I had it at 5 sec on an earlier iteration).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I put it back at create every 5 sec, and also added in wait time at each version to increase number game servers created.

@agones-bot
Copy link
Collaborator

Build Succeeded 🥳

Build Id: 35d028e2-39bf-4f47-928b-ccf9fceb8149

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/3991/head:pr_3991 && git checkout pr_3991
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.44.0-dev-cc8e2b2

@agones-bot
Copy link
Collaborator

Build Succeeded 🥳

Build Id: 553e3dd2-2a5e-4d1b-9f23-9d2f030131b7

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/3991/head:pr_3991 && git checkout pr_3991
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.44.0-dev-6d7c728

log.Fatal("Not able to create AddEventHandler", err)
}

go podInformer.Run(stopCh)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I still don't quite get the usage of the stopCh here. Seems no one is sending signal to stopCh, so this line is equal to go podInformer.Run()? If so when does this go routine get stopped?

Copy link
Collaborator Author

@igooch igooch Sep 21, 2024

Choose a reason for hiding this comment

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

It's a required paramenter for the .Run() function. I think it's used instead of context.Context to stop the informer anywhere in the code. We don't use it since we want the informer to run until the main thread completes.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh I see, I thought it's optional :)

@agones-bot
Copy link
Collaborator

Build Succeeded 🥳

Build Id: a3b534b5-8026-4f70-b401-7f076895c384

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/3991/head:pr_3991 && git checkout pr_3991
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.44.0-dev-fd9a886

@gongmax gongmax merged commit 6a7d2af into googleforgames:main Sep 23, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature New features for Agones size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants