Skip to content

Commit

Permalink
Merge branch 'main' into logging/sidecar-patch
Browse files Browse the repository at this point in the history
  • Loading branch information
gongmax authored Sep 11, 2024
2 parents c60b1f2 + 632a866 commit 071f92c
Show file tree
Hide file tree
Showing 34 changed files with 869 additions and 342 deletions.
41 changes: 41 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,46 @@
# Changelog

## [v1.43 .0](https://github.com/googleforgames/agones/tree/v1.43.0) (2024-08-27)

[Full Changelog](https://github.com/googleforgames/agones/compare/v1.42.0...v1.43.0)

**Implemented enhancements:**
- Add Option to Use Host Network and Configure Ports by @Orza in https://github.com/googleforgames/agones/pull/3895
- Graduate Passthrough Port Policy to Beta on Autopilot by @vicentefb in https://github.com/googleforgames/agones/pull/3916
- Agones Unity SDK development setup instructions + Agones Unity SDK Ready test by @aallbrig in https://github.com/googleforgames/agones/pull/3887
- feat: Add API Changes and Validation for FleetAutoscaler Schedule/Chain Policy by @indexjoseph in https://github.com/googleforgames/agones/pull/3893
- feat: Adds autoscaling logic for new Chain and Schedule policies by @indexjoseph in https://github.com/googleforgames/agones/pull/3929
- Adds basic framework for the in place Agones upgrades test controller by @igooch in https://github.com/googleforgames/agones/pull/3956
- [Performance] - Added a new metric inside the allocator to track the success retry rate inside the retry loop by @vicentefb in https://github.com/googleforgames/agones/pull/3927
- Make the parameters that limits the number of GameServers to add configurable by @vicentefb in https://github.com/googleforgames/agones/pull/3950
- feat: Adds e2e tests for chain/schedule policy and bump ScheduledAutoscaler to Alpha by @indexjoseph in https://github.com/googleforgames/agones/pull/3946
- Implement CountsAndLists for Unity SDK + Tests by @ZeroParticle in https://github.com/googleforgames/agones/pull/3883

**Fixed bugs:**
- Resolves `make site-server` issue #3885 by @aallbrig in https://github.com/googleforgames/agones/pull/3914

**Other:**
- Preparation for Release v1.43.0 by @kamaljeeti in https://github.com/googleforgames/agones/pull/3910
- Introduce external resource(s) on multiplayer game programming to docs by @aallbrig in https://github.com/googleforgames/agones/pull/3884
- Added line of code to update failure count details inside runscenario by @vicentefb in https://github.com/googleforgames/agones/pull/3915
- updated golang upgrade template by @ashutosji in https://github.com/googleforgames/agones/pull/3902
- Changes for GitHub/Cloud Build app integration by @zmerlynn in https://github.com/googleforgames/agones/pull/3918
- Meta: Contributor role by @markmandel in https://github.com/googleforgames/agones/pull/3922
- Fix allocator metrics endpoint by @vicentefb in https://github.com/googleforgames/agones/pull/3921
- Meta: Contributor => Collaborator by @markmandel in https://github.com/googleforgames/agones/pull/3928
- Rewrite agones-bot, commit to Agones repo by @zmerlynn in https://github.com/googleforgames/agones/pull/3923
- Small cleanup of incorrect comment in features.go file by @igooch in https://github.com/googleforgames/agones/pull/3944
- Update Supported Kubernetes to 1.28, 1.29, 1.30 by @ashutosji in https://github.com/googleforgames/agones/pull/3933
- remove ctx within the condition func by @peterzhongyi in https://github.com/googleforgames/agones/pull/3959
- Reapply "Update Supported Kubernetes to 1.28, 1.29, 1.30 (#3933)" (#3… by @gongmax in https://github.com/googleforgames/agones/pull/3961
- change kubernetes API version to fix broken CI by @peterzhongyi in https://github.com/googleforgames/agones/pull/3962
- docs(godot): add Agones x Godot third party example by @andresromerodev in https://github.com/googleforgames/agones/pull/3938
- Link Unity Netcode for Gameobjects example in documentation by @mbychkowski in https://github.com/googleforgames/agones/pull/3937
- Docs: Use k8s-api-version for links by @markmandel in https://github.com/googleforgames/agones/pull/3963

**New Contributors:**
- @Orza made their first contribution in https://github.com/googleforgames/agones/pull/3895

## [v1.42.0](https://github.com/googleforgames/agones/tree/v1.42.0) (2024-07-16)

[Full Changelog](https://github.com/googleforgames/agones/compare/v1.41.0...v1.42.0)
Expand Down
3 changes: 1 addition & 2 deletions build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#

# base version target. This is usually the next release.
base_version = 1.43.0
base_version = 1.44.0

#
# All of the following can be overwritten with environment variables
Expand Down Expand Up @@ -246,7 +246,6 @@ include ./includes/$(osinclude)
include ./includes/build-image.mk
include ./includes/release.mk
include ./includes/google-cloud.mk
include ./includes/terraform.mk
include ./includes/minikube.mk
include ./includes/kind.mk
include ./includes/website.mk
Expand Down
77 changes: 77 additions & 0 deletions build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ Table of Contents
* [make kind-shell](#make-kind-shell)
* [make kind-controller-portforward](#make-kind-controller-portforward)
* [Dependencies](#dependencies)
* [Running Performance Test](#running-performance-test)
* [Troubleshooting](#troubleshooting)
* [$GOPATH/$GOROOT error when building in WSL](#gopathgoroot-error-when-building-in-wsl)
* [Error: cluster-admin-binding already exists](#error-cluster-admin-binding-already-exists)
Expand Down Expand Up @@ -895,6 +896,82 @@ Note the version in the pathname. Go may eliminate the need to do this in future

We also use vendor to hold code patches while waiting for the project to release the fixes in their own code. An example is in [k8s.io/apimachinery](https://github.com/googleforgames/agones/issues/414) where a fix will be released later this year, but we updated our own vendored version in order to fix the issue sooner.

## Running Performance Test

To be able to run the performance script located in the following path: `agones/build/performance-test.sh` you need to have the following setup:

#### Install a standard GKE cluster

Follow for more details here: https://agones.dev/site/docs/installation/creating-cluster/gke/

#### Install Agones

Follow for more details here: https://agones.dev/site/docs/installation/install-agones/helm/

#### Set up node for prometheus

```
gcloud container node-pools create agones-metrics --cluster={CLUSTER_NAME} --zone={REGION} \
--node-taints agones.dev/agones-metrics=true:NoExecute \
--node-labels agones.dev/agones-metrics=true \
--num-nodes=1 \
--machine-type=e2-standard-4
```

#### Install Prometheus, Grafana and port-forward

cd agones/

https://agones.dev/site/docs/guides/metrics/#installation

#### Modify the performance-test.sh

The performance-tests script contains a set of variables that need to be overwritten to work with your cluster and configuration settings. You can also pass these values through command line This is an example:

```
CLUSTER_NAME=agones-standard
CLUSTER_LOCATION=us-central1-c
REGISTRY=us-east1-docker.pkg.dev/user/agones
PROJECT=my-project
REPLICAS=10000
AUTO_SHUTDOWN_DELAY=60
BUFFER_SIZE=9900
MAX_REPLICAS=20000
DURATION=10m
CLIENTS=50
INTERVAL=1000
```

You might also want to comment out the first couple lines that come after the variables are set and also change the cd directoy:

```
# export SHELL="/bin/bash"
# mkdir -p /go/src/agones.dev/
# ln -sf /workspace /go/src/agones.dev/agones
# cd /go/src/agones.dev/agones/build
# gcloud config set project $PROJECT
# gcloud container clusters get-credentials $CLUSTER_NAME \
# --zone=$CLUSTER_LOCATION --project=$PROJECT
# make install LOG_LEVEL=info REGISTRY='"'$REGISTRY'"' DOCKER_RUN=""
# cd /go/src/agones.dev/agones/test/load/allocation
cd ../test/load/allocation
```

This script is an entyrpoint to be able to run the allocation performance test which can be found at `agones/test/load/allocation`

You can see the fleet and autoscaler configuration (such as buffer size and min/max replicas, etc) in the following files:

* [performance-test-fleet-template](https://github.com/googleforgames/agones/blob/main/test/load/allocation/performance-test-fleet-template.yaml)
* [performance-test-autoscaler-template.yaml](https://github.com/googleforgames/agones/blob/main/test/load/allocation/performance-test-autoscaler-template.yaml)

You could also modify the `automatic shutdown delay` parameter where if the value is greater than zero, it will automatically shut down the server this many seconds after the server becomes allocated (cannot be used if `automaticShutdownDelayMin` is set). It's a configuration for the simple game server.

Something to keep in mind with CLIENTS and INTERVAL is the following. Let's say you have client count 50 and interval 500ms, which means every client will submit 2 allocation requests in 1s, so the entire allocation requests that the allocator receives in 1s is 50 * 2 = 100, so the allocation request QPS from the allocator view is 100.

Finally, you can cd agones/build and run `sh performance-test.sh` if you see timeout issues please re-run the command.

## Troubleshooting

Expand Down
136 changes: 120 additions & 16 deletions build/includes/google-cloud.mk
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,21 @@ gcloud-test-cluster: $(ensure-build-image)
clean-gcloud-test-cluster: $(ensure-build-image)
$(MAKE) gcloud-terraform-destroy-cluster

gcloud-e2e-infra-state-bucket: GCP_PROJECT ?= $(shell $(current_project))
gcloud-e2e-infra-state-bucket:
$(MAKE) terraform-init DIRECTORY=e2e/state-bucket
docker run --rm -it $(common_mounts) $(build_tag) bash -c 'cd $(mount_path)/build/terraform/e2e/state-bucket && \
terraform apply -auto-approve -var project="$(GCP_PROJECT)"'
# Pulls down authentication information for kubectl against a cluster, name can be specified through GCP_CLUSTER_NAME
# (defaults to 'test-cluster')
gcloud-auth-cluster: $(ensure-build-image)
docker run --rm $(common_mounts) $(build_tag) gcloud container clusters get-credentials $(GCP_CLUSTER_NAME) --zone $(GCP_CLUSTER_LOCATION)

# authenticate our docker configuration so that you can do a docker push directly
# to the Google Artifact Registry repository
gcloud-auth-docker: $(ensure-build-image)
docker run --rm $(common_mounts) $(build_tag) gcloud auth print-access-token | docker login -u oauth2accesstoken --password-stdin https://us-docker.pkg.dev

# Clean the gcloud configuration
clean-gcloud-config:
-sudo rm -r $(build_path)/.config

# Ensure the end-to-end infrastructure state bucket
ensure-e2e-infra-state-bucket: GCP_PROJECT ?= $(shell $(current_project))
ensure-e2e-infra-state-bucket:
@buckets=$$(docker run --rm $(common_mounts) $(build_tag) gcloud storage buckets describe gs://$(GCP_PROJECT)-e2e-infra-bucket-tfstate --format="value(name)");\
Expand All @@ -64,6 +73,13 @@ ensure-e2e-infra-state-bucket:
$(MAKE) gcloud-e2e-infra-state-bucket;\
fi

# Creates the end-to-end infrastructure bucket
gcloud-e2e-infra-state-bucket: GCP_PROJECT ?= $(shell $(current_project))
gcloud-e2e-infra-state-bucket:
$(MAKE) terraform-init DIRECTORY=e2e/state-bucket
docker run --rm -it $(common_mounts) $(build_tag) bash -c 'cd $(mount_path)/build/terraform/e2e/state-bucket && \
terraform apply -auto-approve -var project="$(GCP_PROJECT)"'

# Creates a gcloud cluster for end-to-end
gcloud-e2e-test-cluster: GCP_PROJECT ?= $(shell $(current_project))
gcloud-e2e-test-cluster: $(ensure-build-image) ensure-e2e-infra-state-bucket
Expand All @@ -79,16 +95,104 @@ clean-gcloud-e2e-test-cluster:
$(MAKE) terraform-init BUCKET=$(GCP_PROJECT)-e2e-infra-bucket-tfstate PREFIX=terraform/state DIRECTORY=e2e
$(DOCKER_RUN) bash -c 'cd $(mount_path)/build/terraform/e2e && terraform destroy -var project=$(GCP_PROJECT) -auto-approve'

# Pulls down authentication information for kubectl against a cluster, name can be specified through GCP_CLUSTER_NAME
# (defaults to 'test-cluster')
gcloud-auth-cluster: $(ensure-build-image)
docker run --rm $(common_mounts) $(build_tag) gcloud container clusters get-credentials $(GCP_CLUSTER_NAME) --zone $(GCP_CLUSTER_LOCATION)
# The GKE development cluster name
GCP_TF_CLUSTER_NAME ?= agones-tf-cluster

# authenticate our docker configuration so that you can do a docker push directly
# to the Google Artifact Registry repository
gcloud-auth-docker: $(ensure-build-image)
docker run --rm $(common_mounts) $(build_tag) gcloud auth print-access-token | docker login -u oauth2accesstoken --password-stdin https://us-docker.pkg.dev
# The current project
current_project := $(DOCKER_RUN) bash -c "gcloud config get-value project 2> /dev/null"

# Clean the gcloud configuration
clean-gcloud-config:
-sudo rm -r $(build_path)/.config
### Deploy cluster with Terraform
terraform-init: TERRAFORM_BUILD_DIR ?= $(mount_path)/build/terraform/$(DIRECTORY)
terraform-init: $(ensure-build-image)
terraform-init:
docker run --rm -it $(common_mounts) $(DOCKER_RUN_ARGS) $(build_tag) bash -c '\
cd $(TERRAFORM_BUILD_DIR) && terraform init -backend-config="bucket=$(BUCKET)" -backend-config="prefix=$(PREFIX)" && gcloud auth application-default login'

terraform-clean: TERRAFORM_BUILD_DIR ?= $(mount_path)/build/terraform/gke
terraform-clean:
$(DOCKER_RUN) bash -c ' \
cd $(TERRAFORM_BUILD_DIR) && rm -r ./.terraform || true && \
rm ./terraform.tfstate* || true && \
rm ./kubeconfig || true'

# Creates a cluster and install release version of Agones controller
# Version could be specified by AGONES_VERSION
# Alpha Feature gates are disabled
gcloud-terraform-cluster: GCP_CLUSTER_NODEPOOL_INITIALNODECOUNT ?= 4
gcloud-terraform-cluster: GCP_CLUSTER_NODEPOOL_MACHINETYPE ?= e2-standard-4
gcloud-terraform-cluster: GCP_CLUSTER_NODEPOOL_ENABLEIMAGESTREAMING ?= true
gcloud-terraform-cluster: GCP_CLUSTER_NODEPOOL_AUTOSCALE ?= false
gcloud-terraform-cluster: GCP_CLUSTER_NODEPOOL_MIN_NODECOUNT ?= 1
gcloud-terraform-cluster: GCP_CLUSTER_NODEPOOL_MAX_NODECOUNT ?= 5
gcloud-terraform-cluster: GCP_CLUSTER_NODEPOOL_WINDOWSINITIALNODECOUNT ?= 0
gcloud-terraform-cluster: GCP_CLUSTER_NODEPOOL_WINDOWSMACHINETYPE ?= e2-standard-4
gcloud-terraform-cluster: AGONES_VERSION ?= ''
gcloud-terraform-cluster: GCP_TF_CLUSTER_NAME ?= agones-tf-cluster
gcloud-terraform-cluster: LOG_LEVEL ?= debug
gcloud-terraform-cluster: $(ensure-build-image)
gcloud-terraform-cluster: FEATURE_GATES := ""
gcloud-terraform-cluster: GCP_PROJECT ?= $(shell $(current_project))
gcloud-terraform-cluster:
$(MAKE) terraform-init DIRECTORY=gke
$(DOCKER_RUN) bash -c 'cd $(mount_path)/build/terraform/gke && \
terraform apply -auto-approve -var agones_version="$(AGONES_VERSION)" \
-var name=$(GCP_TF_CLUSTER_NAME) -var machine_type="$(GCP_CLUSTER_NODEPOOL_MACHINETYPE)" \
-var values_file="" \
-var feature_gates=$(FEATURE_GATES) \
-var project="$(GCP_PROJECT)" \
-var location="$(GCP_CLUSTER_LOCATION)" \
-var log_level="$(LOG_LEVEL)" \
-var autoscale=$(GCP_CLUSTER_NODEPOOL_AUTOSCALE) \
-var min_node_count=$(GCP_CLUSTER_NODEPOOL_MIN_NODECOUNT) \
-var max_node_count=$(GCP_CLUSTER_NODEPOOL_MAX_NODECOUNT) \
-var node_count=$(GCP_CLUSTER_NODEPOOL_INITIALNODECOUNT) \
-var enable_image_streaming=$(GCP_CLUSTER_NODEPOOL_ENABLEIMAGESTREAMING) \
-var windows_node_count=$(GCP_CLUSTER_NODEPOOL_WINDOWSINITIALNODECOUNT) \
-var windows_machine_type=$(GCP_CLUSTER_NODEPOOL_WINDOWSMACHINETYPE)'
GCP_CLUSTER_NAME=$(GCP_TF_CLUSTER_NAME) $(MAKE) gcloud-auth-cluster

# Creates a cluster and install current version of Agones controller
# Set all necessary variables as `make install` does
# Unifies previous `make gcloud-test-cluster` and `make install` targets
gcloud-terraform-install: GCP_CLUSTER_NODEPOOL_INITIALNODECOUNT ?= 4
gcloud-terraform-install: GCP_CLUSTER_NODEPOOL_MACHINETYPE ?= e2-standard-4
gcloud-terraform-install: GCP_CLUSTER_NODEPOOL_AUTOSCALE ?= false
gcloud-terraform-install: GCP_CLUSTER_NODEPOOL_MIN_NODECOUNT ?= 1
gcloud-terraform-install: GCP_CLUSTER_NODEPOOL_MAX_NODECOUNT ?= 5
gcloud-terraform-install: GCP_CLUSTER_NODEPOOL_WINDOWSINITIALNODECOUNT ?= 0
gcloud-terraform-install: GCP_CLUSTER_NODEPOOL_WINDOWSMACHINETYPE ?= e2-standard-4
gcloud-terraform-install: ALWAYS_PULL_SIDECAR := true
gcloud-terraform-install: IMAGE_PULL_POLICY := "Always"
gcloud-terraform-install: PING_SERVICE_TYPE := "LoadBalancer"
gcloud-terraform-install: CRD_CLEANUP := true
gcloud-terraform-install: GCP_TF_CLUSTER_NAME ?= agones-tf-cluster
gcloud-terraform-install: LOG_LEVEL ?= debug
gcloud-terraform-install: FEATURE_GATES := $(ALPHA_FEATURE_GATES)
gcloud-terraform-install: GCP_PROJECT ?= $(shell $(current_project))
gcloud-terraform-install:
$(MAKE) terraform-init DIRECTORY=gke
$(DOCKER_RUN) bash -c ' \
cd $(mount_path)/build/terraform/gke && terraform apply -auto-approve -var agones_version="$(VERSION)" -var image_registry="$(REGISTRY)" \
-var pull_policy="$(IMAGE_PULL_POLICY)" \
-var always_pull_sidecar="$(ALWAYS_PULL_SIDECAR)" \
-var image_pull_secret="$(IMAGE_PULL_SECRET)" \
-var ping_service_type="$(PING_SERVICE_TYPE)" \
-var crd_cleanup="$(CRD_CLEANUP)" \
-var chart="../../../install/helm/agones/" \
-var name=$(GCP_TF_CLUSTER_NAME) -var machine_type="$(GCP_CLUSTER_NODEPOOL_MACHINETYPE)" \
-var project=$(GCP_PROJECT) \
-var location=$(GCP_CLUSTER_LOCATION) \
-var log_level=$(LOG_LEVEL) \
-var autoscale=$(GCP_CLUSTER_NODEPOOL_AUTOSCALE) \
-var min_node_count=$(GCP_CLUSTER_NODEPOOL_MIN_NODECOUNT) \
-var max_node_count=$(GCP_CLUSTER_NODEPOOL_MAX_NODECOUNT) \
-var feature_gates=$(FEATURE_GATES) \
-var node_count=$(GCP_CLUSTER_NODEPOOL_INITIALNODECOUNT) \
-var windows_node_count=$(GCP_CLUSTER_NODEPOOL_WINDOWSINITIALNODECOUNT) \
-var windows_machine_type=$(GCP_CLUSTER_NODEPOOL_WINDOWSMACHINETYPE)'
GCP_CLUSTER_NAME=$(GCP_TF_CLUSTER_NAME) $(MAKE) gcloud-auth-cluster

gcloud-terraform-destroy-cluster: GCP_PROJECT ?= $(shell $(current_project))
gcloud-terraform-destroy-cluster:
$(MAKE) terraform-init DIRECTORY=gke
$(DOCKER_RUN) bash -c 'cd $(mount_path)/build/terraform/gke && terraform destroy -var project=$(GCP_PROJECT) -auto-approve'
Loading

0 comments on commit 071f92c

Please sign in to comment.