Skip to content

Commit

Permalink
Merge branch 'googleforgames:main' into release-v1.22.0-rc
Browse files Browse the repository at this point in the history
  • Loading branch information
SaitejaTamma authored Mar 23, 2022
2 parents 0a708b5 + ce4b9c7 commit 08a31b6
Show file tree
Hide file tree
Showing 13 changed files with 332 additions and 60 deletions.
47 changes: 39 additions & 8 deletions build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ ALPHA_FEATURE_GATES ?= "PlayerTracking=true&StateAllocationFilter=true&PlayerAll

# Build with Windows support
WITH_WINDOWS=1
# Build with arm64support
WITH_ARM64=1

# Directory that this Makefile is in.
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
Expand Down Expand Up @@ -135,7 +137,9 @@ endif

go_build_cmd = go build -mod=vendor
GO_BUILD_LINUX_AMD64=docker run --rm -e "CGO_ENABLED=0" -e "$(gomod_on)" -w $(workdir_path) $(common_mounts) $(build_tag) $(go_build_cmd)
GO_BUILD_LINUX_ARM64=docker run --rm -e "CGO_ENABLED=0" -e "GOOS=linux" -e "GOARCH=arm64" -e "$(gomod_on)" -w $(workdir_path) $(common_mounts) $(build_tag) $(go_build_cmd)
GO_BUILD_DARWIN_AMD64=docker run --rm -e "GOOS=darwin" -e "GOARCH=amd64" -e "$(gomod_on)" -w $(workdir_path) $(common_mounts) $(build_tag) $(go_build_cmd)
GO_BUILD_DARWIN_ARM64=docker run --rm -e "GOOS=darwin" -e "GOARCH=arm64" -e "$(gomod_on)" -w $(workdir_path) $(common_mounts) $(build_tag) $(go_build_cmd)
GO_BUILD_WINDOWS_AMD64=docker run --rm -e "GOOS=windows" -e "GOARCH=amd64" -e "$(gomod_on)" -w $(workdir_path) $(common_mounts) $(build_tag) $(go_build_cmd)

RACE_DETECTOR_ARGS=-race
Expand Down Expand Up @@ -353,9 +357,19 @@ uninstall: $(ensure-build-image)


# Build a static binary for the gameserver controller
build-controller-binary: $(ensure-build-image)
ifeq ($(WITH_ARM64), 1)
build-controller-binary: $(ensure-build-image) build-controller-binary-linux-amd64 build-controller-binary-linux-arm64
else
build-controller-binary: $(ensure-build-image) build-controller-binary-linux-amd64
endif

build-controller-binary-linux-amd64: $(ensure-build-image)
$(GO_BUILD_LINUX_AMD64) \
-tags $(GO_BUILD_TAGS) -o $(go_build_base_path)/cmd/controller/bin/controller \
-tags $(GO_BUILD_TAGS) -o $(go_build_base_path)/cmd/controller/bin/controller.linux.amd64 \
$(go_rebuild_flags) $(go_version_flags) -installsuffix cgo $(agones_package)/cmd/controller
build-controller-binary-linux-arm64: $(ensure-build-image)
$(GO_BUILD_LINUX_ARM64) \
-tags $(GO_BUILD_TAGS) -o $(go_build_base_path)/cmd/controller/bin/controller.linux.arm64 \
$(go_rebuild_flags) $(go_version_flags) -installsuffix cgo $(agones_package)/cmd/controller

# Lint the go source code.
Expand All @@ -382,19 +396,26 @@ push-controller-image: $(ensure-build-image)
docker push $(controller_tag)

# build the static binary for the gameserver sidecar
build-agones-sdk-binary: $(ensure-build-image) build-agones-sdk-binary-linux build-agones-sdk-binary-windows build-agones-sdk-binary-darwin
build-agones-sdk-binary: $(ensure-build-image) build-agones-sdk-binary-linux-amd64 build-agones-sdk-binary-linux-arm64 build-agones-sdk-binary-windows build-agones-sdk-binary-darwin-amd64 build-agones-sdk-binary-darwin-arm64
$(ZIP_SDK) \
agonessdk-server-$(VERSION).zip sdk-server.darwin.amd64 sdk-server.linux.amd64 sdk-server.windows.amd64.exe
agonessdk-server-$(VERSION).zip sdk-server.darwin.amd64 sdk-server.darwin.arm64 sdk-server.linux.amd64 sdk-server.linux.arm64 sdk-server.windows.amd64.exe

