-
Notifications
You must be signed in to change notification settings - Fork 823
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
Beta: UpdateList using Agones 1.41 rest API doesn't update the data in the selected list #3870
Comments
Can you share the logs from the sdk-server sidecar? If you have a gameserver or fleet.yaml you could share with a setup that easy to replicate this, would also be handy. |
FYI: @igooch just to make sure you see this. |
Here is a simplified version of a fleet resource that you can deploy. This is happening in both AWS EKS and locally in minikube. If you shell into the alpine container, you can run the curl commands to replicate.
here is the tail from the agones sidecar, setting the log info to debug doesn't seem to add any additional info even though doing a describe on the pod seems to say the LOG_LEVEL environment variable is set to Debug
|
Looks like I implemented the UpdateList to only update the capacity, since all the other SDKs only use it for changing the capacity. The List values can be changed by addValue or removeValue. @Tsm012 do the addValue and removeValue work for your use case, or do you need to overwrite the value list? @markmandel we should update the documentation to reflect that as-is it only updates the capacity. agones/pkg/sdkserver/sdkserver.go Lines 1056 to 1094 in 6bc20a1
|
We could make it work using the add/remove value calls. The source of truth for this data is on the gameserver so one call to update all the data in the list based on data from the game server would be really nice. |
I'm curious your use case for overwriting a total list? Usually we see people wanting to add/remove, but not overwrite. Do you have one in mind. @igooch - 100% agree the docs need to be updated. |
Our game server maintains a list of data needed to connect to it that is used by our match maker. This data is constantly changing as players join and leave different servers and changes in the data can happen very frequently. This list of data is always authoritative. Instead of having to constantly check what has changed in the list maintained by the server and what was the last state of the list in Agones and adding and removing entries one at a time using multiple rest calls, It would be nice to be able to take a snapshot of what the current authoritative list is on the server and replace the list in Agones with one call. |
More for curiosities sake - is the matchmaker communicating this list somehow? or is the game server process maintaining this list within itself? or something else? |
Yes, our match maker is using the agones sdk to pull list information for game servers to use in the match making process. |
... okay now I'm really curious. The Agones SDK can only talk to a single |
@markmandel I took a look at the docs, and they were tested against the LocalSDKServer which does overwrite both the capacity and the values. I'll make a separate issue for the documentation updates. (An aside that UpdateCounter is working as expected, although it also returns an empty object.) Do we want to update the SDK Server to also overwrite the values? |
Just to clarify this, we are currently using the k8s API here https://agones.dev/site/docs/guides/access-api/ to get all the info from the game servers in one go rather than using the SDK itself to get data about individual game servers. So the way it's working is that the server is responsible for maintaining some of the lists, which the matchmaking system reads from using the k8s API to make informed decisions (things like current players, player capacity). Then on allocate, the matchmaking system will add some values to another list to record the fact that players are expecting to join the game server and the server will receive this change by listening to changes through the SDK. We are expecting to have a slightly less heavy handed way of getting server state into the matchmaking system by streaming changes through the k8s API rather than just getting all the game servers in bulk. |
Sounds like this is actually a K8s API thing you are doing, and not part of the SDK -- so we can close this issue now I believe. |
Hello, I have been following this and would like to try to update the UpdateList SDK code to support changing list values. I have some changes locally but am unable to follow the Minikube testing procedures. Specifically, I am getting stuck during the
It seems as though the docker container is starting in the Docker Desktop WSL distro that was created when installing docker desktop. Is this the expected behavior? Additionally, I noticed that I was not immediately switched to agones context when running My development environment is:
Should this be a separate issue? Am I missing something here? |
@chrisfoster121 could you repost on the Slack channel to see if anyone there has run into this issue that could help? |
@igooch That link looks to have expired. It says "This link is no longer active". Additionally, I have been able to work around this by doing all of my work in a Ubuntu VM on Hyper-V. How would I be able to get my SDK code running as the Agones sidecar? I have been able to push and install the controller, extensions, and ping images but that does not seem to impact the sidecar that gets run. |
@Tsm012 @markmandel @igooch I believe I have a fix for this that I have tested. I am going to look at cleaning this up and see about getting this in (following the contribution guidelines). It would be incredible if we could get this into the next stable release coming next Tuesday. |
Ah so it is, updating the link in #3896. Assuming you have the Agones repo cloned locally and are making changes there, go into the agones/build directory and run |
What happened:
Attempting to use the Lists features in Agones 1.41. I have a fleet deployed in agones and am attempting to use the:
curl -d '{"capacity": "120", "values": ["player3", "player4"]}' -H "Content-Type: application/json" -X PATCH http://localhost:${AGONES_SDK_HTTP_PORT}/v1beta1/lists/players
call as mentioned in the rest documentation. The list is declared on our "kind: Fleet" resource and declares a list players
Once the fleet is deployed, I can run the command:
curl -H "Content-Type: application/json" -X GET http://localhost:${AGONES_SDK_HTTP_PORT}/v1beta1/lists/players
and will get the correct response.
{"name":"players","capacity":"20","values":["player1","player2","player3"]}
When I go to update that same list using the command:
curl -d '{"capacity": "20", "values": ["player3", "player4"]}' -H "Content-Type: application/json" -X PATCH http://localhost:${AGONES_SDK_HTTP_PORT}/v1beta1/lists/players
I get the response:
{"name":"","capacity":"0","values":[]}
I then check again to see if my list was updated:
curl -H "Content-Type: application/json" -X GET http://localhost:${AGONES_SDK_HTTP_PORT}/v1beta1/lists/players
but the reply seems to indicate nothing has changed.
{"name":"players","capacity":"20","values":["player1","player2","player3"]}
What you expected to happen:
I expected the list up update to reflect the data payload of
{"capacity": "20", "values": ["player3", "player4"]}
How to reproduce it (as minimally and precisely as possible):
Create a Fleet resource in agones and deploy it with a list declared as:
shell into a game server in the fleet just deployed and verify that your initial values are in the list
Attempt to update the list with new values
curl -d '{"capacity": "20", "values": ["player3", "player4"]}' -H "Content-Type: application/json" -X PATCH http://localhost:${AGONES_SDK_HTTP_PORT}/v1beta1/lists/players
after running the update list call, confirm that the list has not changed
Anything else we need to know?:
Environment:
kubectl version
): 1.29The text was updated successfully, but these errors were encountered: