Skip to content

Commit

Permalink
Update CountsAndLists from Alpha to Beta (#3824)
Browse files Browse the repository at this point in the history
* Update CountsAndLists from Alpha to Beta

* run make gen-api-docs

* uncomment CountsAndLists in fleet.md

* uncomment CountsAndLists  priorities on fleet.md, fleet.yaml

* alpha to beta in gs_test.go and allocation.proto

* run make gen-allocation-grpc

* include Counters and Lists in fleet.md

---------

Co-authored-by: igooch <[email protected]>
  • Loading branch information
Kalaiselvi84 and igooch committed May 16, 2024
1 parent 966228a commit 2023077
Show file tree
Hide file tree
Showing 16 changed files with 3,801 additions and 3,637 deletions.
2 changes: 1 addition & 1 deletion examples/counterfleetautoscaler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# limitations under the License.

#
# [Stage:Alpha]
# [Stage:Beta]
# [FeatureFlag:CountsAndLists]
# Example of a FleetAutoscaler - this is used to scale a Fleet automatically depending on the
# available capacity of a Counter across the fleet.
Expand Down
12 changes: 5 additions & 7 deletions examples/fleet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,13 @@ spec:
annotations:
otherkey: setthisvalue
#
# [Stage:Alpha]
# [Stage:Beta]
# [FeatureFlag:CountsAndLists]
# Which gameservers in the Fleet are most important to keep around - impacts scale down logic.
# priorities:
# - type: Counter # Whether a Counter or a List.
# key: rooms # The name of the Counter or List.
# order: Ascending # Default is "Ascending" so smaller capacity will be removed first on down scaling.
#
priorities:
- type: Counter # Whether a Counter or a List.
key: rooms # The name of the Counter or List.
order: Ascending # Default is "Ascending" so smaller capacity will be removed first on down scaling.
template:
# GameServer metadata
metadata:
Expand Down Expand Up @@ -108,7 +107,6 @@ spec:
- room1
- room2
- room3
#
# The GameServer's Pod template
template:
spec:
Expand Down
2 changes: 1 addition & 1 deletion examples/listfleetautoscaler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# limitations under the License.

#
# [Stage:Alpha]
# [Stage:Beta]
# [FeatureFlag:CountsAndLists]
# Example of a FleetAutoscaler - this is used to scale a Fleet automatically depending on the
# available capacity of a List across the fleet.
Expand Down
6 changes: 3 additions & 3 deletions pkg/allocation/go/allocation.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions pkg/allocation/go/allocation.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,14 @@
"type": "object",
"$ref": "#/definitions/allocationPriority"
},
"description": "[Stage: Alpha]\n[FeatureFlag:CountsAndLists]\n`Priorities` configuration alters the order in which `GameServers` are searched for matches to the configured `selectors`.\n\nPriority of sorting is in descending importance. I.e. The position 0 `priority` entry is checked first.\n\nFor `Packed` strategy sorting, this priority list will be the tie-breaker within the least utilised infrastructure, to ensure optimal\ninfrastructure usage while also allowing some custom prioritisation of `GameServers`.\n\nFor `Distributed` strategy sorting, the entire selection of `GameServers` will be sorted by this priority list to provide the\norder that `GameServers` will be allocated by."
"description": "[Stage: Beta]\n[FeatureFlag:CountsAndLists]\n`Priorities` configuration alters the order in which `GameServers` are searched for matches to the configured `selectors`.\n\nPriority of sorting is in descending importance. I.e. The position 0 `priority` entry is checked first.\n\nFor `Packed` strategy sorting, this priority list will be the tie-breaker within the least utilised infrastructure, to ensure optimal\ninfrastructure usage while also allowing some custom prioritisation of `GameServers`.\n\nFor `Distributed` strategy sorting, the entire selection of `GameServers` will be sorted by this priority list to provide the\norder that `GameServers` will be allocated by."
},
"counters": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/allocationCounterAction"
},
"description": "[Stage: Alpha]\n[FeatureFlag:CountsAndLists]\nCounters and Lists provide a set of actions to perform\non Counters and Lists during allocation."
"description": "[Stage: Beta]\n[FeatureFlag:CountsAndLists]\nCounters and Lists provide a set of actions to perform\non Counters and Lists during allocation."
},
"lists": {
"type": "object",
Expand Down Expand Up @@ -246,7 +246,7 @@
"additionalProperties": {
"$ref": "#/definitions/AllocationResponseCounterStatus"
},
"description": "(Alpha, CountsAndLists feature flag) Status of Counters and Lists on allocation."
"description": "(Beta, CountsAndLists feature flag) Status of Counters and Lists on allocation."
},
"lists": {
"type": "object",
Expand Down
6 changes: 3 additions & 3 deletions pkg/apis/agones/v1/fleet.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ type FleetSpec struct {
Strategy appsv1.DeploymentStrategy `json:"strategy"`
// Scheduling strategy. Defaults to "Packed".
Scheduling apis.SchedulingStrategy `json:"scheduling"`
// [Stage: Alpha]
// [Stage: Beta]
// [FeatureFlag:CountsAndLists]
// `Priorities` configuration alters scale down logic in Fleets based on the configured available capacity order under that key.
//
Expand Down Expand Up @@ -101,11 +101,11 @@ type FleetStatus struct {
// Players are the current total player capacity and count for this Fleet
// +optional
Players *AggregatedPlayerStatus `json:"players,omitempty"`
// (Alpha, CountsAndLists feature flag) Counters provides aggregated Counter capacity and Counter
// (Beta, CountsAndLists feature flag) Counters provides aggregated Counter capacity and Counter
// count for this Fleet.
// +optional
Counters map[string]AggregatedCounterStatus `json:"counters,omitempty"`
// (Alpha, CountsAndLists feature flag) Lists provides aggregated List capacityv and List values
// (Beta, CountsAndLists feature flag) Lists provides aggregated List capacityv and List values
// for this Fleet.
// +optional
Lists map[string]AggregatedListStatus `json:"lists,omitempty"`
Expand Down
6 changes: 3 additions & 3 deletions pkg/apis/agones/v1/gameserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,11 @@ type GameServerSpec struct {
// (Alpha, PlayerTracking feature flag) Players provides the configuration for player tracking features.
// +optional
Players *PlayersSpec `json:"players,omitempty"`
// (Alpha, CountsAndLists feature flag) Counters provides the configuration for tracking of int64 values against a GameServer.
// (Beta, CountsAndLists feature flag) Counters provides the configuration for tracking of int64 values against a GameServer.
// Keys must be declared at GameServer creation time.
// +optional
Counters map[string]CounterStatus `json:"counters,omitempty"`
// (Alpha, CountsAndLists feature flag) Lists provides the configuration for tracking of lists of up to 1000 values against a GameServer.
// (Beta, CountsAndLists feature flag) Lists provides the configuration for tracking of lists of up to 1000 values against a GameServer.
// Keys must be declared at GameServer creation time.
// +optional
Lists map[string]ListStatus `json:"lists,omitempty"`
Expand Down Expand Up @@ -313,7 +313,7 @@ type GameServerStatus struct {
// [FeatureFlag:PlayerTracking]
// +optional
Players *PlayerStatus `json:"players"`
// (Alpha, CountsAndLists feature flag) Counters and Lists provides the configuration for generic tracking features.
// (Beta, CountsAndLists feature flag) Counters and Lists provides the configuration for generic tracking features.
// +optional
Counters map[string]CounterStatus `json:"counters,omitempty"`
// +optional
Expand Down
20 changes: 10 additions & 10 deletions pkg/apis/agones/v1/gameserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ func TestGameServerApplyDefaults(t *testing.T) {
scheduling apis.SchedulingStrategy
sdkServer SdkServer
alphaPlayerCapacity *int64
alphaCounterSpec map[string]CounterStatus
alphaListSpec map[string]ListStatus
counterSpec map[string]CounterStatus
listSpec map[string]ListStatus
evictionSafeSpec EvictionSafe
evictionSafeStatus EvictionSafe
}
Expand Down Expand Up @@ -213,8 +213,8 @@ func TestGameServerApplyDefaults(t *testing.T) {
gss.Counters["games"] = CounterStatus{Count: 1, Capacity: 100}
}),
expected: wantDefaultAnd(func(e *expected) {
e.alphaCounterSpec = make(map[string]CounterStatus)
e.alphaCounterSpec["games"] = CounterStatus{Count: 1, Capacity: 100}
e.counterSpec = make(map[string]CounterStatus)
e.counterSpec["games"] = CounterStatus{Count: 1, Capacity: 100}
}),
},
"CountsAndLists=true, Lists": {
Expand All @@ -224,8 +224,8 @@ func TestGameServerApplyDefaults(t *testing.T) {
gss.Lists["players"] = ListStatus{Capacity: 100, Values: []string{"foo", "bar"}}
}),
expected: wantDefaultAnd(func(e *expected) {
e.alphaListSpec = make(map[string]ListStatus)
e.alphaListSpec["players"] = ListStatus{Capacity: 100, Values: []string{"foo", "bar"}}
e.listSpec = make(map[string]ListStatus)
e.listSpec["players"] = ListStatus{Capacity: 100, Values: []string{"foo", "bar"}}
}),
},
"defaults on passthrough": {
Expand Down Expand Up @@ -432,14 +432,14 @@ func TestGameServerApplyDefaults(t *testing.T) {
} else {
assert.Nil(t, test.gameServer.Status.Eviction)
}
if test.expected.alphaCounterSpec != nil {
assert.Equal(t, test.expected.alphaCounterSpec, test.gameServer.Status.Counters)
if test.expected.counterSpec != nil {
assert.Equal(t, test.expected.counterSpec, test.gameServer.Status.Counters)
} else {
assert.Nil(t, test.gameServer.Spec.Counters)
assert.Nil(t, test.gameServer.Status.Counters)
}
if test.expected.alphaListSpec != nil {
assert.Equal(t, test.expected.alphaListSpec, test.gameServer.Status.Lists)
if test.expected.listSpec != nil {
assert.Equal(t, test.expected.listSpec, test.gameServer.Status.Lists)
} else {
assert.Nil(t, test.gameServer.Spec.Lists)
assert.Nil(t, test.gameServer.Status.Lists)
Expand Down
6 changes: 3 additions & 3 deletions pkg/apis/agones/v1/gameserverset.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ type GameServerSetSpec struct {
AllocationOverflow *AllocationOverflow `json:"allocationOverflow,omitempty"`
// Scheduling strategy. Defaults to "Packed".
Scheduling apis.SchedulingStrategy `json:"scheduling,omitempty"`
// [Stage: Alpha]
// [Stage: Beta]
// [FeatureFlag:CountsAndLists]
// `Priorities` configuration alters scale down logic in Fleets based on the configured available capacity order under that key.
//
Expand Down Expand Up @@ -99,11 +99,11 @@ type GameServerSetStatus struct {
// Players is the current total player capacity and count for this GameServerSet
// +optional
Players *AggregatedPlayerStatus `json:"players,omitempty"`
// (Alpha, CountsAndLists feature flag) Counters provides aggregated Counter capacity and Counter
// (Beta, CountsAndLists feature flag) Counters provides aggregated Counter capacity and Counter
// count for this GameServerSet.
// +optional
Counters map[string]AggregatedCounterStatus `json:"counters,omitempty"`
// (Alpha, CountsAndLists feature flag) Lists provides aggregated List capacity and List values
// (Beta, CountsAndLists feature flag) Lists provides aggregated List capacity and List values
// for this GameServerSet.
// +optional
Lists map[string]AggregatedListStatus `json:"lists,omitempty"`
Expand Down
10 changes: 5 additions & 5 deletions pkg/apis/allocation/v1/gameserverallocation.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ type GameServerAllocationSpec struct {
// This is useful for things like smoke testing of new game servers.
Preferred []GameServerSelector `json:"preferred,omitempty" hash:"ignore"`

// [Stage: Alpha]
// [Stage: Beta]
// [FeatureFlag:CountsAndLists]
// `Priorities` configuration alters the order in which `GameServers` are searched for matches to the configured `selectors`.
//
Expand All @@ -112,12 +112,12 @@ type GameServerAllocationSpec struct {
// You can use this to tell the server necessary session data
MetaPatch MetaPatch `json:"metadata,omitempty" hash:"ignore"`

// [Stage: Alpha]
// [Stage: Beta]
// [FeatureFlag:CountsAndLists]
// Counter actions to perform during allocation.
// +optional
Counters map[string]CounterAction `json:"counters,omitempty" hash:"ignore"`
// [Stage: Alpha]
// [Stage: Beta]
// [FeatureFlag:CountsAndLists]
// List actions to perform during allocation.
// +optional
Expand All @@ -139,14 +139,14 @@ type GameServerSelector struct {
// Players provides a filter on minimum and maximum values for player capacity when retrieving a GameServer
// through Allocation. Defaults to no limits.
Players *PlayerSelector `json:"players,omitempty"`
// [Stage: Alpha]
// [Stage: Beta]
// [FeatureFlag:CountsAndLists]
// Counters provides filters on minimum and maximum values
// for a Counter's count and available capacity when retrieving a GameServer through Allocation.
// Defaults to no limits.
// +optional
Counters map[string]CounterSelector `json:"counters,omitempty"`
// [Stage: Alpha]
// [Stage: Beta]
// [FeatureFlag:CountsAndLists]
// Lists provides filters on minimum and maximum values
// for List capacity, and for the existence of a value in a List, when retrieving a GameServer
Expand Down
8 changes: 4 additions & 4 deletions pkg/apis/autoscaling/v1/fleetautoscaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ type FleetAutoscalerPolicy struct {
// Webhook policy config params. Present only if FleetAutoscalerPolicyType = Webhook.
// +optional
Webhook *WebhookPolicy `json:"webhook,omitempty"`
// [Stage:Alpha]
// [Stage:Beta]
// [FeatureFlag:CountsAndLists]
// Counter policy config params. Present only if FleetAutoscalerPolicyType = Counter.
// +optional
Counter *CounterPolicy `json:"counter,omitempty"`
// [Stage:Alpha]
// [Stage:Beta]
// [FeatureFlag:CountsAndLists]
// List policy config params. Present only if FleetAutoscalerPolicyType = List.
// +optional
Expand Down Expand Up @@ -108,12 +108,12 @@ const (
// WebhookPolicyType is a simple webhook strategy used for horizontal fleet scaling
// GameServers
WebhookPolicyType FleetAutoscalerPolicyType = "Webhook"
// [Stage:Alpha]
// [Stage:Beta]
// [FeatureFlag:CountsAndLists]
// CounterPolicyType is for Counter based fleet autoscaling
// nolint:revive // Linter contains comment doesn't start with CounterPolicyType
CounterPolicyType FleetAutoscalerPolicyType = "Counter"
// [Stage:Alpha]
// [Stage:Beta]
// [FeatureFlag:CountsAndLists]
// ListPolicyType is for List based fleet autoscaling
// nolint:revive // Linter contains comment doesn't start with ListPolicyType
Expand Down
3 changes: 2 additions & 1 deletion pkg/util/runtime/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ var (
// - SDK Implementations: Update in language-specific SDKs (e.g., sdks/go/sdk.go, sdks/csharp/sdk/AgonesSDK.cs).
// - Examples & Tests: Adjust in files like examples/simple-game-server/main.go and language-specific test files.
// * Modify automation scripts in the build/build-sdk-images directory to support beta file generation.
// * Run `make gen-all-sdk-grpc` to generate the required files, then execute the `make run-sdk-conformance-test-go` command and address any issues that arise.
// * Run `make gen-all-sdk-grpc` to generate the required files. If there are changes to the `proto/allocation/allocation.proto` run `make gen-allocation-grpc`.
// * Afterwards, execute the `make run-sdk-conformance-test-go` command and address any issues that arise.
// * NOTE: DO NOT EDIT any autogenerated code. `make gen-all-sdk-grpc` will take care of it.
//
// To promote a feature from beta->GA:
Expand Down
6 changes: 3 additions & 3 deletions proto/allocation/allocation.proto
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ message AllocationRequest {
// Note: This field can only be set if neither Required or Preferred is set.
repeated GameServerSelector gameServerSelectors = 8;

// [Stage: Alpha]
// [Stage: Beta]
// [FeatureFlag:CountsAndLists]
// `Priorities` configuration alters the order in which `GameServers` are searched for matches to the configured `selectors`.
//
Expand All @@ -92,7 +92,7 @@ message AllocationRequest {
// order that `GameServers` will be allocated by.
repeated Priority priorities = 9;

// [Stage: Alpha]
// [Stage: Beta]
// [FeatureFlag:CountsAndLists]
// Counters and Lists provide a set of actions to perform
// on Counters and Lists during allocation.
Expand All @@ -114,7 +114,7 @@ message AllocationResponse {
string source = 6;
optional GameServerMetadata metadata = 7;

// (Alpha, CountsAndLists feature flag) Status of Counters and Lists on allocation.
// (Beta, CountsAndLists feature flag) Status of Counters and Lists on allocation.
map<string, CounterStatus> counters = 9;
map<string, ListStatus> lists = 10;

Expand Down
6 changes: 3 additions & 3 deletions sdks/rust/proto/allocation/allocation.proto
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ message AllocationRequest {
// Note: This field can only be set if neither Required or Preferred is set.
repeated GameServerSelector gameServerSelectors = 8;

// [Stage: Alpha]
// [Stage: Beta]
// [FeatureFlag:CountsAndLists]
// `Priorities` configuration alters the order in which `GameServers` are searched for matches to the configured `selectors`.
//
Expand All @@ -92,7 +92,7 @@ message AllocationRequest {
// order that `GameServers` will be allocated by.
repeated Priority priorities = 9;

// [Stage: Alpha]
// [Stage: Beta]
// [FeatureFlag:CountsAndLists]
// Counters and Lists provide a set of actions to perform
// on Counters and Lists during allocation.
Expand All @@ -114,7 +114,7 @@ message AllocationResponse {
string source = 6;
optional GameServerMetadata metadata = 7;

// (Alpha, CountsAndLists feature flag) Status of Counters and Lists on allocation.
// (Beta, CountsAndLists feature flag) Status of Counters and Lists on allocation.
map<string, CounterStatus> counters = 9;
map<string, ListStatus> lists = 10;

Expand Down
Loading

0 comments on commit 2023077

Please sign in to comment.