# build the static binary for the gameserver sidecar for Linux
build-agones-sdk-binary-linux: $(ensure-build-image)
build-agones-sdk-binary-linux-amd64: $(ensure-build-image)
$(GO_BUILD_LINUX_AMD64) \
-o $(go_build_base_path)/cmd/sdk-server/bin/sdk-server.linux.amd64 $(go_rebuild_flags) $(go_version_flags) -installsuffix cgo $(agones_package)/cmd/sdk-server
build-agones-sdk-binary-linux-arm64: $(ensure-build-image)
$(GO_BUILD_LINUX_ARM64) \
-o $(go_build_base_path)/cmd/sdk-server/bin/sdk-server.linux.arm64 $(go_rebuild_flags) $(go_version_flags) -installsuffix cgo $(agones_package)/cmd/sdk-server


# build the static binary for the gameserver sidecar for Darwin (macOS)
build-agones-sdk-binary-darwin: $(ensure-build-image)
build-agones-sdk-binary-darwin-amd64: $(ensure-build-image)
$(GO_BUILD_DARWIN_AMD64) \
-o $(go_build_base_path)/cmd/sdk-server/bin/sdk-server.darwin.amd64 $(go_rebuild_flags) $(go_version_flags) $(agones_package)/cmd/sdk-server
build-agones-sdk-binary-darwin-arm64: $(ensure-build-image)
$(GO_BUILD_DARWIN_ARM64) \
-o $(go_build_base_path)/cmd/sdk-server/bin/sdk-server.darwin.arm64 $(go_rebuild_flags) $(go_version_flags) $(agones_package)/cmd/sdk-server

# build the windows binary for the gameserver sidecar for Windows
build-agones-sdk-binary-windows: $(ensure-build-image)
Expand Down Expand Up @@ -446,9 +467,19 @@ build-ping-image: $(ensure-build-image) build-ping-binary build-licenses build-r
docker build $(agones_path)/cmd/ping/ --tag=$(ping_tag) $(DOCKER_BUILD_ARGS)

# Build a static binary for the allocator service
build-allocator-binary: $(ensure-build-image)
ifeq ($(WITH_ARM64), 1)
build-allocator-binary: $(ensure-build-image) build-allocator-binary-linux-amd64 build-allocator-binary-linux-arm64
else
build-allocator-binary: $(ensure-build-image) build-allocator-binary-linux-amd64
endif

build-allocator-binary-linux-amd64: $(ensure-build-image)
$(GO_BUILD_LINUX_AMD64) \
-tags $(GO_BUILD_TAGS) -o $(go_build_base_path)/cmd/allocator/bin/allocator \
-tags $(GO_BUILD_TAGS) -o $(go_build_base_path)/cmd/allocator/bin/allocator.linux.amd64\
$(go_rebuild_flags) $(go_version_flags) -installsuffix cgo $(agones_package)/cmd/allocator
build-allocator-binary-linux-arm64:
$(GO_BUILD_LINUX_ARM64) \
-tags $(GO_BUILD_TAGS) -o $(go_build_base_path)/cmd/allocator/bin/allocator.linux.arm64 \
$(go_rebuild_flags) $(go_version_flags) -installsuffix cgo $(agones_package)/cmd/allocator

# Pushes up the allocator image
Expand Down
2 changes: 1 addition & 1 deletion build/build-sdk-images/csharp/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ RUN wget -q https://packages.microsoft.com/config/ubuntu/19.04/packages-microsof


RUN apt-get update \
&& apt-get install -y dotnet-sdk-2.2
&& apt-get install -y dotnet-sdk-3.1

# code generation scripts
COPY *.sh /root/
Expand Down
8 changes: 8 additions & 0 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@

steps:

#
# Print Docker version
#

- name: "gcr.io/cloud-builders/docker"
id: docker-version
args: ["--version"]

#
# Restore any caches
#
Expand Down
2 changes: 1 addition & 1 deletion cmd/allocator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ FROM alpine:3.14
RUN apk --update add ca-certificates && \
adduser -D -u 1000 agones

COPY --chown=agones:agones ./bin/allocator /home/agones/allocator
COPY --chown=agones:agones ./bin/allocator.linux.amd64 /home/agones/allocator
COPY --chown=agones:agones ./bin/LICENSES ./bin/dependencies-src.tgz /home/agones/

