Git Product home page Git Product logo

Comments (13)

markmandel avatar markmandel commented on June 27, 2024

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.

from agones.

markmandel avatar markmandel commented on June 27, 2024

FYI: @igooch just to make sure you see this.

from agones.

Tsm012 avatar Tsm012 commented on June 27, 2024

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.

apiVersion: "agones.dev/v1"
kind: Fleet
metadata:
  name: simple-game-server-fleet
spec:
  replicas: 1
  template:
    spec:
      sdkServer:
        logLevel: Debug
      lists:
        players:
          capacity: 3
          values:
          - player1
          - player2
          - player3
      container: simple-game-server
      template:
        spec:
          containers:
            - name: simple-game-server
              image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.31
            - name: alpine   
              image: alpine/curl 
              command: ["sleep"]         # Override the container entrypoint with a simple sleep command
              args: ["1000000"]  

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

{"error":"not a valid logrus Level: \"\"","message":"Invalid LOG_LEVEL value. Defaulting to 'info'.","severity":"warning","time":"2024-06-13T23:37:24.349150707Z"}

{"ctlConf":{"GameServerName":"simple-game-server-fleet-kb5lx-lwd84","PodNamespace":"default","Address":"localhost","IsLocal":false,"LocalFile":"","Delay":0,"Timeout":0,"Test":"","TestSdkName":"","KubeConfig":"","GracefulTermination":true,"GRPCPort":9357,"HTTPPort":9358,"LogLevel":""},"featureGates":"AutopilotPassthroughPort=false\u0026CountsAndLists=true\u0026DisableResyncOnSDKServer=true\u0026Example=false\u0026GKEAutopilotExtendedDurationPods=false\u0026PlayerAllocationFilter=false\u0026PlayerTracking=false\u0026PortPolicyNone=false\u0026PortRanges=false\u0026RollingUpdateFix=false","message":"Starting sdk sidecar","severity":"info","source":"main","time":"2024-06-13T23:37:24.349276227Z","version":"1.41.0"}

{"gsKey":"default/simple-game-server-fleet-kb5lx-lwd84","message":"Created GameServer sidecar","severity":"info","source":"*sdkserver.SDKServer","time":"2024-06-13T23:37:24.350165213Z"}

{"gsKey":"default/simple-game-server-fleet-kb5lx-lwd84","message":"Connection to Kubernetes service established","severity":"info","source":"*sdkserver.SDKServer","time":"2024-06-13T23:37:24.359130873Z","try":0}             

{"grpcEndpoint":"localhost:9357","message":"Starting SDKServer grpc service...","severity":"info","source":"main","time":"2024-06-13T23:37:24.359724909Z"}

{"gsKey":"default/simple-game-server-fleet-kb5lx-lwd84","message":"Starting workers...","queue":"agones.dev.default.simple-game-server-fleet-kb5lx-lwd84","severity":"info","source":"*sdkserver.SDKServer","time":"2024-06-13T23:37:24.460172777Z","workers":1}

{"httpEndpoint":"localhost:9358","message":"Starting SDKServer grpc-gateway...","severity":"info","source":"main","time":"2024-06-13T23:37:25.361356656Z"}

from agones.

igooch avatar igooch commented on June 27, 2024

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.

// UpdateList collapses all update capacity requests for a given List into a single UpdateList request.
// This function currently only updates the Capacity of a List.
// Returns error if the List does not exist (name cannot be updated).
// Returns error if the List update capacity is out of range [0,1000].
// [Stage:Beta]
// [FeatureFlag:CountsAndLists]
func (s *SDKServer) UpdateList(ctx context.Context, in *beta.UpdateListRequest) (*beta.List, error) {
if !runtime.FeatureEnabled(runtime.FeatureCountsAndLists) {
return nil, errors.Errorf("%s not enabled", runtime.FeatureCountsAndLists)
}
if in == nil {
return nil, errors.Errorf("UpdateListRequest cannot be nil")
}
name := in.List.Name
s.logger.WithField("name", name).Debug("Update List -- Currently only used for Updating Capacity")
gs, err := s.gameServer()
if err != nil {
return nil, err
}
s.gsUpdateMutex.Lock()
defer s.gsUpdateMutex.Unlock()
if in.List.Capacity < 0 || in.List.Capacity > apiserver.ListMaxCapacity {
return nil, errors.Errorf("out of range. Capacity must be within range [0,1000]. Found Capacity: %d", in.List.Capacity)
}
if _, ok := gs.Status.Lists[name]; ok {
batchList := s.gsListUpdates[name]
batchList.capacitySet = &in.List.Capacity
s.gsListUpdates[name] = batchList
// Queue up the Update for later batch processing by updateLists.
s.workerqueue.Enqueue(cache.ExplicitKey(updateLists))
return &beta.List{}, nil
}
return nil, errors.Errorf("not found. %s List not found", name)
}

from agones.

Tsm012 avatar Tsm012 commented on June 27, 2024

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.

from agones.

markmandel avatar markmandel commented on June 27, 2024

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.

from agones.

Tsm012 avatar Tsm012 commented on June 27, 2024

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.

from agones.

markmandel avatar markmandel commented on June 27, 2024

Our game server maintains a list of data needed to connect to it that is used by our match maker.

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?

from agones.

Tsm012 avatar Tsm012 commented on June 27, 2024

is the matchmaker communicating this list somehow?

Yes, our match maker is using the agones sdk to pull list information for game servers to use in the match making process.

from agones.

markmandel avatar markmandel commented on June 27, 2024

Yes, our match maker is using the agones sdk

... okay now I'm really curious. The Agones SDK can only talk to a single GameServer - unless your match maker talks to the game server binary (somehow?) and the server does the work against it's own GameServer record through the SDK?

from agones.

igooch avatar igooch commented on June 27, 2024

@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?

from agones.

appleturnoverload avatar appleturnoverload commented on June 27, 2024

Yes, our match maker is using the agones sdk

... okay now I'm really curious. The Agones SDK can only talk to a single GameServer - unless your match maker talks to the game server binary (somehow?) and the server does the work against it's own GameServer record through the SDK?

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.

from agones.

markmandel avatar markmandel commented on June 27, 2024

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.

from agones.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.