Skip to content

Commit

Permalink
Add GKE Autopilot to e2e
Browse files Browse the repository at this point in the history
Run e2e tests against Autopilot 1.24 cluster. Mark as `allowFailure`
for now just to get a sense for whether it works - I will manually
scan CI after this goes in.

We probably should script additions/mutations to this in the
future...
  • Loading branch information
zmerlynn committed Jan 20, 2023
1 parent efb2caa commit ff3ebe9
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 3 deletions.
2 changes: 2 additions & 0 deletions build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ install: LOG_LEVEL := "debug"
install: EXTERNAL_IP ?= $(shell $(DOCKER_RUN) kubectl get services agones-allocator -n agones-system -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
install: FEATURE_GATES ?= $(ALPHA_FEATURE_GATES)
install: SERVICE_MONITOR := false
install: CONTROLLER_SAFE_TO_EVICT := false # TODO(#2797): Remove when `SplitControllerAndExtensions` => safe-to-evict=true
install: HELM_ARGS ?=
install: $(ensure-build-image) install-custom-pull-secret
-$(DOCKER_RUN) bash -c '[[ $$(helm status agones -n agones-system --output json | jq -r ".info.status") =~ (failed|pending-.*) ]] && helm uninstall agones --namespace=agones-system || true'
Expand All @@ -403,6 +404,7 @@ install: $(ensure-build-image) install-custom-pull-secret
--set agones.featureGates=$(FEATURE_GATES) \
--set agones.allocator.service.loadBalancerIP=$(EXTERNAL_IP) \
--set agones.metrics.serviceMonitor.enabled=$(SERVICE_MONITOR) \
--set agones.controller.safeToEvict=$(CONTROLLER_SAFE_TO_EVICT) \
$(HELM_ARGS) \
agones $(mount_path)/install/helm/agones/

Expand Down
3 changes: 2 additions & 1 deletion build/e2e-image/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ echo $FEATURES
echo $REGISTRY
set -e
echo "installing current release"
DOCKER_RUN= make install FEATURE_GATES='"'$FEATURES'"' REGISTRY='"'$REGISTRY'"'
# TODO(#2797): Remove when `SplitControllerAndExtensions` => safe-to-evict=true
DOCKER_RUN= make install FEATURE_GATES='"'$FEATURES'"' REGISTRY='"'$REGISTRY'"' CONTROLLER_SAFE_TO_EVICT=true
echo "starting e2e test"
DOCKER_RUN= make test-e2e ARGS=-parallel=16 E2E_USE_GOTESTSUM=true GOTESTSUM_VERBOSE=true FEATURE_GATES='"'$FEATURES'"'
echo "completed e2e test"
5 changes: 3 additions & 2 deletions build/e2e-image/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
set -e
FEATURES=$1
TEST_CLUSTER_NAME=$2
REGISTRY=$3
TEST_CLUSTER_LOCATION=$3
REGISTRY=$4

echo $FEATURES
export SHELL="/bin/bash"
Expand All @@ -29,7 +30,7 @@ then
gcloud auth login
fi
gcloud container clusters get-credentials $TEST_CLUSTER_NAME \
--zone=us-west1-c --project=agones-images
--zone=${TEST_CLUSTER_LOCATION} --project=agones-images
kubectl port-forward statefulset/consul-consul-server 8500:8500 &
echo "Waiting consul port-forward to launch on 8500..."
timeout 60 bash -c 'until printf "" 2>>/dev/null >>/dev/tcp/$0/$1; do sleep 1; done' 127.0.0.1 8500
Expand Down
35 changes: 35 additions & 0 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ steps:
args:
- 'CustomFasSyncInterval=false&SDKGracefulTermination=false&StateAllocationFilter=false&PlayerAllocationFilter=true&PlayerTracking=true&ResetMetricsOnDelete=true&SafeToEvict=true&PodHostname=true&Example=true'
- 'e2e-test-cluster'
- 'us-west1-c'
- "${_REGISTRY}"
id: e2e-feature-gates
waitFor:
Expand All @@ -269,12 +270,46 @@ steps:
args:
- ''
- 'e2e-test-cluster'
- 'us-west1-c'
- "${_REGISTRY}"
id: e2e-stable
waitFor:
- push-images
- build-e2e

#
# Run the e2e tests on GKE Autopilot with FeatureGates inverted compared to Stable
#
# Keep in sync with (the inverse of) pkg/util/runtime/features.go:featureDefaults

- name: 'e2e-runner'
args:
- 'CustomFasSyncInterval=false&SDKGracefulTermination=false&StateAllocationFilter=false&PlayerAllocationFilter=true&PlayerTracking=true&ResetMetricsOnDelete=true&SafeToEvict=true&PodHostname=true&Example=true'
- 'gke-autopilot-e2e-test-cluster-1-24'
- 'us-west1'
- "${_REGISTRY}"
id: e2e-feature-gates-gke-autopilot
allowFailure: true # for now, run the step but don't block on it
waitFor:
- push-images
- build-e2e

#
# Run the e2e tests on GKE Autopilot without FeatureGates, except SafeToEvict, which we need on Autopilot
#

- name: 'e2e-runner'
args:
- 'SafeToEvict=true'
- 'gke-autopilot-e2e-test-cluster-1-24'
- 'us-west1'
- "${_REGISTRY}"
id: e2e-stable-gke-autopilot
allowFailure: true # for now, run the step but don't block on it
waitFor:
- push-images
- build-e2e

#
# SDK conformance tests
#
Expand Down

0 comments on commit ff3ebe9

Please sign in to comment.