USER 1000
Expand Down
2 changes: 1 addition & 1 deletion cmd/controller/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ FROM alpine:3.14
RUN apk --update add ca-certificates && \
adduser -D -u 1000 agones

COPY --chown=agones:agones ./bin/controller /home/agones/controller
COPY --chown=agones:agones ./bin/controller.linux.amd64 /home/agones/controller
COPY --chown=agones:agones ./bin/LICENSES ./bin/dependencies-src.tgz /home/agones/

USER 1000
Expand Down
26 changes: 23 additions & 3 deletions install/helm/agones/templates/extensions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,24 @@ metadata:
chart: {{ template "agones.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- if .Values.agones.controller.allocationApiService.annotations }}
annotations:
{{- toYaml .Values.agones.controller.allocationApiService.annotations | indent 4 }}
{{- end }}
spec:
group: allocation.agones.dev
groupPriorityMinimum: 1000
versionPriority: 15
service:
name: agones-controller-service
namespace: {{ .Release.Namespace }}
{{- if .Values.agones.controller.generateTLS }}
{{- if not .Values.agones.controller.allocationApiService.disableCaBundle }}
{{- if .Values.agones.controller.generateTLS }}
caBundle: {{ b64enc $ca.Cert }}
{{- else }}
{{- else }}
caBundle: {{ default (.Files.Get "certs/server.crt") .Values.agones.controller.tlsCert | b64enc }}
{{- end }}
{{- end }}
{{- end }}
version: v1
{{- end}}
{{- if .Values.agones.registerWebhooks }}
Expand All @@ -48,6 +54,10 @@ apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
metadata:
name: agones-validation-webhook
{{- if .Values.agones.controller.validatingWebhook.annotations }}
annotations:
{{- toYaml .Values.agones.controller.validatingWebhook.annotations | indent 4 }}
{{- end }}
labels:
component: controller
app: {{ template "agones.name" . }}
Expand All @@ -65,10 +75,12 @@ webhooks:
name: agones-controller-service
namespace: {{ .Release.Namespace }}
path: /validate
{{- if not .Values.agones.controller.validatingWebhook.disableCaBundle }}
{{- if .Values.agones.controller.generateTLS }}
caBundle: {{ b64enc $ca.Cert }}
{{- else }}
caBundle: {{ default (.Files.Get "certs/server.crt") .Values.agones.controller.tlsCert | b64enc }}
{{- end }}
{{- end }}
rules:
- apiGroups:
Expand Down Expand Up @@ -105,6 +117,10 @@ apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
name: agones-mutation-webhook
{{- if .Values.agones.controller.mutatingWebhook.annotations }}
annotations:
{{- toYaml .Values.agones.controller.mutatingWebhook.annotations | indent 4 }}
{{- end }}
labels:
component: controller
app: {{ template "agones.name" . }}
Expand All @@ -122,10 +138,12 @@ webhooks:
name: agones-controller-service
namespace: {{ .Release.Namespace }}
path: /mutate
{{- if not .Values.agones.controller.mutatingWebhook.disableCaBundle }}
{{- if .Values.agones.controller.generateTLS }}
caBundle: {{ b64enc $ca.Cert }}
{{- else }}
caBundle: {{ default (.Files.Get "certs/server.crt") .Values.agones.controller.tlsCert | b64enc }}
{{- end }}
{{- end }}
rules:
- apiGroups:
Expand All @@ -147,6 +165,7 @@ webhooks:
- CREATE
- UPDATE
{{- end }}
{{- if not .Values.agones.controller.disableSecret }}
---
apiVersion: v1
kind: Secret
Expand All @@ -167,3 +186,4 @@ data:
server.crt: {{ default (.Files.Get "certs/server.crt") .Values.agones.controller.tlsCert | b64enc }}
server.key: {{ default (.Files.Get "certs/server.key") .Values.agones.controller.tlsKey | b64enc }}
{{- end }}
{{- end }}
10 changes: 10 additions & 0 deletions install/helm/agones/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,16 @@ agones:
generateTLS: true
tlsCert: ""
tlsKey: ""
disableSecret: false
allocationApiService:
annotations: {}
disableCaBundle: false
validatingWebhook:
annotations: {}
disableCaBundle: false
mutatingWebhook:
annotations: {}
disableCaBundle: false
safeToEvict: false
persistentLogs: true
persistentLogsSizeLimitMB: 10000
Expand Down
Loading

0 comments on commit 08a31b6

Please sign in to comment.