Skip to content

Commit

Permalink
Updates to gRPC generation (#3483)
Browse files Browse the repository at this point in the history
Some cleanup post the last series of gRPC updates and changes for future
gRPC updates.

* Cleanup the instructions for better clarity and operational ordering.
* Fix for allocation gRPC generation to reuse the gRPC version include
in the build container image rather than unnecessarily build its own.
  • Loading branch information
markmandel authored Nov 1, 2023
1 parent 91112fd commit 77bde06
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 18 deletions.
10 changes: 6 additions & 4 deletions .github/ISSUE_TEMPLATE/kubernetes_update.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@ List of items to do for upgrading to {version_1} {version_2} {version_3}
- [ ] `dev_eks_example_cluster_version`, which is the newest EKS supported version in {version_1} {version_2} {version_3}
- [ ] `dev_minikube_example_cluster_version`, which is {version_2} with the supported patch version
- [ ] If client-go pulled in a new version of gRPC, then also
- [ ] Update the SDK [base image grpc version](https://github.com/googleforgames/agones/blob/main/build/includes/sdk.mk#L30) and rebuild the image. Note that this can take a while and in the past we have had to manually push it to gcr because cloud build doesn't like how long it takes.
- [ ] Regenerate allocated API endpoints: [make gen-allocation-grpc](https://github.com/googleforgames/agones/blob/main/build/includes/allocation.mk#L55)
- [ ] Regenerate all client sdks: [make gen-all-sdk-grpc](https://github.com/googleforgames/agones/blob/main/build/README.md#make-gen-all-sdk-grpc)
- [ ] Update the version number in C++ Cmake scripts [here](https://github.com/googleforgames/agones/blob/main/sdks/cpp/CMakeLists.txt#L100) and [here](https://github.com/googleforgames/agones/blob/main/sdks/cpp/cmake/prerequisites.cmake#L34)
- [ ] Update the `grpc_release_tag` in the SDK [base image grpc version](https://github.com/googleforgames/agones/blob/main/build/includes/sdk.mk).
- [ ] Update the gRPC version number in C++ CMake scripts, `AGONES_GRPC_VERSION` [here](https://github.com/googleforgames/agones/blob/main/sdks/cpp/CMakeLists.txt)
and `gRPC_GIT_TAG` [here](https://github.com/googleforgames/agones/blob/main/sdks/cpp/cmake/prerequisites.cmake)
- [ ] Regenerate all client sdks: [make gen-all-sdk-grpc](https://github.com/googleforgames/agones/blob/main/build/README.md#make-gen-all-sdk-grpc)
This can take an hour or so, as the above changes force a rebuild. Plan your day accordingly 😃.
- [ ] Regenerate allocated API endpoints: [make gen-allocation-grpc](https://github.com/googleforgames/agones/blob/main/build/README.md#make-gen-allocation-grpc)
- [ ] Confirm the update works as expected by running e2e tests
- [ ] Add the new supported Kubernetes versions to the e2e clusters creation
- [ ] In `terraform/e2e/module.tf`, add the new supported version to the map `kubernetes_versions`. Noted the location of the new clusters should have enough quota (CPU, In-use IP addresses) to create the cluster. And the new supported version is usually only available in RAPID channel.
Expand Down
16 changes: 2 additions & 14 deletions build/includes/allocation.mk
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@
# \__, |_| \_\_| \____| |_|\___/ \___/|_|_|_| |_|\__, |
# |___/ |___/

build_base_version = $(call sha,$(build_path)/build-sdk-images/tool/base/Dockerfile)
build_base_tag = agones-build-allocation-base:$(build_base_version)

# Calculate sha hash of sha hashes of all files in a specified ALLOCATION_FOLDER
allocation_build_folder = build-allocation-images/
sdk_build_folder = build-sdk-images
Expand All @@ -33,23 +30,14 @@ ALLOCATION_IMAGE_TAG=$(build_allocation_prefix)$(ALLOCATION_FOLDER):$(build_allo

.PHONY: gen-allocation-grpc

# Builds the base GRPC docker image.
build-build-image-base: DOCKER_BUILD_ARGS= --build-arg GRPC_RELEASE_TAG=$(grpc_release_tag)
build-build-image-base:
docker build --tag=$(build_base_tag) $(build_path)$(sdk_build_folder)/tool/base $(DOCKER_BUILD_ARGS)

# create the GRPC base build image if it doesn't exist
ensure-build-image-base:
$(MAKE) ensure-image IMAGE_TAG=$(build_base_tag) BUILD_TARGET=build-build-image-base

# create the build image allocation if it doesn't exist
ensure-build-allocation-image:
$(MAKE) ensure-image IMAGE_TAG=$(ALLOCATION_IMAGE_TAG) BUILD_TARGET=build-build-allocation-image ALLOCATION_FOLDER=$(ALLOCATION_FOLDER)

# Builds the docker image
# Note: allocation and sdk use the same dockerfile
build-build-allocation-image: ensure-build-image-base
docker build --tag=$(ALLOCATION_IMAGE_TAG) --build-arg BASE_IMAGE=$(build_base_tag) -f $(build_path)$(sdk_build_folder)/$(ALLOCATION_FOLDER)/Dockerfile $(build_path)$(allocation_build_folder)$(ALLOCATION_FOLDER)
build-build-allocation-image: ensure-build-sdk-image-base
docker build --tag=$(ALLOCATION_IMAGE_TAG) --build-arg BASE_IMAGE=$(build_sdk_base_tag) -f $(build_path)$(sdk_build_folder)/$(ALLOCATION_FOLDER)/Dockerfile $(build_path)$(allocation_build_folder)$(ALLOCATION_FOLDER)

# Generates grpc server and client for a single allocation, use ALLOCATION_FOLDER variable to specify the allocation folder.
gen-allocation-grpc:
Expand Down

0 comments on commit 77bde06

Please sign in to comment.