diff --git a/.github/release.yml b/.github/release.yml index b907a9b0c2..f5b54e36fc 100644 --- a/.github/release.yml +++ b/.github/release.yml @@ -1,3 +1,4 @@ +--- # Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -11,27 +12,17 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - changelog: exclude: - labels: - - duplicate - - question - - invalid - - wontfix + labels: [duplicate, question, invalid, wontfix] categories: - title: Breaking changes - labels: - - kind/breaking + labels: [kind/breaking] - title: Implemented enhancements - labels: - - kind/feature + labels: [kind/feature] - title: Fixed bugs - labels: - - kind/bug + labels: [kind/bug] - title: Security fixes - labels: - - area/security + labels: [area/security] - title: Other - labels: - - "*" \ No newline at end of file + labels: ['*'] diff --git a/.github/workflows/close.yaml b/.github/workflows/close.yaml index 862907331f..1e5fa7938f 100644 --- a/.github/workflows/close.yaml +++ b/.github/workflows/close.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,31 +19,27 @@ # For more information, see: # https://github.com/actions/stale name: Close Old - on: workflow_dispatch: schedule: - - cron: '0 1 1,15 * *' - + - cron: 0 1 1,15 * * jobs: stale: - runs-on: ubuntu-latest permissions: issues: write - - steps: - - uses: actions/stale@v5 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - days-before-issue-stale: 30 - close-issue-message: > - We are closing this as there was no activity in this issue for last 90 days. Please reopen if you’d like to discuss anything further. - only-labels: 'obsolete' - exempt-issue-labels: awaiting-maintainer - ascending: true - days-before-close: 0 - close-issue-reason: "not_planned" - stale-issue-label: 'wontfix' - enable-statistics: true + - uses: actions/stale@v5 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + days-before-issue-stale: 30 + close-issue-message: > + We are closing this as there was no activity in this issue for last 90 + days. Please reopen if you’d like to discuss anything further. + only-labels: obsolete + exempt-issue-labels: awaiting-maintainer + ascending: true + days-before-close: 0 + close-issue-reason: not_planned + stale-issue-label: wontfix + enable-statistics: true diff --git a/.github/workflows/label-pr.yml b/.github/workflows/label-pr.yml index 70fbc6258a..fdf8d8c73c 100644 --- a/.github/workflows/label-pr.yml +++ b/.github/workflows/label-pr.yml @@ -1,3 +1,4 @@ +--- # Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -14,12 +15,8 @@ # # This workflow utilizes https://github.com/actions/github-script in GitHub Actions to apply labels to pull requests. # - name: Label PR - -on: - - pull_request_target - +on: [pull_request_target] jobs: label: runs-on: ubuntu-latest @@ -30,7 +27,7 @@ jobs: - name: Label PR uses: actions/github-script@v4 with: - script: | + script: |- const keywords = { "breaking": "kind/breaking", "bug": "kind/bug", diff --git a/.github/workflows/obsolete.yaml b/.github/workflows/obsolete.yaml index 926da89ab8..d717cff9a0 100644 --- a/.github/workflows/obsolete.yaml +++ b/.github/workflows/obsolete.yaml @@ -1,3 +1,4 @@ +--- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -16,33 +17,29 @@ # For more information, see: # https://github.com/actions/stale name: Mark stale issues obsolete - on: schedule: - - cron: '0 2 1,15 * *' + - cron: 0 2 1,15 * * workflow_dispatch: - - jobs: stale: - runs-on: ubuntu-latest permissions: issues: write name: Track Obsolete Issues - steps: - - name: Track stale issues and check if obsolete - uses: actions/stale@v5 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - days-before-issue-stale: 30 - stale-issue-message: > - This issue is marked as obsolete due to inactivity for last 60 days. - To avoid issue getting closed in next 30 days, please add a comment or add 'awaiting-maintainer' label. Thank you for your contributions - stale-issue-label: 'obsolete' - only-labels: 'stale' - exempt-issue-labels: awaiting-maintainer - remove-stale-when-updated: true - ascending: true - enable-statistics: true + - name: Track stale issues and check if obsolete + uses: actions/stale@v5 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + days-before-issue-stale: 30 + stale-issue-message: > + This issue is marked as obsolete due to inactivity for last 60 days. To + avoid issue getting closed in next 30 days, please add a comment or add + 'awaiting-maintainer' label. Thank you for your contributions + stale-issue-label: obsolete + only-labels: stale + exempt-issue-labels: awaiting-maintainer + remove-stale-when-updated: true + ascending: true + enable-statistics: true diff --git a/.github/workflows/pr_update.yml b/.github/workflows/pr_update.yml index 91cf528466..218fdcc83e 100644 --- a/.github/workflows/pr_update.yml +++ b/.github/workflows/pr_update.yml @@ -1,3 +1,4 @@ +--- # Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -16,13 +17,10 @@ # `main`. `update-pr-branch` will pick the oldest PR (by creation date) that is approved # with auto-merge enabled and update it to the latest `main`, forming a best-effort queue # of approved PRs. - name: PR update - on: push: - branches: - - "main" + branches: [main] jobs: autoupdate: runs-on: ubuntu-latest @@ -31,8 +29,8 @@ jobs: uses: adRise/update-pr-branch@v0.6.0 with: token: ${{ secrets.AGONES_BOT }} - base: "main" + base: main required_approval_count: 1 require_passed_checks: true - sort: "created" - direction: "asc" + sort: created + direction: asc diff --git a/.github/workflows/stale.yaml b/.github/workflows/stale.yaml index 89644c3ea9..9991952261 100644 --- a/.github/workflows/stale.yaml +++ b/.github/workflows/stale.yaml @@ -1,3 +1,4 @@ +--- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -15,32 +16,29 @@ # You can adjust the behavior by modifying this file. # For more information, see: # https://github.com/actions/stale -name: Mark stale - +name: Mark stale on: workflow_dispatch: schedule: - - cron: '0 10 1,15 * *' - + - cron: 0 10 1,15 * * jobs: stale: - runs-on: ubuntu-latest permissions: issues: write name: stale issues - steps: - - name: Stale issues - uses: actions/stale@v5 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - days-before-issue-stale: 30 - days-before-issue-close: 60 - stale-issue-message: > - 'This issue is marked as Stale due to inactivity for more than 30 days. - To avoid being marked as 'stale' please add 'awaiting-maintainer' label or add a comment. Thank you for your contributions ' - stale-issue-label: 'stale' - exempt-issue-labels: 'awaiting-maintainer, obsolete' - ascending: true - enable-statistics: true + - name: Stale issues + uses: actions/stale@v5 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + days-before-issue-stale: 30 + days-before-issue-close: 60 + stale-issue-message: > + 'This issue is marked as Stale due to inactivity for more than 30 days. To + avoid being marked as 'stale' please add 'awaiting-maintainer' label or + add a comment. Thank you for your contributions ' + stale-issue-label: stale + exempt-issue-labels: awaiting-maintainer, obsolete + ascending: true + enable-statistics: true diff --git a/.gitignore b/.gitignore index 5ccc2d0e30..8625db4b2d 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ # limitations under the License. .* +!/.yamllint !.gitignore !.helmignore !.gitattributes diff --git a/.golangci.yml b/.golangci.yml index bc93bc53bd..fc917eb4e0 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,6 +1,6 @@ +--- # This file contains all available configuration options # with their default values. - # options for analysis running run: # default concurrency is a available CPU number @@ -31,9 +31,7 @@ run: # no need to include all autogenerated files, we confidently recognize # autogenerated files. If it's not please let us know. skip-files: - modules-download-mode: vendor - # output configuration options output: # colored-line-number|line-number|json|tab|checkstyle, default is "colored-line-number" @@ -44,7 +42,6 @@ output: # print linter name in the end of issue text, default is true print-linter-name: true - linters: enable: - bodyclose @@ -62,7 +59,6 @@ linters: - staticcheck - unconvert - unparam - linters-settings: govet: disable-all: false @@ -71,32 +67,24 @@ linters-settings: # extremely noisy, also against common Go style in most cases - shadow gocritic: - enabled-tags: - - performance - - opinionated - - diagnostic - disabled-checks: - - paramTypeCombine - - unnamedResult - - unnecessaryDefer - settings: # settings passed to gocritic + enabled-tags: [performance, opinionated, diagnostic] + disabled-checks: [paramTypeCombine, unnamedResult, unnecessaryDefer] + settings: # settings passed to gocritic hugeParam: sizeThreshold: 512 rangeValCopy: sizeThreshold: 512 skipTestFuncs: true - issues: # This turns off the default excludes - which was causing the linter # to miss things like erroneous comments exclude-use-default: false - exclude: - - Using the variable on range scope .* in function literal + exclude: [Using the variable on range scope .* in function literal] exclude-rules: # Skip fieldalignment checks on: # - tests: memory footprint doesn't matter # - cmd/: we assume these are one-off config entries # - pkg/apis: Keep strong convention on TypeMeta/ObjectMeta/Spec/Status - - path: '(.+)_test\.go|^test/|^cmd/.*|^pkg/apis/.*' + - path: (.+)_test\.go|^test/|^cmd/.*|^pkg/apis/.* # fieldalignment is in the `govet` linter, so exclude based on text instead of all of govet text: '^fieldalignment: .*' diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000000..212605a41c --- /dev/null +++ b/.yamllint @@ -0,0 +1,18 @@ +--- +extends: default + +rules: + truthy: disable + line-length: + max: 1500 + +ignore: + - /build/.gomod/ + - /install/ + - /sdks/ + - /test/sdk/ + - /test/terraform/vendor/ + - /site/node_modules/ + - /site/themes/docsy/ + - /site/vendor/ + - /vendor/ diff --git a/build/Makefile b/build/Makefile index 28a054b704..5986d06e7a 100644 --- a/build/Makefile +++ b/build/Makefile @@ -484,12 +484,14 @@ build-extensions-binary-linux-arm64: $(ensure-build-image) -tags $(GO_BUILD_TAGS) -o $(go_build_base_path)/cmd/extensions/bin/extensions.linux.arm64 \ $(go_rebuild_flags) $(go_version_flags) -installsuffix cgo $(agones_package)/cmd/extensions -# Lint the go source code. +# Lint the go source code and yaml files. # use LINT_TIMEOUT to manipulate the linter timeout lint: LINT_TIMEOUT ?= 15m lint: $(ensure-build-image) docker run -t -e "TERM=xterm-256color" -e "$(gomod_on)" --rm $(common_mounts) -w $(workdir_path) $(DOCKER_RUN_ARGS) $(build_tag) bash -c \ - "golangci-lint run ./examples/... && golangci-lint run --timeout $(LINT_TIMEOUT) ./..." + "golangci-lint run ./examples/... && \ + golangci-lint run --timeout $(LINT_TIMEOUT) ./... && \ + yamllint ." # Extract licenses from source tree build-licenses: diff --git a/build/always/always-be-building.yaml b/build/always/always-be-building.yaml index 0378140690..b606c339cf 100644 --- a/build/always/always-be-building.yaml +++ b/build/always/always-be-building.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2023 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -11,33 +12,26 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - # Always Be Building # # A build that checks to see if there are any CI builds running, and if there # are not, starts a build of `main`. # # Triggered by Cloud Scheduler at some arbitrary interval, e.g. 2h - steps: -- name: 'gcr.io/cloud-builders/gcloud' - id: always-be-building - script: | - #!/usr/bin/env bash - - set -e - set -o pipefail - - echo "== Checking for active builds ==" - gcloud builds list --filter "status=WORKING AND tags='ci'" --format="value(id,startTime)" |& tee /tmp/active_builds - if [[ `wc -l < /tmp/active_builds` != 0 ]]; then - echo "== Builds already running, doing nothing ==" - exit 0 - fi - - echo "== Build queue empty, starting `main` build ==" - gcloud builds triggers run da003bb8-e9bb-4983-a556-e77fb92f17ca --branch=main - -tags: - - "always-be-building" -timeout: 300s # generous time in case builds take a while to list + - name: gcr.io/cloud-builders/gcloud + id: always-be-building + script: | + #!/usr/bin/env bash + set -e + set -o pipefail + echo "== Checking for active builds ==" + gcloud builds list --filter "status=WORKING AND tags='ci'" --format="value(id,startTime)" |& tee /tmp/active_builds + if [[ `wc -l < /tmp/active_builds` != 0 ]]; then + echo "== Builds already running, doing nothing ==" + exit 0 + fi + echo "== Build queue empty, starting `main` build ==" + gcloud builds triggers run da003bb8-e9bb-4983-a556-e77fb92f17ca --branch=main +tags: [always-be-building] +timeout: 300s # generous time in case builds take a while to list diff --git a/build/build-image/Dockerfile b/build/build-image/Dockerfile index feddbf4901..a7dd9c690c 100644 --- a/build/build-image/Dockerfile +++ b/build/build-image/Dockerfile @@ -69,6 +69,11 @@ RUN echo "source <(helm completion bash)" >> /root/.bashrc # install golang-ci linter RUN go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.51.2 +# Install Python, pip, and yamllint +RUN apt-get update && \ + apt-get install -y python3-pip && \ + pip3 install yamllint==1.32.0 + # install gotestsum test runner RUN go install gotest.tools/gotestsum@latest diff --git a/build/grafana-frontend.yaml b/build/grafana-frontend.yaml index fe37074c65..bdaa0b9a1f 100644 --- a/build/grafana-frontend.yaml +++ b/build/grafana-frontend.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2023 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -11,34 +12,32 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - # Connects to Prometheus frontend UI: https://cloud.google.com/stackdriver/docs/managed-prometheus/query#ui-prometheus - service: port: 3000 tolerations: -- key: "agones.dev/agones-metrics" - operator: "Equal" - value: "true" - effect: "NoExecute" + - key: agones.dev/agones-metrics + operator: Equal + value: 'true' + effect: NoExecute affinity: nodeAffinity: preferredDuringSchedulingIgnoredDuringExecution: - - weight: 1 - preference: - matchExpressions: - - key: agones.dev/agones-metrics - operator: Exists + - weight: 1 + preference: + matchExpressions: + - key: agones.dev/agones-metrics + operator: Exists sidecar: - dashboards: - enabled: true + dashboards: + enabled: true plugins: grafana-piechart-panel datasources: datasources.yaml: apiVersion: 1 datasources: - - name: Prometheus - type: prometheus - url: http://frontend.metrics.svc.cluster.local:9090/ - access: proxy - isDefault: true + - name: Prometheus + type: prometheus + url: http://frontend.metrics.svc.cluster.local:9090/ + access: proxy + isDefault: true diff --git a/build/grafana.yaml b/build/grafana.yaml index 1fa64704e4..79b95f8569 100644 --- a/build/grafana.yaml +++ b/build/grafana.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2020 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -11,32 +12,31 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - service: port: 3000 tolerations: -- key: "agones.dev/agones-metrics" - operator: "Equal" - value: "true" - effect: "NoExecute" + - key: agones.dev/agones-metrics + operator: Equal + value: 'true' + effect: NoExecute affinity: nodeAffinity: preferredDuringSchedulingIgnoredDuringExecution: - - weight: 1 - preference: - matchExpressions: - - key: agones.dev/agones-metrics - operator: Exists + - weight: 1 + preference: + matchExpressions: + - key: agones.dev/agones-metrics + operator: Exists sidecar: - dashboards: - enabled: true + dashboards: + enabled: true plugins: grafana-piechart-panel datasources: datasources.yaml: apiVersion: 1 datasources: - - name: Prometheus - type: prometheus - url: http://prom-prometheus-server.metrics.svc.cluster.local:80/ - access: proxy - isDefault: true \ No newline at end of file + - name: Prometheus + type: prometheus + url: http://prom-prometheus-server.metrics.svc.cluster.local:80/ + access: proxy + isDefault: true diff --git a/build/grafana/dashboard-allocations.yaml b/build/grafana/dashboard-allocations.yaml index 9996b21eb1..5322423b8a 100644 --- a/build/grafana/dashboard-allocations.yaml +++ b/build/grafana/dashboard-allocations.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2018 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,9 +20,9 @@ metadata: name: agones-allocations namespace: metrics labels: - grafana_dashboard: "1" + grafana_dashboard: '1' data: - dashboard-agones-allocations.json: | + dashboard-agones-allocations.json: |- { "annotations": { "list": [ diff --git a/build/grafana/dashboard-allocator-usage.yaml b/build/grafana/dashboard-allocator-usage.yaml index 9083bbb259..65af82322f 100644 --- a/build/grafana/dashboard-allocator-usage.yaml +++ b/build/grafana/dashboard-allocator-usage.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2018 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,9 +20,9 @@ metadata: name: agones-allocator-usage namespace: metrics labels: - grafana_dashboard: "1" + grafana_dashboard: '1' data: - dashboard-agones-allocator-usage.json: | + dashboard-agones-allocator-usage.json: |- { "annotations": { "list": [ @@ -615,4 +616,4 @@ data: "title": "Agones Allocator Resource", "uid": "GpQUU7VZk", "version": 3 - } \ No newline at end of file + } diff --git a/build/grafana/dashboard-apiserver-requests.yaml b/build/grafana/dashboard-apiserver-requests.yaml index 733144c74d..cd6e6af53b 100644 --- a/build/grafana/dashboard-apiserver-requests.yaml +++ b/build/grafana/dashboard-apiserver-requests.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2019 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,9 +20,9 @@ metadata: name: agones-apiserver-requests namespace: metrics labels: - grafana_dashboard: "1" + grafana_dashboard: '1' data: - dashboard-agones-apiserver-requests.json: | + dashboard-agones-apiserver-requests.json: |- { "annotations": { "list": [ diff --git a/build/grafana/dashboard-autoscalers.yaml b/build/grafana/dashboard-autoscalers.yaml index fa6a8e5100..aaf8e59f31 100644 --- a/build/grafana/dashboard-autoscalers.yaml +++ b/build/grafana/dashboard-autoscalers.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2018 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,9 +20,9 @@ metadata: name: agones-autoscalers namespace: metrics labels: - grafana_dashboard: "1" + grafana_dashboard: '1' data: - dashboard-agones-autoscalers.json: | + dashboard-agones-autoscalers.json: |- { "annotations": { "list": [ @@ -1288,4 +1289,4 @@ data: "list": [] }, "version": 1 - } \ No newline at end of file + } diff --git a/build/grafana/dashboard-controller-usage.yaml b/build/grafana/dashboard-controller-usage.yaml index a97c50a64f..40365fa9aa 100644 --- a/build/grafana/dashboard-controller-usage.yaml +++ b/build/grafana/dashboard-controller-usage.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2018 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,9 +20,9 @@ metadata: name: agones-controller-usage namespace: metrics labels: - grafana_dashboard: "1" + grafana_dashboard: '1' data: - dashboard-agones-controller-usage.json: | + dashboard-agones-controller-usage.json: |- { "annotations": { "list": [ @@ -617,4 +618,4 @@ data: "title": "Agones Controller Resource Usage", "uid": "ktm3s0Umk", "version": 1 - } \ No newline at end of file + } diff --git a/build/grafana/dashboard-extensions-status.yaml b/build/grafana/dashboard-extensions-status.yaml index 635affe124..d5e9ea9846 100644 --- a/build/grafana/dashboard-extensions-status.yaml +++ b/build/grafana/dashboard-extensions-status.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2023 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,9 +20,9 @@ metadata: name: agones-extensions-status namespace: metrics labels: - grafana_dashboard: "1" + grafana_dashboard: '1' data: - dashboard-agones-extensions-status.json: | + dashboard-agones-extensions-status.json: |- { "annotations": { "list": [ diff --git a/build/grafana/dashboard-extensions-usage.yaml b/build/grafana/dashboard-extensions-usage.yaml index aa7e400a69..307da4e596 100644 --- a/build/grafana/dashboard-extensions-usage.yaml +++ b/build/grafana/dashboard-extensions-usage.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2023 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,9 +20,9 @@ metadata: name: agones-extensions-usage namespace: metrics labels: - grafana_dashboard: "1" + grafana_dashboard: '1' data: - dashboard-agones-extensions-usage.json: | + dashboard-agones-extensions-usage.json: |- { "annotations": { "list": [ diff --git a/build/grafana/dashboard-gameservers.yaml b/build/grafana/dashboard-gameservers.yaml index b6080b3459..b71f244fcd 100644 --- a/build/grafana/dashboard-gameservers.yaml +++ b/build/grafana/dashboard-gameservers.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2018 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,9 +20,9 @@ metadata: name: agones-gameservers namespace: metrics labels: - grafana_dashboard: "1" + grafana_dashboard: '1' data: - dashboard-agones-gameservers.json: | + dashboard-agones-gameservers.json: |- { "annotations": { "list": [ diff --git a/build/grafana/dashboard-goclient-caches.yaml b/build/grafana/dashboard-goclient-caches.yaml index 8f46ae939d..0f668610d5 100644 --- a/build/grafana/dashboard-goclient-caches.yaml +++ b/build/grafana/dashboard-goclient-caches.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2019 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,9 +20,9 @@ metadata: name: agones-goclient-caches namespace: metrics labels: - grafana_dashboard: "1" + grafana_dashboard: '1' data: - dashboard-agones-goclient-caches.json: | + dashboard-agones-goclient-caches.json: |- { "annotations": { "list": [ @@ -570,4 +571,4 @@ data: "title": "Agones Controller go-client caches", "uid": "IcQY6i_iz", "version": 6 - } \ No newline at end of file + } diff --git a/build/grafana/dashboard-goclient-requests.yaml b/build/grafana/dashboard-goclient-requests.yaml index c9ebaa021c..bd0fa5407b 100644 --- a/build/grafana/dashboard-goclient-requests.yaml +++ b/build/grafana/dashboard-goclient-requests.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2019 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,9 +20,9 @@ metadata: name: agones-goclient-requests namespace: metrics labels: - grafana_dashboard: "1" + grafana_dashboard: '1' data: - dashboard-agones-goclient-requests.json: | + dashboard-agones-goclient-requests.json: |- { "annotations": { "list": [ @@ -398,4 +399,4 @@ data: "uid": "9VRr_m_iz", "version": 1, "weekStart": "" - } \ No newline at end of file + } diff --git a/build/grafana/dashboard-goclient-workqueues.yaml b/build/grafana/dashboard-goclient-workqueues.yaml index 075062eed0..5fcb7c0dc6 100644 --- a/build/grafana/dashboard-goclient-workqueues.yaml +++ b/build/grafana/dashboard-goclient-workqueues.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2019 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,9 +20,9 @@ metadata: name: agones-goclient-workqueues namespace: metrics labels: - grafana_dashboard: "1" + grafana_dashboard: '1' data: - dashboard-agones-goclient-workqueues.json: | + dashboard-agones-goclient-workqueues.json: |- { "annotations": { "list": [ @@ -544,4 +545,4 @@ data: "title": "Agones Controller go-client workqueue", "uid": "bztnCilik", "version": 10 - } \ No newline at end of file + } diff --git a/build/grafana/dashboard-status.yaml b/build/grafana/dashboard-status.yaml index 9c62fbab32..4eeafdfa51 100644 --- a/build/grafana/dashboard-status.yaml +++ b/build/grafana/dashboard-status.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2018 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,9 +20,9 @@ metadata: name: agones-status namespace: metrics labels: - grafana_dashboard: "1" + grafana_dashboard: '1' data: - dashboard-agones-status.json: | + dashboard-agones-status.json: |- { "annotations": { "list": [ @@ -1445,4 +1446,4 @@ data: "title": "Agones Status", "uid": "tKtFEN8iz", "version": 2 - } \ No newline at end of file + } diff --git a/build/prometheus-google-managed.yaml b/build/prometheus-google-managed.yaml index 0e562103b7..a961243a44 100644 --- a/build/prometheus-google-managed.yaml +++ b/build/prometheus-google-managed.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2023 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -11,7 +12,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - apiVersion: monitoring.googleapis.com/v1 kind: PodMonitoring metadata: @@ -22,19 +22,19 @@ spec: app: agones targetLabels: fromPod: - - from: app - to: app - - from: agones.dev/role - to: agones_dev_role - - from: multicluster.agones.dev/role - to: multicluster_agones_dev_role + - from: app + to: app + - from: agones.dev/role + to: agones_dev_role + - from: multicluster.agones.dev/role + to: multicluster_agones_dev_role endpoints: - - port: http - interval: 30s - metricRelabeling: - - sourceLabels: [namespace] - targetLabel: kubernetes_namespace - action: replace - - sourceLabels: [pod] - targetLabel: kubernetes_pod_name - action: replace + - port: http + interval: 30s + metricRelabeling: + - sourceLabels: [namespace] + targetLabel: kubernetes_namespace + action: replace + - sourceLabels: [pod] + targetLabel: kubernetes_pod_name + action: replace diff --git a/build/prometheus-stack.yaml b/build/prometheus-stack.yaml index 67fe92da20..ce9b16ec80 100644 --- a/build/prometheus-stack.yaml +++ b/build/prometheus-stack.yaml @@ -1,3 +1,4 @@ +--- # disabled all not necessary chart defaultRules: enabled: false @@ -23,7 +24,6 @@ kubeStateMetrics: enabled: false nodeExporter: enabled: false - prometheusOperator: enabled: true prometheus: diff --git a/build/prometheus.yaml b/build/prometheus.yaml index b97244c4e3..47c50f8517 100644 --- a/build/prometheus.yaml +++ b/build/prometheus.yaml @@ -1,3 +1,4 @@ +--- alertmanager: enabled: false nodeExporter: @@ -12,29 +13,26 @@ server: memory: 4Gi cpu: 2 tolerations: - - key: "agones.dev/agones-metrics" - operator: "Equal" - value: "true" - effect: "NoExecute" + - key: agones.dev/agones-metrics + operator: Equal + value: 'true' + effect: NoExecute affinity: nodeAffinity: preferredDuringSchedulingIgnoredDuringExecution: - - weight: 1 - preference: - matchExpressions: - - key: agones.dev/agones-metrics - operator: Exists + - weight: 1 + preference: + matchExpressions: + - key: agones.dev/agones-metrics + operator: Exists serverFiles: - prometheus.yml: - rule_files: - - /etc/config/rules - - /etc/config/alerts - + prometheus.yml: + rule_files: [/etc/config/rules, /etc/config/alerts] scrape_configs: - job_name: prometheus static_configs: - targets: - - localhost:9090 + - localhost:9090 # A scrape configuration for running Prometheus on a Kubernetes cluster. # This uses separate scrape configs for cluster components (i.e. API server, node) @@ -50,8 +48,7 @@ serverFiles: # the endpoints associated with the default/kubernetes service using the # default named port `https`. This works for single API server deployments as # well as HA API server deployments. - - job_name: 'kubernetes-apiservers' - + - job_name: kubernetes-apiservers kubernetes_sd_configs: - role: endpoints @@ -80,7 +77,10 @@ serverFiles: # will add targets for each API server which Kubernetes adds an endpoint to # the default/kubernetes service. relabel_configs: - - source_labels: [__meta_kubernetes_namespace, __meta_kubernetes_service_name, __meta_kubernetes_endpoint_port_name] + - source_labels: + - __meta_kubernetes_namespace + - __meta_kubernetes_service_name + - __meta_kubernetes_endpoint_port_name action: keep regex: default;kubernetes;https @@ -92,11 +92,9 @@ serverFiles: # * `prometheus.io/scrape`: Only scrape pods that have a value of `true` # * `prometheus.io/path`: If the metrics path is not `/metrics` override this. # * `prometheus.io/port`: Scrape the pod on the indicated port instead of the default of `9102`. - - job_name: 'kubernetes-pods' - + - job_name: kubernetes-pods kubernetes_sd_configs: - role: pod - relabel_configs: - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape] action: keep @@ -105,7 +103,9 @@ serverFiles: action: replace target_label: __metrics_path__ regex: (.+) - - source_labels: [__address__, __meta_kubernetes_pod_annotation_prometheus_io_port] + - source_labels: + - __address__ + - __meta_kubernetes_pod_annotation_prometheus_io_port action: replace regex: ([^:]+)(?::\d+)?;(\d+) replacement: $1:$2 @@ -117,4 +117,4 @@ serverFiles: target_label: kubernetes_namespace - source_labels: [__meta_kubernetes_pod_name] action: replace - target_label: kubernetes_pod_name \ No newline at end of file + target_label: kubernetes_pod_name diff --git a/build/release/post_cloudbuild.yaml b/build/release/post_cloudbuild.yaml index fe652dcaef..1c3ee18a26 100644 --- a/build/release/post_cloudbuild.yaml +++ b/build/release/post_cloudbuild.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -11,18 +12,17 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - steps: # # Shallow clone of Agones/main branch from the main repository # - - name: "gcr.io/cloud-builders/git" - dir: "/workspace" + - name: gcr.io/cloud-builders/git + dir: /workspace args: - - "clone" - - "--depth=1" - - "--branch=main" - - "https://github.com/googleforgames/agones.git" + - clone + - --depth=1 + - --branch=main + - https://github.com/googleforgames/agones.git # # Restore any caches @@ -30,113 +30,97 @@ steps: - name: us-docker.pkg.dev/$PROJECT_ID/ci/restore_cache id: cpp-sdk-build-restore-cache args: - - "--bucket=gs://$_CACHE_BUCKET" - - "--key=$_CPP_SDK_BUILD_CACHE_KEY-$( checksum sdks/cpp/cmake/prerequisites.cmake )" - waitFor: ["-"] - + - --bucket=gs://$_CACHE_BUCKET + - --key=$_CPP_SDK_BUILD_CACHE_KEY-$( checksum sdks/cpp/cmake/prerequisites.cmake + ) + waitFor: ['-'] - name: us-docker.pkg.dev/$PROJECT_ID/ci/restore_cache id: cpp-sdk-conformance-restore-cache args: - - "--bucket=gs://$_CACHE_BUCKET" - - "--key=$_CPP_SDK_CONFORMANCE_CACHE_KEY-$( checksum sdks/cpp/cmake/prerequisites.cmake )" - waitFor: ["-"] - + - --bucket=gs://$_CACHE_BUCKET + - --key=$_CPP_SDK_CONFORMANCE_CACHE_KEY-$( checksum sdks/cpp/cmake/prerequisites.cmake + ) + waitFor: ['-'] - name: us-docker.pkg.dev/$PROJECT_ID/ci/restore_cache id: rust-sdk-build-restore-cache args: - - "--bucket=gs://$_CACHE_BUCKET" - - "--key=$_RUST_SDK_BUILD_CACHE_KEY-$( checksum test/sdk/rust/Cargo.toml )" - waitFor: ["-"] + - --bucket=gs://$_CACHE_BUCKET + - --key=$_RUST_SDK_BUILD_CACHE_KEY-$( checksum test/sdk/rust/Cargo.toml ) + waitFor: ['-'] # # Creates the initial make + docker build platform # - - name: "ubuntu" + - name: ubuntu args: - [ - "bash", - "-c", - "echo 'FROM gcr.io/cloud-builders/docker\nRUN apt-get install make\nENTRYPOINT [\"/usr/bin/make\"]' > Dockerfile.build", - ] - waitFor: ["-"] - + - bash + - -c + - "echo 'FROM gcr.io/cloud-builders/docker\nRUN apt-get install make\nENTRYPOINT\ + \ [\"/usr/bin/make\"]' > Dockerfile.build" + waitFor: ['-'] - name: gcr.io/cloud-builders/docker id: build-make-docker - args: ["build", "-f", "Dockerfile.build", "-t", "make-docker", "."] + args: [build, -f, Dockerfile.build, -t, make-docker, .] # # Build all the images # - - name: "make-docker" + - name: make-docker id: build-images - dir: "build" + dir: build env: - - "VERSION=${_VERSION}" - - "REGISTRY=${_REGISTRY}/release" - - "FULL_BUILD=1" - args: ["-j", "1", "build"] + - VERSION=${_VERSION} + - REGISTRY=${_REGISTRY}/release + - FULL_BUILD=1 + args: [-j, '1', build] # # push all the images # - - name: "make-docker" + - name: make-docker id: push-images - waitFor: - - build-images - dir: "build" - env: - - "VERSION=${_VERSION}" - - "REGISTRY=${_REGISTRY}/release" - args: ["-j", "1", "push"] + waitFor: [build-images] + dir: build + env: ['VERSION=${_VERSION}', 'REGISTRY=${_REGISTRY}/release'] + args: [-j, '1', push] # # Creating cloud storage bucket # - name: gcr.io/cloud-builders/gsutil entrypoint: bash - args: - - "-c" - - "gsutil mb $_STORAGE || true" + args: [-c, gsutil mb $_STORAGE || true] id: create-bucket # # Zip up artifacts and push to cloud storage # - name: gcr.io/cloud-builders/gsutil - waitFor: - - build-images - dir: "cmd/sdk-server/bin" - args: ["-m", "cp", "*.zip", $_STORAGE] - + waitFor: [build-images] + dir: cmd/sdk-server/bin + args: [-m, cp, '*.zip', $_STORAGE] - name: gcr.io/cloud-builders/gsutil - waitFor: - - build-images - dir: "sdks/cpp/.archives" - args: ["-m", "cp", "*.tar.gz", $_STORAGE] - + waitFor: [build-images] + dir: sdks/cpp/.archives + args: [-m, cp, '*.tar.gz', $_STORAGE] - name: gcr.io/cloud-builders/gsutil entrypoint: bash - waitFor: - - build-images - dir: "." + waitFor: [build-images] + dir: . args: - - "-c" - - zip -r agones-install-${_VERSION}.zip ./README.md ./install ./LICENSE | gsutil -m cp -r agones-install-${_VERSION}.zip $_STORAGE + - -c + - zip -r agones-install-${_VERSION}.zip ./README.md ./install ./LICENSE | gsutil + -m cp -r agones-install-${_VERSION}.zip $_STORAGE # # Pushes the current chart version to the helm repository hosted on gcs. # - - name: "make-docker" + - name: make-docker id: push-chart - waitFor: - - build-images - - push-images - dir: "build" - env: - - "VERSION=${_VERSION}" - - DOCKER_RUN_ARGS=--network=cloudbuild - args: ["push-chart"] - + waitFor: [build-images, push-images] + dir: build + env: ['VERSION=${_VERSION}', DOCKER_RUN_ARGS=--network=cloudbuild] + args: [push-chart] options: machineType: E2_HIGHCPU_32 dynamic_substitutions: true diff --git a/build/release/pre_cloudbuild.yaml b/build/release/pre_cloudbuild.yaml index 9527504869..6babf48e4c 100644 --- a/build/release/pre_cloudbuild.yaml +++ b/build/release/pre_cloudbuild.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -11,64 +12,59 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - steps: # # Shallow clone of Agones/main branch from the main repository # - - name: "gcr.io/cloud-builders/git" - dir: "/workspace" + - name: gcr.io/cloud-builders/git + dir: /workspace args: - - "clone" - - "--depth=1" - - "--branch=main" - - "https://github.com/googleforgames/agones.git" + - clone + - --depth=1 + - --branch=main + - https://github.com/googleforgames/agones.git # # Creates the initial make + docker build platform # - - name: "ubuntu" + - name: ubuntu args: - [ - "bash", - "-c", - "echo 'FROM gcr.io/cloud-builders/docker\nRUN apt-get install make\nENTRYPOINT [\"/usr/bin/make\"]' > Dockerfile.build", - ] - waitFor: ["-"] - + - bash + - -c + - "echo 'FROM gcr.io/cloud-builders/docker\nRUN apt-get install make\nENTRYPOINT\ + \ [\"/usr/bin/make\"]' > Dockerfile.build" + waitFor: ['-'] - name: gcr.io/cloud-builders/docker id: build-make-docker - args: ["build", "-f", "Dockerfile.build", "-t", "make-docker", "."] + args: [build, -f, Dockerfile.build, -t, make-docker, .] # # pull the main build image if it exists # - - name: "make-docker" + - name: make-docker id: pull-build-image - dir: "build" - env: - - "REGISTRY=us-docker.pkg.dev/${PROJECT_ID}/ci" - args: ["pull-build-image"] + dir: build + env: ['REGISTRY=us-docker.pkg.dev/${PROJECT_ID}/ci'] + args: [pull-build-image] waitFor: - build-make-docker # # Ensure example images exists # - - name: "make-docker" + - name: make-docker id: test-examples-on-gar - dir: "build" + dir: build env: - - "REGISTRY=us-docker.pkg.dev/${PROJECT_ID}" + - REGISTRY=us-docker.pkg.dev/${PROJECT_ID} - DOCKER_RUN_ARGS=--network=cloudbuild - args: ["test-examples-on-gar"] + args: [test-examples-on-gar] # # Deploys the site by taking in the base version and deploying the previous version # - - name: "make-docker" + - name: make-docker id: release-deploy-site - dir: "build" - args: ["release-deploy-site"] - + dir: build + args: [release-deploy-site] timeout: 5400s diff --git a/build/report/cloudbuild.yaml b/build/report/cloudbuild.yaml index 5b39c2fb89..798029d436 100644 --- a/build/report/cloudbuild.yaml +++ b/build/report/cloudbuild.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2023 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -11,28 +12,22 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - # # Google Cloud Builder -- Generate report on recently flaky builds - steps: -- name: 'gcr.io/cloud-builders/gcloud' - id: build-report - script: | - #!/usr/bin/env bash - - export GO_VERSION=1.20.4 - cd /usr/local - curl -SsL https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz | tar -xzf- - - export PATH=/usr/local/go/bin:${PATH} - export GOPATH=/go - mkdir ${GOPATH} - export GO111MODULE=on - - cd /workspace - go run build/report/report.go - gcloud storage cp tmp/report/* gs://agones-build-reports/ - -tags: ["build-report"] -logsBucket: "gs://agones-build-logs" + - name: gcr.io/cloud-builders/gcloud + id: build-report + script: | + #!/usr/bin/env bash + export GO_VERSION=1.20.4 + cd /usr/local + curl -SsL https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz | tar -xzf- + export PATH=/usr/local/go/bin:${PATH} + export GOPATH=/go + mkdir ${GOPATH} + export GO111MODULE=on + cd /workspace + go run build/report/report.go + gcloud storage cp tmp/report/* gs://agones-build-reports/ +tags: [build-report] +logsBucket: gs://agones-build-logs diff --git a/ci/e2e-test-cloudbuild.yaml b/ci/e2e-test-cloudbuild.yaml index a23cf431fc..26e05f2458 100644 --- a/ci/e2e-test-cloudbuild.yaml +++ b/ci/e2e-test-cloudbuild.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2023 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -11,62 +12,54 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - # # Google Cloud Builder CI configuration # - steps: + # + # build the e2e test runner + # + - name: gcr.io/cloud-builders/docker + args: [build, -f, Dockerfile, -t, e2e-runner, .] + dir: build/e2e-image + id: build-e2e + waitFor: ['-'] -# -# build the e2e test runner -# - -- name: gcr.io/cloud-builders/docker - args: ['build', '-f', 'Dockerfile', '-t', 'e2e-runner', '.'] - dir: 'build/e2e-image' - id: build-e2e - waitFor: ['-'] - -# -# Run the e2e tests with FeatureGates inverted compared to Stable -# -# Keep in sync with (the inverse of) pkg/util/runtime/features.go:featureDefaults - -- name: 'e2e-runner' - args: - - "${_FEATURE_WITH_GATE}" - - "${_CLOUD_PRODUCT}" - - "${_TEST_CLUSTER_NAME}" - - "${_TEST_CLUSTER_LOCATION}" - - "${_REGISTRY}" - id: e2e-feature-gates - waitFor: - - build-e2e - -# -# Run the e2e tests without FeatureGates -# - -- name: 'e2e-runner' - args: - - "${_FEATURE_WITHOUT_GATE}" - - "${_CLOUD_PRODUCT}" - - "${_TEST_CLUSTER_NAME}" - - "${_TEST_CLUSTER_LOCATION}" - - "${_REGISTRY}" - - "${_PARENT_COMMIT_SHA}" - - "${_PARENT_BUILD_ID}" - id: e2e-stable - waitFor: - - e2e-feature-gates + # + # Run the e2e tests with FeatureGates inverted compared to Stable + # + # Keep in sync with (the inverse of) pkg/util/runtime/features.go:featureDefaults + - name: e2e-runner + args: + - ${_FEATURE_WITH_GATE} + - ${_CLOUD_PRODUCT} + - ${_TEST_CLUSTER_NAME} + - ${_TEST_CLUSTER_LOCATION} + - ${_REGISTRY} + id: e2e-feature-gates + waitFor: + - build-e2e + # + # Run the e2e tests without FeatureGates + # + - name: e2e-runner + args: + - ${_FEATURE_WITHOUT_GATE} + - ${_CLOUD_PRODUCT} + - ${_TEST_CLUSTER_NAME} + - ${_TEST_CLUSTER_LOCATION} + - ${_REGISTRY} + - ${_PARENT_COMMIT_SHA} + - ${_PARENT_BUILD_ID} + id: e2e-stable + waitFor: [e2e-feature-gates] tags: - - "e2e-test" - - "cluster-${_TEST_CLUSTER_NAME}" - - "location-${_TEST_CLUSTER_LOCATION}" - - "commit-${_PARENT_COMMIT_SHA}" - - "started-by-${_PARENT_BUILD_ID}" -timeout: 5400s # 1.5h -queueTtl: 7200s # 2h // only one set of e2es should be running at once -logsBucket: "gs://agones-build-logs" + - e2e-test + - cluster-${_TEST_CLUSTER_NAME} + - location-${_TEST_CLUSTER_LOCATION} + - commit-${_PARENT_COMMIT_SHA} + - started-by-${_PARENT_BUILD_ID} +timeout: 5400s # 1.5h +queueTtl: 7200s # 2h // only one set of e2es should be running at once +logsBucket: gs://agones-build-logs diff --git a/cloudbuild.yaml b/cloudbuild.yaml index cbc7255de5..12be578254 100644 --- a/cloudbuild.yaml +++ b/cloudbuild.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2017 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -11,427 +12,376 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - # # Google Cloud Builder CI configuration # - steps: - -# -# Cancel the previous build for the same branch -# - -- name: 'gcr.io/cloud-builders/gcloud-slim:latest' - id: cancelot - entrypoint: 'bash' - args: ['./ci/cancelot.sh', '--current_build_id', '$BUILD_ID'] - -# -# Print Docker version -# - -- name: gcr.io/cloud-builders/docker - id: docker-version - args: ["--version"] - -# -# Restore any caches -# - -- name: us-docker.pkg.dev/$PROJECT_ID/ci/restore_cache - id: htmltest-restore-cache - args: - - '--bucket=gs://$_CACHE_BUCKET' - - '--key=$_HTMLTEST_CACHE_KEY' - waitFor: ['-'] - -- name: us-docker.pkg.dev/$PROJECT_ID/ci/restore_cache - id: cpp-sdk-build-restore-cache - args: - - '--bucket=gs://$_CACHE_BUCKET' - - '--key=$_CPP_SDK_BUILD_CACHE_KEY-$( checksum sdks/cpp/cmake/prerequisites.cmake )' - waitFor: ['-'] - -- name: us-docker.pkg.dev/$PROJECT_ID/ci/restore_cache - id: cpp-sdk-conformance-restore-cache - args: - - '--bucket=gs://$_CACHE_BUCKET' - - '--key=$_CPP_SDK_CONFORMANCE_CACHE_KEY-$( checksum sdks/cpp/cmake/prerequisites.cmake )' - waitFor: ['-'] - -- name: us-docker.pkg.dev/$PROJECT_ID/ci/restore_cache - id: rust-sdk-build-restore-cache - args: - - '--bucket=gs://$_CACHE_BUCKET' - - '--key=$_RUST_SDK_BUILD_CACHE_KEY-$( checksum test/sdk/rust/Cargo.toml )' - waitFor: ['-'] - -# -# Creates the initial make + docker build platform -# - -- name: "ubuntu" - args: ["bash", "-c", "echo 'FROM gcr.io/cloud-builders/docker\nRUN apt-get install make\nENTRYPOINT [\"/usr/bin/make\"]' > Dockerfile.build"] - waitFor: ['-'] -- name: gcr.io/cloud-builders/docker - id: build-make-docker - args: ['build', '-f', 'Dockerfile.build', '-t', 'make-docker', '.'] # we need docker and make to run everything. - -# -# pull the main build image if it exists -# -- name: "make-docker" - id: pull-build-image - dir: "build" - env: - - "REGISTRY=${_REGISTRY}" - args: ["pull-build-image"] - waitFor: - - build-make-docker - -# -# pull the sdk base image, if it exists -# - -- name: "make-docker" - id: pull-build-sdk-base-image - dir: "build" - env: - - "REGISTRY=${_REGISTRY}" - args: ["pull-build-sdk-base-image"] - waitFor: - - build-make-docker - -# -# Ensure that there is the sdk base image, so that both tests -# and build can use them -# - -- name: "make-docker" - id: ensure-build-sdk-image-base - waitFor: - - pull-build-sdk-base-image - dir: "build" - args: ["ensure-build-sdk-image-base"] - -# -# Preventing SDKs failure in CI -# -- name: "make-docker" - id: test-gen-all-sdk-grpc - waitFor: - - ensure-build-sdk-image-base - dir: "build" - args: ["test-gen-all-sdk-grpc"] - -# -# Preventing Broken PR Merges in CI -# -- name: "make-docker" - id: test-gen-crd-client - waitFor: - - pull-build-image - dir: "build" - args: ["test-gen-crd-client"] - -# -# Runs the linter -- but also builds the build image, if not able to download -# - -- name: "make-docker" - id: lint - waitFor: - - pull-build-image - - test-gen-crd-client - - test-gen-all-sdk-grpc - dir: "build" - args: ["lint"] # pull the build image if it exists - -# -# Push the build image, can run while we do other things. -# - -- name: "make-docker" - waitFor: - - lint - dir: "build" - env: - - "REGISTRY=${_REGISTRY}" - args: ["push-build-image"] # push the build image (which won't do anything if it's already there) - -# -# Push the sdk base build image, which can also run while we do other things -# - -- name: "make-docker" - waitFor: - - ensure-build-sdk-image-base - dir: "build" - env: - - "REGISTRY=${_REGISTRY}" - args: ["push-build-sdk-base-image"] - -# -# Build all the images and sdks, and push them up to the repository -# - -- name: "make-docker" - id: build-images - waitFor: - - lint - dir: "build" - env: - - "REGISTRY=${_REGISTRY}" - args: [ "-j", "4", "build-images"] -- name: "make-docker" - id: push-images - waitFor: - - build-images - dir: "build" - env: - - "REGISTRY=${_REGISTRY}" - args: [ "-j", "4", "push"] - -# -# Build all the SDKs -# - -- name: "make-docker" - id: build-sdks - waitFor: - - lint - - cpp-sdk-build-restore-cache - - ensure-build-sdk-image-base - dir: "build" - args: [ "-j", "4", "--output-sync=recurse", "build-sdks"] - -# -# Cache the cpp sdk build directory, to speed up subsequent builds (considerably) -# - -- name: 'us-docker.pkg.dev/$PROJECT_ID/ci/save_cache' - args: - - '--bucket=gs://$_CACHE_BUCKET' - - '--key=$_CPP_SDK_BUILD_CACHE_KEY-$( checksum sdks/cpp/cmake/prerequisites.cmake )' - - '--path=sdks/cpp/.build' - id: cpp-sdk-build-save-cache - waitFor: - - build-sdks - -# -# Run the all the automated tests (except e2e) in parallel -# - -- name: "make-docker" - id: tests - waitFor: - - lint - - ensure-build-sdk-image-base - - htmltest-restore-cache - - build-sdks - dir: "build" - args: [ "-j", "5", "--output-sync=target", "test" ] - -# -# Cache the htmltest url checks. Faster builds, and lower network flakiness. -# -- name: 'us-docker.pkg.dev/$PROJECT_ID/ci/save_cache' - args: - - '--bucket=gs://$_CACHE_BUCKET' - - '--key=$_HTMLTEST_CACHE_KEY' - - '--path=site/tmp' - id: htmltest-save-cache - waitFor: - - tests - -# -# Site preview -# - -# don't promote, as it can cause failures when two deploys try and promote at the same time. - -- name: "make-docker" # build a preview of the website - id: site-static - waitFor: - - tests - dir: "build" - args: ["site-static-preview", "site-gen-app-yaml", "SERVICE=preview"] -- name: "gcr.io/cloud-builders/gcloud" # deploy the preview of the website - id: "deploy-site-static" - waitFor: - - site-static - dir: "site" - args: ["app", "deploy", ".app.yaml", "--no-promote", "--version=$SHORT_SHA"] - env: - - GOPATH=/workspace/go - - GO111MODULE=on - -# wait for us to be the oldest ongoing build before we run e2es - -- name: 'gcr.io/cloud-builders/gcloud' - id: e2e-wait-to-become-leader - waitFor: - - push-images - script: | - #!/usr/bin/env bash - - TS='date --utc +%FT%TZ' # e.g. 2023-01-26T13:30:37Z - echo "$(${TS}): Waiting to become oldest running build" - while true; do - # Filter to running builds within the same TRIGGER_NAME. We use the trigger name to - # filter rather than buildTriggerId because there is no substitution available for - # buildTriggerId. - TRIGGER_FILTER="status=WORKING AND substitutions[TRIGGER_NAME]='${TRIGGER_NAME}'" - OLDEST=$(gcloud builds list --filter "${TRIGGER_FILTER}" --format="value(id,startTime)" --sort-by=startTime --limit=1) - echo "$(${TS}): Oldest is (id startTime): ${OLDEST}" - - if echo ${OLDEST} | grep -q "${BUILD_ID}"; then - echo "$(${TS}): That's us, we're done!" - break - fi - - sleep 60 - done - timeout: 10800s # 3h - if you change this, change the global timeout as well - env: - - 'CLOUDSDK_CORE_PROJECT=$PROJECT_ID' - - 'BUILD_ID=$BUILD_ID' - - 'TRIGGER_NAME=$TRIGGER_NAME' - -# cancel all the orphan e2e test cloud builds, fail to cancel any of the build will fail this whole build - -- name: 'gcr.io/cloud-builders/gcloud' - id: cancel-orphan-e2e-tests - waitFor: - - e2e-wait-to-become-leader - script: | - #!/usr/bin/env bash - - until gcloud builds list --ongoing --filter "tags:'e2e-test'" --format="value(id)" | xargs --no-run-if-empty gcloud builds cancel - do - echo "== encountered error; assuming retryable error and trying again ==" - sleep 5 - done - - -# kick off the child e2e test cloud builds in parallel, fail this build if any of the child build fails - -- name: 'gcr.io/cloud-builders/gcloud' - id: submit-e2e-test-cloud-build - entrypoint: bash - args: - - '-c' - - | - set -e - set -o pipefail - pids=() - cloudProducts=("generic" "gke-autopilot") - declare -A versionsAndRegions=( [1.25]=us-central1 [1.26]=asia-east1 [1.27]=us-east1 ) - - for cloudProduct in ${cloudProducts[@]} + # + # Cancel the previous build for the same branch + # + - name: gcr.io/cloud-builders/gcloud-slim:latest + id: cancelot + entrypoint: bash + args: [./ci/cancelot.sh, --current_build_id, $BUILD_ID] + + # + # Print Docker version + # + - name: gcr.io/cloud-builders/docker + id: docker-version + args: [--version] + + # + # Restore any caches + # + - name: us-docker.pkg.dev/$PROJECT_ID/ci/restore_cache + id: htmltest-restore-cache + args: [--bucket=gs://$_CACHE_BUCKET, --key=$_HTMLTEST_CACHE_KEY] + waitFor: ['-'] + - name: us-docker.pkg.dev/$PROJECT_ID/ci/restore_cache + id: cpp-sdk-build-restore-cache + args: + - --bucket=gs://$_CACHE_BUCKET + - --key=$_CPP_SDK_BUILD_CACHE_KEY-$( checksum sdks/cpp/cmake/prerequisites.cmake + ) + waitFor: ['-'] + - name: us-docker.pkg.dev/$PROJECT_ID/ci/restore_cache + id: cpp-sdk-conformance-restore-cache + args: + - --bucket=gs://$_CACHE_BUCKET + - --key=$_CPP_SDK_CONFORMANCE_CACHE_KEY-$( checksum sdks/cpp/cmake/prerequisites.cmake + ) + waitFor: ['-'] + - name: us-docker.pkg.dev/$PROJECT_ID/ci/restore_cache + id: rust-sdk-build-restore-cache + args: + - --bucket=gs://$_CACHE_BUCKET + - --key=$_RUST_SDK_BUILD_CACHE_KEY-$( checksum test/sdk/rust/Cargo.toml ) + waitFor: ['-'] + + # + # Creates the initial make + docker build platform + # + - name: ubuntu + args: + - bash + - -c + - "echo 'FROM gcr.io/cloud-builders/docker\nRUN apt-get install make\nENTRYPOINT\ + \ [\"/usr/bin/make\"]' > Dockerfile.build" + waitFor: ['-'] + - name: gcr.io/cloud-builders/docker + id: build-make-docker + args: [build, -f, Dockerfile.build, -t, make-docker, .] # we need docker and make to run everything. + + # + # pull the main build image if it exists + # + - name: make-docker + id: pull-build-image + dir: build + env: ['REGISTRY=${_REGISTRY}'] + args: [pull-build-image] + waitFor: + - build-make-docker + + # + # pull the sdk base image, if it exists + # + - name: make-docker + id: pull-build-sdk-base-image + dir: build + env: ['REGISTRY=${_REGISTRY}'] + args: [pull-build-sdk-base-image] + waitFor: + - build-make-docker + + # + # Ensure that there is the sdk base image, so that both tests + # and build can use them + # + - name: make-docker + id: ensure-build-sdk-image-base + waitFor: [pull-build-sdk-base-image] + dir: build + args: [ensure-build-sdk-image-base] + + # + # Preventing SDKs failure in CI + # + - name: make-docker + id: test-gen-all-sdk-grpc + waitFor: [ensure-build-sdk-image-base] + dir: build + args: [test-gen-all-sdk-grpc] + + # + # Preventing Broken PR Merges in CI + # + - name: make-docker + id: test-gen-crd-client + waitFor: [pull-build-image] + dir: build + args: [test-gen-crd-client] + + # + # Runs the linter -- but also builds the build image, if not able to download + # + - name: make-docker + id: lint + waitFor: + - pull-build-image + - test-gen-crd-client + - test-gen-all-sdk-grpc + dir: build + args: [lint] # pull the build image if it exists + + # + # Push the build image, can run while we do other things. + # + - name: make-docker + waitFor: [lint] + dir: build + env: ['REGISTRY=${_REGISTRY}'] + args: [push-build-image] # push the build image (which won't do anything if it's already there) + + # + # Push the sdk base build image, which can also run while we do other things + # + - name: make-docker + waitFor: [ensure-build-sdk-image-base] + dir: build + env: ['REGISTRY=${_REGISTRY}'] + args: [push-build-sdk-base-image] + + # + # Build all the images and sdks, and push them up to the repository + # + - name: make-docker + id: build-images + waitFor: [lint] + dir: build + env: ['REGISTRY=${_REGISTRY}'] + args: [-j, '4', build-images] + - name: make-docker + id: push-images + waitFor: [build-images] + dir: build + env: ['REGISTRY=${_REGISTRY}'] + args: [-j, '4', push] + + # + # Build all the SDKs + # + - name: make-docker + id: build-sdks + waitFor: + - lint + - cpp-sdk-build-restore-cache + - ensure-build-sdk-image-base + dir: build + args: [-j, '4', --output-sync=recurse, build-sdks] + + # + # Cache the cpp sdk build directory, to speed up subsequent builds (considerably) + # + - name: us-docker.pkg.dev/$PROJECT_ID/ci/save_cache + args: + - --bucket=gs://$_CACHE_BUCKET + - --key=$_CPP_SDK_BUILD_CACHE_KEY-$( checksum sdks/cpp/cmake/prerequisites.cmake + ) + - --path=sdks/cpp/.build + id: cpp-sdk-build-save-cache + waitFor: + - build-sdks + + # + # Run the all the automated tests (except e2e) in parallel + # + - name: make-docker + id: tests + waitFor: + - lint + - ensure-build-sdk-image-base + - htmltest-restore-cache + - build-sdks + dir: build + args: [-j, '5', --output-sync=target, test] + + # + # Cache the htmltest url checks. Faster builds, and lower network flakiness. + # + - name: us-docker.pkg.dev/$PROJECT_ID/ci/save_cache + args: + - --bucket=gs://$_CACHE_BUCKET + - --key=$_HTMLTEST_CACHE_KEY + - --path=site/tmp + id: htmltest-save-cache + waitFor: + - tests + + # + # Site preview + # + + # don't promote, as it can cause failures when two deploys try and promote at the same time. + - name: make-docker # build a preview of the website + id: site-static + waitFor: [tests] + dir: build + args: [site-static-preview, site-gen-app-yaml, SERVICE=preview] + - name: gcr.io/cloud-builders/gcloud # deploy the preview of the website + id: deploy-site-static + waitFor: [site-static] + dir: site + args: [app, deploy, .app.yaml, --no-promote, --version=$SHORT_SHA] + env: + - GOPATH=/workspace/go + - GO111MODULE=on + + # wait for us to be the oldest ongoing build before we run e2es + - name: gcr.io/cloud-builders/gcloud + id: e2e-wait-to-become-leader + waitFor: [push-images] + script: | + #!/usr/bin/env bash + TS='date --utc +%FT%TZ' # e.g. 2023-01-26T13:30:37Z + echo "$(${TS}): Waiting to become oldest running build" + while true; do + # Filter to running builds within the same TRIGGER_NAME. We use the trigger name to + # filter rather than buildTriggerId because there is no substitution available for + # buildTriggerId. + TRIGGER_FILTER="status=WORKING AND substitutions[TRIGGER_NAME]='${TRIGGER_NAME}'" + OLDEST=$(gcloud builds list --filter "${TRIGGER_FILTER}" --format="value(id,startTime)" --sort-by=startTime --limit=1) + echo "$(${TS}): Oldest is (id startTime): ${OLDEST}" + if echo ${OLDEST} | grep -q "${BUILD_ID}"; then + echo "$(${TS}): That's us, we're done!" + break + fi + sleep 60 + done + timeout: 10800s # 3h - if you change this, change the global timeout as well + env: + - CLOUDSDK_CORE_PROJECT=$PROJECT_ID + - BUILD_ID=$BUILD_ID + - TRIGGER_NAME=$TRIGGER_NAME + + # cancel all the orphan e2e test cloud builds, fail to cancel any of the build will fail this whole build + - name: gcr.io/cloud-builders/gcloud + id: cancel-orphan-e2e-tests + waitFor: [e2e-wait-to-become-leader] + script: | + #!/usr/bin/env bash + until gcloud builds list --ongoing --filter "tags:'e2e-test'" --format="value(id)" | xargs --no-run-if-empty gcloud builds cancel do - for version in "${!versionsAndRegions[@]}" - do - region=${versionsAndRegions[$version]} - if [ $cloudProduct = generic ] - then - featureWithGate="PlayerAllocationFilter=true&PlayerTracking=true&ResetMetricsOnDelete=false&PodHostname=false&SplitControllerAndExtensions=false&FleetAllocationOverflow=true&Example=true" - testCluster="standard-e2e-test-cluster-${version//./-}" - else - featureWithGate="PlayerAllocationFilter=true&PlayerTracking=true&ResetMetricsOnDelete=false&PodHostname=false&SplitControllerAndExtensions=true&FleetAllocationOverflow=true&Example=true" - testCluster="gke-autopilot-e2e-test-cluster-${version//./-}" - fi - featureWithoutGate="" - testClusterLocation="${region}" - { stdbuf -oL -eL gcloud builds submit . --suppress-logs --config=./ci/e2e-test-cloudbuild.yaml \ - --substitutions _FEATURE_WITH_GATE=$featureWithGate,_FEATURE_WITHOUT_GATE=$featureWithoutGate,_CLOUD_PRODUCT=$cloudProduct,_TEST_CLUSTER_NAME=$testCluster,_TEST_CLUSTER_LOCATION=$testClusterLocation,_REGISTRY=${_REGISTRY},_PARENT_COMMIT_SHA=${COMMIT_SHA},_PARENT_BUILD_ID=${BUILD_ID} \ - |& stdbuf -i0 -oL -eL grep -v " tarball " \ - |& stdbuf -i0 -oL -eL sed "s/^/${cloudProduct}-${version}: /"; } & - pids+=($!) - done + echo "== encountered error; assuming retryable error and trying again ==" + sleep 5 done - # If any of the subprocess exit with nonzero code, exit the main process and kill all subprocesses - for pid in "${pids[@]}"; do - if wait -n; then - : - else - status=$? - echo "One of the e2e test child cloud build exited with nonzero status $status. Aborting." - for pid in "${pids[@]}"; do - # Send a termination signal to all the children, and ignore errors - # due to children that no longer exist. - kill "$pid" 2> /dev/null || : - echo "killed $pid" + # kick off the child e2e test cloud builds in parallel, fail this build if any of the child build fails + - name: gcr.io/cloud-builders/gcloud + id: submit-e2e-test-cloud-build + entrypoint: bash + args: + - -c + - | + set -e + set -o pipefail + pids=() + cloudProducts=("generic" "gke-autopilot") + declare -A versionsAndRegions=( [1.25]=us-central1 [1.26]=asia-east1 [1.27]=us-east1 ) + for cloudProduct in ${cloudProducts[@]} + do + for version in "${!versionsAndRegions[@]}" + do + region=${versionsAndRegions[$version]} + if [ $cloudProduct = generic ] + then + featureWithGate="PlayerAllocationFilter=true&PlayerTracking=true&ResetMetricsOnDelete=false&PodHostname=false&SplitControllerAndExtensions=false&FleetAllocationOverflow=true&Example=true" + testCluster="standard-e2e-test-cluster-${version//./-}" + else + featureWithGate="PlayerAllocationFilter=true&PlayerTracking=true&ResetMetricsOnDelete=false&PodHostname=false&SplitControllerAndExtensions=true&FleetAllocationOverflow=true&Example=true" + testCluster="gke-autopilot-e2e-test-cluster-${version//./-}" + fi + featureWithoutGate="" + testClusterLocation="${region}" + { stdbuf -oL -eL gcloud builds submit . --suppress-logs --config=./ci/e2e-test-cloudbuild.yaml \ + --substitutions _FEATURE_WITH_GATE=$featureWithGate,_FEATURE_WITHOUT_GATE=$featureWithoutGate,_CLOUD_PRODUCT=$cloudProduct,_TEST_CLUSTER_NAME=$testCluster,_TEST_CLUSTER_LOCATION=$testClusterLocation,_REGISTRY=${_REGISTRY},_PARENT_COMMIT_SHA=${COMMIT_SHA},_PARENT_BUILD_ID=${BUILD_ID} \ + |& stdbuf -i0 -oL -eL grep -v " tarball " \ + |& stdbuf -i0 -oL -eL sed "s/^/${cloudProduct}-${version}: /"; } & + pids+=($!) done - exit "$status" - fi - done - - echo "all done" - waitFor: - - cancel-orphan-e2e-tests - -# -# SDK conformance tests -# - -- name: "make-docker" - id: sdk-conformance - dir: "build" - env: - - "REGISTRY=${_REGISTRY}" - args: [ "-j", "5", "--output-sync=target", "run-sdk-conformance-tests"] - waitFor: - - build-images - - tests - -# -# Cache the CPP conformance build directory, to speed up subsequent builds (considerably) -# - -- name: 'us-docker.pkg.dev/$PROJECT_ID/ci/save_cache' - args: - - '--bucket=gs://$_CACHE_BUCKET' - - '--key=$_CPP_SDK_CONFORMANCE_CACHE_KEY-$( checksum sdks/cpp/cmake/prerequisites.cmake )' - - '--path=test/sdk/cpp/sdk' - id: cpp-sdk-conformance-save-cache - waitFor: - - sdk-conformance - -# -# Cache the Rust SDK build directory, to speed up subsequent builds (considerably) -# - -- name: 'us-docker.pkg.dev/$PROJECT_ID/ci/save_cache' - args: - - '--bucket=gs://$_CACHE_BUCKET' - - '--key=$_RUST_SDK_BUILD_CACHE_KEY-$( checksum test/sdk/rust/Cargo.toml )' - - '--path=test/sdk/rust/.cargo' - - '--path=test/sdk/rust/.cargo-targets' - - '--no-clobber' - id: rust-build-save-cache - waitFor: - - sdk-conformance - -# -# Zip up artifacts and push to storage -# - -- name: 'gcr.io/cloud-builders/gsutil' - waitFor: - - build-sdks - - tests - dir: "sdks/cpp/.archives" - args: [ '-m', 'cp', '*.tar.gz', 'gs://agones-artifacts/cpp-sdk'] -- name: 'gcr.io/cloud-builders/gsutil' - waitFor: - - build-images - - tests - dir: "cmd/sdk-server/bin" - args: [ '-m', 'cp', '*.zip', 'gs://agones-artifacts/sdk-server'] + done + # If any of the subprocess exit with nonzero code, exit the main process and kill all subprocesses + for pid in "${pids[@]}"; do + if wait -n; then + : + else + status=$? + echo "One of the e2e test child cloud build exited with nonzero status $status. Aborting." + for pid in "${pids[@]}"; do + # Send a termination signal to all the children, and ignore errors + # due to children that no longer exist. + kill "$pid" 2> /dev/null || : + echo "killed $pid" + done + exit "$status" + fi + done + echo "all done" + waitFor: + - cancel-orphan-e2e-tests + + # + # SDK conformance tests + # + - name: make-docker + id: sdk-conformance + dir: build + env: ['REGISTRY=${_REGISTRY}'] + args: [-j, '5', --output-sync=target, run-sdk-conformance-tests] + waitFor: + - build-images + - tests + + # + # Cache the CPP conformance build directory, to speed up subsequent builds (considerably) + # + - name: us-docker.pkg.dev/$PROJECT_ID/ci/save_cache + args: + - --bucket=gs://$_CACHE_BUCKET + - --key=$_CPP_SDK_CONFORMANCE_CACHE_KEY-$( checksum sdks/cpp/cmake/prerequisites.cmake + ) + - --path=test/sdk/cpp/sdk + id: cpp-sdk-conformance-save-cache + waitFor: + - sdk-conformance + + # + # Cache the Rust SDK build directory, to speed up subsequent builds (considerably) + # + - name: us-docker.pkg.dev/$PROJECT_ID/ci/save_cache + args: + - --bucket=gs://$_CACHE_BUCKET + - --key=$_RUST_SDK_BUILD_CACHE_KEY-$( checksum test/sdk/rust/Cargo.toml ) + - --path=test/sdk/rust/.cargo + - --path=test/sdk/rust/.cargo-targets + - --no-clobber + id: rust-build-save-cache + waitFor: + - sdk-conformance + + # + # Zip up artifacts and push to storage + # + - name: gcr.io/cloud-builders/gsutil + waitFor: [build-sdks, tests] + dir: sdks/cpp/.archives + args: [-m, cp, '*.tar.gz', gs://agones-artifacts/cpp-sdk] + - name: gcr.io/cloud-builders/gsutil + waitFor: [build-images, tests] + dir: cmd/sdk-server/bin + args: [-m, cp, '*.zip', gs://agones-artifacts/sdk-server] substitutions: _CACHE_BUCKET: agones-build-cache _HTMLTEST_CACHE_KEY: htmltest-0.10.1 @@ -439,18 +389,16 @@ substitutions: _CPP_SDK_CONFORMANCE_CACHE_KEY: cpp-sdk-conformance _RUST_SDK_BUILD_CACHE_KEY: rust-sdk-build _REGISTRY: us-docker.pkg.dev/${PROJECT_ID}/ci -tags: - - "ci" - - "commit-${COMMIT_SHA}" -timeout: 18000s # 5h: 3h (e2e-wait-to-become-leader) + 1.5h (e2e timeout) + 0.5h (everything else) -queueTtl: 259200s # 72h +tags: [ci, 'commit-${COMMIT_SHA}'] +timeout: 18000s # 5h: 3h (e2e-wait-to-become-leader) + 1.5h (e2e timeout) + 0.5h (everything else) +queueTtl: 259200s # 72h images: - - '${_REGISTRY}/agones-controller' - - '${_REGISTRY}/agones-extensions' - - '${_REGISTRY}/agones-sdk' - - '${_REGISTRY}/agones-ping' - - '${_REGISTRY}/agones-allocator' -logsBucket: "gs://agones-build-logs" + - ${_REGISTRY}/agones-controller + - ${_REGISTRY}/agones-extensions + - ${_REGISTRY}/agones-sdk + - ${_REGISTRY}/agones-ping + - ${_REGISTRY}/agones-allocator +logsBucket: gs://agones-build-logs options: - machineType: 'E2_HIGHCPU_32' + machineType: E2_HIGHCPU_32 dynamic_substitutions: true diff --git a/examples/allocation-endpoint/cloudbuild.yaml b/examples/allocation-endpoint/cloudbuild.yaml index 4d86765e38..cd1132d530 100644 --- a/examples/allocation-endpoint/cloudbuild.yaml +++ b/examples/allocation-endpoint/cloudbuild.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -11,30 +12,27 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - steps: # # Creates the initial make + docker build platform # - - name: "ubuntu" + - name: ubuntu script: | echo 'FROM gcr.io/cloud-builders/docker\nRUN apt-get install make\nENTRYPOINT [\"/usr/bin/make\"]' > Dockerfile.build - name: gcr.io/cloud-builders/docker id: build-make-docker - entrypoint: "docker" - args: ["build", "-f", "Dockerfile.build", "-t", "make-docker", "."] + entrypoint: docker + args: [build, -f, Dockerfile.build, -t, make-docker, .] # build and push allocation-endpoint image to GCR - - name: "make-docker" + - name: make-docker id: push - dir: "." - env: - - REPOSITORY=${_REPOSITORY} + dir: . + env: ['REPOSITORY=${_REPOSITORY}'] script: | make push options: dynamic_substitutions: true - substitutions: _REPOSITORY: us-docker.pkg.dev/${PROJECT_ID}/examples -timeout: 1800s \ No newline at end of file +timeout: 1800s diff --git a/examples/allocation-endpoint/patch-agones-allocator.yaml b/examples/allocation-endpoint/patch-agones-allocator.yaml index 3269cb42e2..5baf8cae48 100644 --- a/examples/allocation-endpoint/patch-agones-allocator.yaml +++ b/examples/allocation-endpoint/patch-agones-allocator.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2022 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -11,20 +12,18 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - spec: template: spec: containers: - - name: esp - image: gcr.io/endpoints-release/endpoints-runtime:2 - imagePullPolicy: IfNotPresent - args: [ - "--listener_port=9443", - "--generate_self_signed_cert", - "--backend=grpc://127.0.0.1:8443", - "--service=agones-allocation.endpoints.[GKE-PROJECT-ID].cloud.goog", - "--rollout_strategy=managed", - ] - ports: - - containerPort: 9443 \ No newline at end of file + - name: esp + image: gcr.io/endpoints-release/endpoints-runtime:2 + imagePullPolicy: IfNotPresent + args: + - --listener_port=9443 + - --generate_self_signed_cert + - --backend=grpc://127.0.0.1:8443 + - --service=agones-allocation.endpoints.[GKE-PROJECT-ID].cloud.goog + - --rollout_strategy=managed + ports: + - containerPort: 9443 diff --git a/examples/autoscaler-webhook/autoscaler-service-tls.yaml b/examples/autoscaler-webhook/autoscaler-service-tls.yaml index e49cfacc55..46635114bc 100644 --- a/examples/autoscaler-webhook/autoscaler-service-tls.yaml +++ b/examples/autoscaler-webhook/autoscaler-service-tls.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2018 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -13,7 +14,6 @@ # limitations under the License. # Define a Service for the autoscaler-webhook - apiVersion: v1 kind: Service metadata: @@ -24,10 +24,10 @@ spec: selector: app: autoscaler-webhook-tls ports: - - port: 8000 - protocol: TCP - name: https - targetPort: autoscaler + - port: 8000 + protocol: TCP + name: https + targetPort: autoscaler --- # Deploy a pod to run the autoscaler-webhook code apiVersion: apps/v1 @@ -47,35 +47,34 @@ spec: labels: app: autoscaler-webhook-tls spec: - #serviceAccount: autoscaler-webhook + # serviceAccount: autoscaler-webhook volumes: - - name: secret-volume - secret: - secretName: autoscalersecret + - name: secret-volume + secret: + secretName: autoscalersecret containers: - - name: autoscaler-webhook - image: us-docker.pkg.dev/agones-images/examples/autoscaler-webhook:0.7 - imagePullPolicy: Always - volumeMounts: - - mountPath: /home/service/certs - name: secret-volume - ports: - - name: autoscaler - containerPort: 8000 - livenessProbe: - httpGet: - scheme: HTTPS - path: /health - port: 8000 - initialDelaySeconds: 3 - periodSeconds: 5 - env: - - name: MIN_REPLICAS_COUNT - value: "2" - - name: REPLICA_UPSCALE_TRIGGER - value: "0.7" - - name: REPLICA_DOWNSCALE_TRIGGER - value: "0.3" - - name: "SCALE_FACTOR" - value: "2" - + - name: autoscaler-webhook + image: us-docker.pkg.dev/agones-images/examples/autoscaler-webhook:0.7 + imagePullPolicy: Always + volumeMounts: + - mountPath: /home/service/certs + name: secret-volume + ports: + - name: autoscaler + containerPort: 8000 + livenessProbe: + httpGet: + scheme: HTTPS + path: /health + port: 8000 + initialDelaySeconds: 3 + periodSeconds: 5 + env: + - name: MIN_REPLICAS_COUNT + value: '2' + - name: REPLICA_UPSCALE_TRIGGER + value: '0.7' + - name: REPLICA_DOWNSCALE_TRIGGER + value: '0.3' + - name: SCALE_FACTOR + value: '2' diff --git a/examples/autoscaler-webhook/autoscaler-service.yaml b/examples/autoscaler-webhook/autoscaler-service.yaml index f654889d87..69f583018b 100644 --- a/examples/autoscaler-webhook/autoscaler-service.yaml +++ b/examples/autoscaler-webhook/autoscaler-service.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2018 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -13,7 +14,6 @@ # limitations under the License. # Define a Service for the autoscaler-webhook - apiVersion: v1 kind: Service metadata: @@ -24,10 +24,10 @@ spec: selector: app: autoscaler-webhook ports: - - port: 8000 - protocol: TCP - name: https - targetPort: autoscaler + - port: 8000 + protocol: TCP + name: https + targetPort: autoscaler --- # Deploy a pod to run the autoscaler-webhook code apiVersion: apps/v1 @@ -47,19 +47,18 @@ spec: labels: app: autoscaler-webhook spec: - #serviceAccount: autoscaler-webhook + # serviceAccount: autoscaler-webhook containers: - - name: autoscaler-webhook - image: us-docker.pkg.dev/agones-images/examples/autoscaler-webhook:0.7 - imagePullPolicy: Always - ports: - - name: autoscaler - containerPort: 8000 - livenessProbe: - httpGet: - scheme: HTTP - path: /health - port: 8000 - initialDelaySeconds: 3 - periodSeconds: 5 - + - name: autoscaler-webhook + image: us-docker.pkg.dev/agones-images/examples/autoscaler-webhook:0.7 + imagePullPolicy: Always + ports: + - name: autoscaler + containerPort: 8000 + livenessProbe: + httpGet: + scheme: HTTP + path: /health + port: 8000 + initialDelaySeconds: 3 + periodSeconds: 5 diff --git a/examples/autoscaler-webhook/cloudbuild.yaml b/examples/autoscaler-webhook/cloudbuild.yaml index 8000be4f5d..77665352c0 100644 --- a/examples/autoscaler-webhook/cloudbuild.yaml +++ b/examples/autoscaler-webhook/cloudbuild.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -11,30 +12,27 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - steps: # # Creates the initial make + docker build platform # - - name: "ubuntu" + - name: ubuntu script: | echo 'FROM gcr.io/cloud-builders/docker\nRUN apt-get install make\nENTRYPOINT [\"/usr/bin/make\"]' > Dockerfile.build - name: gcr.io/cloud-builders/docker id: build-make-docker - entrypoint: "docker" - args: ["build", "-f", "Dockerfile.build", "-t", "make-docker", "."] + entrypoint: docker + args: [build, -f, Dockerfile.build, -t, make-docker, .] # build and push allocation-endpoint image to GCR - - name: "make-docker" + - name: make-docker id: push - dir: "/workspace/examples/autoscaler-webhook/" - env: - - REPOSITORY=${_REPOSITORY} + dir: /workspace/examples/autoscaler-webhook/ + env: ['REPOSITORY=${_REPOSITORY}'] script: | make push options: dynamic_substitutions: true - substitutions: _REPOSITORY: us-docker.pkg.dev/${PROJECT_ID}/examples timeout: 1800s diff --git a/examples/counterfleetautoscaler.yaml b/examples/counterfleetautoscaler.yaml index dcff9226e8..efcb5bf067 100644 --- a/examples/counterfleetautoscaler.yaml +++ b/examples/counterfleetautoscaler.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2023 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -22,26 +23,25 @@ # # For a full reference and details: https://agones.dev/site/docs/reference/fleetautoscaler/ # - -apiVersion: "autoscaling.agones.dev/v1" +apiVersion: autoscaling.agones.dev/v1 kind: FleetAutoscaler metadata: - name: fleet-autoscaler-counter + name: fleet-autoscaler-counter spec: - fleetName: fleet-example - policy: - type: Counter # Counter based autoscaling - counter: - # The name of the Counter. - # Required. - key: players - # Size of a buffer of counted items that are available in the Fleet (available capacity). - # bufferSize can be specified either in absolute (i.e. 5) or percentage format (i.e. 5%). - # Required. - bufferSize: 5 - # Minimum aggregate counter capacity that can be provided by this FleetAutoscaler. - # If minCapacity is not specified, the actual minimum capacity will be bufferSize. - minCapacity: 10 - # Maximum aggregate counter capacity that can be provided by this FleetAutoscaler. - # Required. - maxCapacity: 100 + fleetName: fleet-example + policy: + type: Counter # Counter based autoscaling + counter: + # The name of the Counter. + # Required. + key: players + # Size of a buffer of counted items that are available in the Fleet (available capacity). + # bufferSize can be specified either in absolute (i.e. 5) or percentage format (i.e. 5%). + # Required. + bufferSize: 5 + # Minimum aggregate counter capacity that can be provided by this FleetAutoscaler. + # If minCapacity is not specified, the actual minimum capacity will be bufferSize. + minCapacity: 10 + # Maximum aggregate counter capacity that can be provided by this FleetAutoscaler. + # Required. + maxCapacity: 100 diff --git a/examples/cpp-simple/cloudbuild.yaml b/examples/cpp-simple/cloudbuild.yaml index 1417d3af78..593a54b875 100644 --- a/examples/cpp-simple/cloudbuild.yaml +++ b/examples/cpp-simple/cloudbuild.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -11,30 +12,27 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - steps: # # Creates the initial make + docker build platform # - - name: "ubuntu" + - name: ubuntu script: | echo 'FROM gcr.io/cloud-builders/docker\nRUN apt-get install make\nENTRYPOINT [\"/usr/bin/make\"]' > Dockerfile.build - name: gcr.io/cloud-builders/docker id: build-make-docker - entrypoint: "docker" - args: ["build", "-f", "Dockerfile.build", "-t", "make-docker", "."] + entrypoint: docker + args: [build, -f, Dockerfile.build, -t, make-docker, .] # build and push cpp-simple image to GCR - - name: "make-docker" + - name: make-docker id: push - dir: "/workspace/examples/cpp-simple" - env: - - REPOSITORY=${_REPOSITORY} + dir: /workspace/examples/cpp-simple + env: ['REPOSITORY=${_REPOSITORY}'] script: | make push options: dynamic_substitutions: true - substitutions: _REPOSITORY: us-docker.pkg.dev/${PROJECT_ID}/examples -timeout: 7200s \ No newline at end of file +timeout: 7200s diff --git a/examples/cpp-simple/fleet.yaml b/examples/cpp-simple/fleet.yaml index 7a3262432a..e9846ba3b4 100644 --- a/examples/cpp-simple/fleet.yaml +++ b/examples/cpp-simple/fleet.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2017 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -11,8 +12,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - -apiVersion: "agones.dev/v1" +apiVersion: agones.dev/v1 kind: Fleet metadata: # generate a unique name @@ -23,12 +23,12 @@ spec: template: spec: ports: - - name: default - portPolicy: Dynamic - containerPort: 7654 + - name: default + portPolicy: Dynamic + containerPort: 7654 template: spec: containers: - name: cpp-simple image: us-docker.pkg.dev/agones-images/examples/cpp-simple-server:0.15 - # imagePullPolicy: Always # add for development \ No newline at end of file + # imagePullPolicy: Always # add for development diff --git a/examples/cpp-simple/gameserver.yaml b/examples/cpp-simple/gameserver.yaml index dd02b7c494..7ea90c0c72 100644 --- a/examples/cpp-simple/gameserver.yaml +++ b/examples/cpp-simple/gameserver.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2017 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -11,8 +12,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - -apiVersion: "agones.dev/v1" +apiVersion: agones.dev/v1 kind: GameServer metadata: # generate a unique name @@ -26,6 +26,6 @@ spec: template: spec: containers: - - name: cpp-simple - image: us-docker.pkg.dev/agones-images/examples/cpp-simple-server:0.15 - imagePullPolicy: Always # add for development \ No newline at end of file + - name: cpp-simple + image: us-docker.pkg.dev/agones-images/examples/cpp-simple-server:0.15 + imagePullPolicy: Always # add for development diff --git a/examples/crd-client/cloudbuild.yaml b/examples/crd-client/cloudbuild.yaml index e60b43ffd8..52450b7bf3 100644 --- a/examples/crd-client/cloudbuild.yaml +++ b/examples/crd-client/cloudbuild.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -11,30 +12,27 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - steps: # # Creates the initial make + docker build platform # - - name: "ubuntu" + - name: ubuntu script: | echo 'FROM gcr.io/cloud-builders/docker\nRUN apt-get install make\nENTRYPOINT [\"/usr/bin/make\"]' > Dockerfile.build - name: gcr.io/cloud-builders/docker id: build-make-docker - entrypoint: "docker" - args: ["build", "-f", "Dockerfile.build", "-t", "make-docker", "."] + entrypoint: docker + args: [build, -f, Dockerfile.build, -t, make-docker, .] # build and push crd-client image to GCR - - name: "make-docker" + - name: make-docker id: push - dir: "." - env: - - REPOSITORY=${_REPOSITORY} + dir: . + env: ['REPOSITORY=${_REPOSITORY}'] script: | make push options: dynamic_substitutions: true - substitutions: _REPOSITORY: us-docker.pkg.dev/${PROJECT_ID}/examples -timeout: 1800s \ No newline at end of file +timeout: 1800s diff --git a/examples/crd-client/create-gs.yaml b/examples/crd-client/create-gs.yaml index 925b1ef74f..2b86de866e 100644 --- a/examples/crd-client/create-gs.yaml +++ b/examples/crd-client/create-gs.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2020 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -11,7 +12,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - apiVersion: batch/v1 kind: Job metadata: @@ -24,19 +24,19 @@ spec: spec: serviceAccountName: agones-controller containers: - - name: create-gameserver - resources: - limits: - cpu: 500m - ephemeral-storage: 1Gi - memory: 2Gi - requests: - cpu: 500m - ephemeral-storage: 1Gi - memory: 2Gi - image: us-docker.pkg.dev/agones-images/examples/crd-client:0.10 - imagePullPolicy: Always - env: - - name: GAMESERVER_IMAGE - value: "us-docker.pkg.dev/agones-images/examples/simple-game-server:0.17" + - name: create-gameserver + resources: + limits: + cpu: 500m + ephemeral-storage: 1Gi + memory: 2Gi + requests: + cpu: 500m + ephemeral-storage: 1Gi + memory: 2Gi + image: us-docker.pkg.dev/agones-images/examples/crd-client:0.10 + imagePullPolicy: Always + env: + - name: GAMESERVER_IMAGE + value: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.17 restartPolicy: Never diff --git a/examples/fleet.yaml b/examples/fleet.yaml index 7b89266ce2..8c313146a2 100644 --- a/examples/fleet.yaml +++ b/examples/fleet.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2018 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -21,8 +22,7 @@ # # For a full reference and details: https://agones.dev/site/docs/reference/fleet/ # - -apiVersion: "agones.dev/v1" +apiVersion: agones.dev/v1 kind: Fleet metadata: name: fleet-example @@ -58,7 +58,7 @@ spec: # allocationOverflow: # labels: # mykey: myvalue - # version: "" # empty an existing label value + # version: "" # empty an existing label value # annotations: # otherkey: setthisvalue # @@ -66,9 +66,9 @@ spec: # [FeatureFlag:CountsAndLists] # Which gameservers in the Fleet are most important to keep around - impacts scale down logic. # priorities: - # - type: List # 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. + # - type: List # 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 @@ -78,9 +78,9 @@ spec: # GameServer specification spec: ports: - - name: default - portPolicy: Dynamic - containerPort: 26000 + - name: default + portPolicy: Dynamic + containerPort: 26000 health: initialDelaySeconds: 30 periodSeconds: 60 @@ -101,10 +101,10 @@ spec: # count: 9 # capacity: 10 # sessions: - # count: # Count and/or capacity must be listed (but may be nil) otherwise the counter will by dropped by the CRD schema. + # count: # Count and/or capacity must be listed (but may be nil) otherwise the counter will by dropped by the CRD schema. # lists: # players: - # capacity: # Capacity and/or values must be listed (but may be nil) otherwise the list will be dropped by the CRD schema. + # capacity: # Capacity and/or values must be listed (but may be nil) otherwise the list will be dropped by the CRD schema. # rooms: # capacity: 5 # values: @@ -116,5 +116,5 @@ spec: template: spec: containers: - - name: simple-game-server - image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.17 + - name: simple-game-server + image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.17 diff --git a/examples/fleetautoscaler.yaml b/examples/fleetautoscaler.yaml index a3b05656d7..154b9cd6ee 100644 --- a/examples/fleetautoscaler.yaml +++ b/examples/fleetautoscaler.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2018 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -20,8 +21,7 @@ # # For a full reference and details: https://agones.dev/site/docs/reference/fleetautoscaler/ # - -apiVersion: "autoscaling.agones.dev/v1" +apiVersion: autoscaling.agones.dev/v1 kind: FleetAutoscaler metadata: name: fleet-autoscaler-example @@ -36,12 +36,12 @@ spec: # parameters of the buffer policy buffer: # Size of a buffer of "ready" and "reserved" game server instances. - # The FleetAutoscaler will scale the fleet up and down trying to maintain this buffer, + # The FleetAutoscaler will scale the fleet up and down trying to maintain this buffer, # as instances are being allocated or terminated. # Note that "reserved" game servers could not be scaled down. # It can be specified either in absolute (i.e. 5) or percentage format (i.e. 5%) bufferSize: 5 - # minimum fleet size to be set by this FleetAutoscaler. + # minimum fleet size to be set by this FleetAutoscaler. # if not specified, the actual minimum fleet size will be bufferSize minReplicas: 10 # maximum fleet size that can be set by this FleetAutoscaler diff --git a/examples/gameserver.yaml b/examples/gameserver.yaml index dc2c820e13..6f84051dea 100644 --- a/examples/gameserver.yaml +++ b/examples/gameserver.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2017 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -24,34 +25,33 @@ # # For a full reference and details: https://agones.dev/site/docs/reference/gameserver/ # - -apiVersion: "agones.dev/v1" +apiVersion: agones.dev/v1 kind: GameServer metadata: - # generateName: "gds-example" # generate a unique name, with the given prefix - name: "gds-example" # set a fixed name + # generateName: "gds-example" # generate a unique name, with the given prefix + name: gds-example # set a fixed name spec: # if there is more than one container, specify which one is the game server container: example-server # Array of ports that can be exposed as direct connections to the game server container ports: # name is a descriptive name for the port - - name: default - # portPolicy has three options: - # - "Dynamic" (default) the system allocates a free hostPort for the gameserver, for game clients to connect to - # - "Static", user defines the hostPort that the game client will connect to. Then onus is on the user to ensure that the - # port is available. When static is the policy specified, `hostPort` is required to be populated - # - "Passthrough" dynamically sets the `containerPort` to the same value as the dynamically selected hostPort. - # This will mean that users will need to lookup what port has been opened through the server side SDK. - portPolicy: Dynamic - # The name of the container to open the port on. Defaults to the game server container if omitted or empty. - container: simple-game-server - # the port that is being opened on the game server process - containerPort: 7654 - # the port exposed on the host, only required when `portPolicy` is "Static". Overwritten when portPolicy is "Dynamic". - # hostPort: 7777 - # protocol being used. Defaults to UDP. TCP and TCPUDP are other options - protocol: UDP + - name: default + # portPolicy has three options: + # - "Dynamic" (default) the system allocates a free hostPort for the gameserver, for game clients to connect to + # - "Static", user defines the hostPort that the game client will connect to. Then onus is on the user to ensure that the + # port is available. When static is the policy specified, `hostPort` is required to be populated + # - "Passthrough" dynamically sets the `containerPort` to the same value as the dynamically selected hostPort. + # This will mean that users will need to lookup what port has been opened through the server side SDK. + portPolicy: Dynamic + # The name of the container to open the port on. Defaults to the game server container if omitted or empty. + container: simple-game-server + # the port that is being opened on the game server process + containerPort: 7654 + # the port exposed on the host, only required when `portPolicy` is "Static". Overwritten when portPolicy is "Dynamic". + # hostPort: 7777 + # protocol being used. Defaults to UDP. TCP and TCPUDP are other options + protocol: UDP # Health checking for the running game server health: # Disable health checking. defaults to false, but can be set to true @@ -83,7 +83,7 @@ spec: # Players provides the configuration for player tracking features. # Commented out since Alpha, and disabled by default # players: - # # set this GameServer's initial player capacity + # # set this GameServer's initial player capacity # initialCapacity: 10 # # [Stage:Alpha] @@ -95,10 +95,10 @@ spec: # count: 1 # capacity: 100 # sessions: - # count: # Count and/or capacity must be listed (but may be nil) otherwise the counter will by dropped by the CRD schema. + # count: # Count and/or capacity must be listed (but may be nil) otherwise the counter will by dropped by the CRD schema. # lists: # players: - # capacity: # Capacity and/or values must be listed (but may be nil) otherwise the list will be dropped by the CRD schema. + # capacity: # Capacity and/or values must be listed (but may be nil) otherwise the list will be dropped by the CRD schema. # rooms: # capacity: 333 # values: @@ -115,12 +115,12 @@ spec: # Pod Specification spec: containers: - - name: simple-game-server - image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.17 - imagePullPolicy: Always - # nodeSelector is a label that can be used to tell Kubernetes which host - # OS to use. For Windows game servers uncomment the nodeSelector - # definition below. - # Details: https://kubernetes.io/docs/setup/production-environment/windows/user-guide-windows-containers/#ensuring-os-specific-workloads-land-on-the-appropriate-container-host - # nodeSelector: - # kubernetes.io/os: windows + - name: simple-game-server + image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.17 + imagePullPolicy: Always + # nodeSelector is a label that can be used to tell Kubernetes which host + # OS to use. For Windows game servers uncomment the nodeSelector + # definition below. + # Details: https://kubernetes.io/docs/setup/production-environment/windows/user-guide-windows-containers/#ensuring-os-specific-workloads-land-on-the-appropriate-container-host + # nodeSelector: + # kubernetes.io/os: windows diff --git a/examples/gameserverallocation-deprecated.yaml b/examples/gameserverallocation-deprecated.yaml index ee5b64ff56..5f818143ca 100644 --- a/examples/gameserverallocation-deprecated.yaml +++ b/examples/gameserverallocation-deprecated.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2018 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -21,8 +22,7 @@ # # For a full reference and details: https://agones.dev/site/docs/reference/gameserverallocation/ # - -apiVersion: "allocation.agones.dev/v1" +apiVersion: allocation.agones.dev/v1 kind: GameServerAllocation spec: # Deprecated, use selectors instead. @@ -39,7 +39,7 @@ spec: - {key: tier, operator: In, values: [cache]} # Specifies which State is the filter to be used when attempting to retrieve a GameServer # via Allocation. Defaults to "Ready". The only other option is "Allocated", which can be used in conjunction with - # label/annotation/player selectors to retrieve an already Allocated GameServer. + # label/annotation/player selectors to retrieve an already Allocated GameServer. gameServerState: Ready # [Stage:Alpha] # [FeatureFlag:PlayerAllocationFilter] @@ -71,4 +71,4 @@ spec: labels: mode: deathmatch annotations: - map: garden22 \ No newline at end of file + map: garden22 diff --git a/examples/gameserverallocation.yaml b/examples/gameserverallocation.yaml index 8e365aa3d2..ce30aefa98 100644 --- a/examples/gameserverallocation.yaml +++ b/examples/gameserverallocation.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2018 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -21,8 +22,7 @@ # # For a full reference and details: https://agones.dev/site/docs/reference/gameserverallocation/ # - -apiVersion: "allocation.agones.dev/v1" +apiVersion: allocation.agones.dev/v1 kind: GameServerAllocation metadata: name: allocation-example @@ -45,7 +45,7 @@ spec: - matchLabels: game: my-game matchExpressions: - - {key: tier, operator: In, values: [cache]} + - {key: tier, operator: In, values: [cache]} # Specifies which State is the filter to be used when attempting to retrieve a GameServer # via Allocation. Defaults to "Ready". The only other option is "Allocated", which can be used in conjunction with # label/annotation/player selectors to retrieve an already Allocated GameServer. @@ -70,4 +70,4 @@ spec: labels: mode: deathmatch annotations: - map: garden22 \ No newline at end of file + map: garden22 diff --git a/examples/listfleetautoscaler.yaml b/examples/listfleetautoscaler.yaml index 504bd99301..84d7a3e0c5 100644 --- a/examples/listfleetautoscaler.yaml +++ b/examples/listfleetautoscaler.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2023 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -22,15 +23,14 @@ # # For a full reference and details: https://agones.dev/site/docs/reference/fleetautoscaler/ # - -apiVersion: "autoscaling.agones.dev/v1" +apiVersion: autoscaling.agones.dev/v1 kind: FleetAutoscaler metadata: name: fleet-autoscaler-list spec: fleetName: fleet-example policy: - type: List # List based autoscaling. + type: List # List based autoscaling. list: # The name of the List. # Required. diff --git a/examples/nodejs-simple/cloudbuild.yaml b/examples/nodejs-simple/cloudbuild.yaml index 9f57d9382d..15aa2e434b 100644 --- a/examples/nodejs-simple/cloudbuild.yaml +++ b/examples/nodejs-simple/cloudbuild.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -11,30 +12,27 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - steps: # # Creates the initial make + docker build platform # - - name: "ubuntu" + - name: ubuntu script: | echo 'FROM gcr.io/cloud-builders/docker\nRUN apt-get install make\nENTRYPOINT [\"/usr/bin/make\"]' > Dockerfile.build - name: gcr.io/cloud-builders/docker id: build-make-docker - entrypoint: "docker" - args: ["build", "-f", "Dockerfile.build", "-t", "make-docker", "."] + entrypoint: docker + args: [build, -f, Dockerfile.build, -t, make-docker, .] # build and push nodejs-simple image to GCR - - name: "make-docker" + - name: make-docker id: push - dir: "/workspace/examples/nodejs-simple/" - env: - - REPOSITORY=${_REPOSITORY} + dir: /workspace/examples/nodejs-simple/ + env: ['REPOSITORY=${_REPOSITORY}'] script: | make push options: dynamic_substitutions: true - substitutions: _REPOSITORY: us-docker.pkg.dev/${PROJECT_ID}/examples -timeout: 1800s \ No newline at end of file +timeout: 1800s diff --git a/examples/nodejs-simple/gameserver.yaml b/examples/nodejs-simple/gameserver.yaml index 0ec00e32ec..fd6d915fda 100644 --- a/examples/nodejs-simple/gameserver.yaml +++ b/examples/nodejs-simple/gameserver.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2017 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -11,8 +12,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - -apiVersion: "agones.dev/v1" +apiVersion: agones.dev/v1 kind: GameServer metadata: # generate a unique name @@ -31,6 +31,6 @@ spec: template: spec: containers: - - name: nodejs-simple - image: us-docker.pkg.dev/agones-images/examples/nodejs-simple-server:0.8 - # args: ["--timeout=0"] # Change the timeout here, if you like the nodejs server to run longer. + - name: nodejs-simple + image: us-docker.pkg.dev/agones-images/examples/nodejs-simple-server:0.8 + # args: ["--timeout=0"] # Change the timeout here, if you like the nodejs server to run longer. diff --git a/examples/rust-simple/cloudbuild.yaml b/examples/rust-simple/cloudbuild.yaml index 18001c44ad..15577550dc 100644 --- a/examples/rust-simple/cloudbuild.yaml +++ b/examples/rust-simple/cloudbuild.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -11,30 +12,27 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - steps: # # Creates the initial make + docker build platform # - - name: "ubuntu" + - name: ubuntu script: | echo 'FROM gcr.io/cloud-builders/docker\nRUN apt-get install make\nENTRYPOINT [\"/usr/bin/make\"]' > Dockerfile.build - name: gcr.io/cloud-builders/docker id: build-make-docker - entrypoint: "docker" - args: ["build", "-f", "Dockerfile.build", "-t", "make-docker", "."] + entrypoint: docker + args: [build, -f, Dockerfile.build, -t, make-docker, .] # build and push rust-simple image to GCR - - name: "make-docker" + - name: make-docker id: push - dir: "/workspace/examples/rust-simple/" - env: - - REPOSITORY=${_REPOSITORY} + dir: /workspace/examples/rust-simple/ + env: ['REPOSITORY=${_REPOSITORY}'] script: | make push options: dynamic_substitutions: true - substitutions: _REPOSITORY: us-docker.pkg.dev/${PROJECT_ID}/examples -timeout: 1800s \ No newline at end of file +timeout: 1800s diff --git a/examples/rust-simple/gameserver.yaml b/examples/rust-simple/gameserver.yaml index 1ffc22b1ee..986d8c4414 100644 --- a/examples/rust-simple/gameserver.yaml +++ b/examples/rust-simple/gameserver.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2018 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -11,8 +12,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - -apiVersion: "agones.dev/v1" +apiVersion: agones.dev/v1 kind: GameServer metadata: # generate a unique name @@ -25,6 +25,6 @@ spec: template: spec: containers: - - name: rust-simple - image: us-docker.pkg.dev/agones-images/examples/rust-simple-server:0.11 - imagePullPolicy: Always + - name: rust-simple + image: us-docker.pkg.dev/agones-images/examples/rust-simple-server:0.11 + imagePullPolicy: Always diff --git a/examples/simple-game-server/cloudbuild.yaml b/examples/simple-game-server/cloudbuild.yaml index 593cb19406..208b6fe25f 100644 --- a/examples/simple-game-server/cloudbuild.yaml +++ b/examples/simple-game-server/cloudbuild.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -11,30 +12,27 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - steps: # # Creates the initial make + docker build platform # - - name: "ubuntu" + - name: ubuntu script: | echo 'FROM gcr.io/cloud-builders/docker\nRUN apt-get install make\nENTRYPOINT [\"/usr/bin/make\"]' > Dockerfile.build - name: gcr.io/cloud-builders/docker id: build-make-docker - entrypoint: "docker" - args: ["build", "-f", "Dockerfile.build", "-t", "make-docker", "."] + entrypoint: docker + args: [build, -f, Dockerfile.build, -t, make-docker, .] # build and push simple-game-server image to GCR - - name: "make-docker" + - name: make-docker id: push - dir: "/workspace/examples/simple-game-server" - env: - - REPOSITORY=${_REPOSITORY} + dir: /workspace/examples/simple-game-server + env: ['REPOSITORY=${_REPOSITORY}'] script: | make push options: dynamic_substitutions: true - substitutions: _REPOSITORY: us-docker.pkg.dev/${PROJECT_ID}/examples timeout: 1800s diff --git a/examples/simple-game-server/dev-gameserver.yaml b/examples/simple-game-server/dev-gameserver.yaml index 4752990d18..7cc5916664 100644 --- a/examples/simple-game-server/dev-gameserver.yaml +++ b/examples/simple-game-server/dev-gameserver.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2020 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -11,24 +12,23 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - -apiVersion: "agones.dev/v1" +apiVersion: agones.dev/v1 kind: GameServer metadata: name: local-simple-game-server - generateName: "simple-game-server-" + generateName: simple-game-server- annotations: # Causes Agones to register your local game server at 192.1.1.2, replace with your server's IP address. - agones.dev/dev-address: "192.1.1.2" + agones.dev/dev-address: 192.1.1.2 spec: ports: - - name: default - portPolicy: Static - hostPort: 17654 - containerPort: 17654 + - name: default + portPolicy: Static + hostPort: 17654 + containerPort: 17654 # The following is ignored but required due to validation. template: spec: containers: - - name: simple-game-server - image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.17 + - name: simple-game-server + image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.17 diff --git a/examples/simple-game-server/fleet-distributed.yaml b/examples/simple-game-server/fleet-distributed.yaml index 758cd036fe..8c3e72c96d 100644 --- a/examples/simple-game-server/fleet-distributed.yaml +++ b/examples/simple-game-server/fleet-distributed.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2020 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -15,8 +16,7 @@ # special fleet for load testing where we scale the fleet up/and down # it uses artificially low resource requests to be able to put as many # pods on a node as possible. - -apiVersion: "agones.dev/v1" +apiVersion: agones.dev/v1 kind: Fleet metadata: name: simple-game-server-distributed @@ -26,17 +26,17 @@ spec: template: spec: ports: - - name: default - containerPort: 7654 + - name: default + containerPort: 7654 template: spec: containers: - - name: simple-game-server - image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.17 - resources: - requests: - memory: "64Mi" - cpu: "20m" - limits: - memory: "64Mi" - cpu: "20m" + - name: simple-game-server + image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.17 + resources: + requests: + memory: 64Mi + cpu: 20m + limits: + memory: 64Mi + cpu: 20m diff --git a/examples/simple-game-server/fleet-tcp.yaml b/examples/simple-game-server/fleet-tcp.yaml index 0e6b94d0dd..1f7fbe65b6 100644 --- a/examples/simple-game-server/fleet-tcp.yaml +++ b/examples/simple-game-server/fleet-tcp.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2020 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -11,8 +12,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - -apiVersion: "agones.dev/v1" +apiVersion: agones.dev/v1 kind: Fleet metadata: name: simple-game-server @@ -21,25 +21,25 @@ spec: template: spec: ports: - - name: default - containerPort: 7654 - protocol: TCP + - name: default + containerPort: 7654 + protocol: TCP template: spec: containers: - - name: simple-game-server - image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.17 - env: - # Disables the UDP listener (Enabled by default) - - name: "UDP" - value: "FALSE" - # Enables the TCP listener (Disabled by default) - - name: "TCP" - value: "TRUE" - resources: - requests: - memory: "64Mi" - cpu: "20m" - limits: - memory: "64Mi" - cpu: "20m" + - name: simple-game-server + image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.17 + env: + # Disables the UDP listener (Enabled by default) + - name: UDP + value: 'FALSE' + # Enables the TCP listener (Disabled by default) + - name: TCP + value: 'TRUE' + resources: + requests: + memory: 64Mi + cpu: 20m + limits: + memory: 64Mi + cpu: 20m diff --git a/examples/simple-game-server/fleet.yaml b/examples/simple-game-server/fleet.yaml index 549f71e8c7..808a057f11 100644 --- a/examples/simple-game-server/fleet.yaml +++ b/examples/simple-game-server/fleet.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2020 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -11,8 +12,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - -apiVersion: "agones.dev/v1" +apiVersion: agones.dev/v1 kind: Fleet metadata: name: simple-game-server @@ -21,17 +21,17 @@ spec: template: spec: ports: - - name: default - containerPort: 7654 + - name: default + containerPort: 7654 template: spec: containers: - - name: simple-game-server - image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.17 - resources: - requests: - memory: "64Mi" - cpu: "20m" - limits: - memory: "64Mi" - cpu: "20m" + - name: simple-game-server + image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.17 + resources: + requests: + memory: 64Mi + cpu: 20m + limits: + memory: 64Mi + cpu: 20m diff --git a/examples/simple-game-server/fleetautoscaler.yaml b/examples/simple-game-server/fleetautoscaler.yaml index f6e5169851..a7a6e90a36 100644 --- a/examples/simple-game-server/fleetautoscaler.yaml +++ b/examples/simple-game-server/fleetautoscaler.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2020 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -16,8 +17,7 @@ # A FleetAutoscaler is used to scale the fleet automatically # up and down depending on usage # - -apiVersion: "autoscaling.agones.dev/v1" +apiVersion: autoscaling.agones.dev/v1 kind: FleetAutoscaler metadata: name: simple-game-server-autoscaler diff --git a/examples/simple-game-server/gameserver-passthrough.yaml b/examples/simple-game-server/gameserver-passthrough.yaml index 6557282c0c..c96266a459 100644 --- a/examples/simple-game-server/gameserver-passthrough.yaml +++ b/examples/simple-game-server/gameserver-passthrough.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2020 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -11,27 +12,26 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - -apiVersion: "agones.dev/v1" +apiVersion: agones.dev/v1 kind: GameServer metadata: - generateName: "simple-game-server-" + generateName: simple-game-server- spec: ports: - - name: default - portPolicy: Passthrough + - name: default + portPolicy: Passthrough template: spec: containers: - - name: simple-game-server - image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.17 - env: - - name: "PASSTHROUGH" - value: "TRUE" - resources: - requests: - memory: "64Mi" - cpu: "20m" - limits: - memory: "64Mi" - cpu: "20m" + - name: simple-game-server + image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.17 + env: + - name: PASSTHROUGH + value: 'TRUE' + resources: + requests: + memory: 64Mi + cpu: 20m + limits: + memory: 64Mi + cpu: 20m diff --git a/examples/simple-game-server/gameserver-windows.yaml b/examples/simple-game-server/gameserver-windows.yaml index 65592940cf..ad811f7bf8 100644 --- a/examples/simple-game-server/gameserver-windows.yaml +++ b/examples/simple-game-server/gameserver-windows.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2020 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -11,28 +12,27 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - -apiVersion: "agones.dev/v1" +apiVersion: agones.dev/v1 kind: GameServer metadata: - generateName: "simple-game-server-windows-" + generateName: simple-game-server-windows- spec: ports: - - name: default - portPolicy: Dynamic - containerPort: 7654 + - name: default + portPolicy: Dynamic + containerPort: 7654 template: spec: containers: - - name: simple-game-server - image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.17 - resources: - requests: - memory: "64Mi" - cpu: "20m" - limits: - memory: "64Mi" - cpu: "20m" + - name: simple-game-server + image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.17 + resources: + requests: + memory: 64Mi + cpu: 20m + limits: + memory: 64Mi + cpu: 20m # Limit this pod to Windows nodes. nodeSelector: kubernetes.io/os: windows diff --git a/examples/simple-game-server/gameserver.yaml b/examples/simple-game-server/gameserver.yaml index 0ab089d11d..cefb18b680 100644 --- a/examples/simple-game-server/gameserver.yaml +++ b/examples/simple-game-server/gameserver.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2020 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -11,25 +12,24 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - -apiVersion: "agones.dev/v1" +apiVersion: agones.dev/v1 kind: GameServer metadata: - generateName: "simple-game-server-" + generateName: simple-game-server- spec: ports: - - name: default - portPolicy: Dynamic - containerPort: 7654 + - name: default + portPolicy: Dynamic + containerPort: 7654 template: spec: containers: - - name: simple-game-server - image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.17 - resources: - requests: - memory: "64Mi" - cpu: "20m" - limits: - memory: "64Mi" - cpu: "20m" + - name: simple-game-server + image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.17 + resources: + requests: + memory: 64Mi + cpu: 20m + limits: + memory: 64Mi + cpu: 20m diff --git a/examples/simple-game-server/gameserverallocation.yaml b/examples/simple-game-server/gameserverallocation.yaml index 676346f803..292b52092d 100644 --- a/examples/simple-game-server/gameserverallocation.yaml +++ b/examples/simple-game-server/gameserverallocation.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2020 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -15,8 +16,7 @@ # # A GameServerAllocation against a Fleet named 'simple-game-server' # - -apiVersion: "allocation.agones.dev/v1" +apiVersion: allocation.agones.dev/v1 kind: GameServerAllocation spec: # GameServer selector from which to choose GameServers from. diff --git a/examples/supertuxkart/cloudbuild.yaml b/examples/supertuxkart/cloudbuild.yaml index a0119b1495..581f6f7674 100644 --- a/examples/supertuxkart/cloudbuild.yaml +++ b/examples/supertuxkart/cloudbuild.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -11,30 +12,27 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - steps: # # Creates the initial make + docker build platform # - - name: "ubuntu" + - name: ubuntu script: | echo 'FROM gcr.io/cloud-builders/docker\nRUN apt-get install make\nENTRYPOINT [\"/usr/bin/make\"]' > Dockerfile.build - name: gcr.io/cloud-builders/docker id: build-make-docker - entrypoint: "docker" - args: ["build", "-f", "Dockerfile.build", "-t", "make-docker", "."] + entrypoint: docker + args: [build, -f, Dockerfile.build, -t, make-docker, .] # build and push supertuxkart image to GCR - - name: "make-docker" + - name: make-docker id: push - dir: "." - env: - - REPOSITORY=${_REPOSITORY} + dir: . + env: ['REPOSITORY=${_REPOSITORY}'] script: | make push options: dynamic_substitutions: true - substitutions: _REPOSITORY: us-docker.pkg.dev/${PROJECT_ID}/examples -timeout: 1800s \ No newline at end of file +timeout: 1800s diff --git a/examples/supertuxkart/fleet.yaml b/examples/supertuxkart/fleet.yaml index 2eec2c7eca..5d6e204c04 100644 --- a/examples/supertuxkart/fleet.yaml +++ b/examples/supertuxkart/fleet.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2020 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -11,8 +12,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - -apiVersion: "agones.dev/v1" +apiVersion: agones.dev/v1 kind: Fleet metadata: name: supertuxkart @@ -23,13 +23,13 @@ spec: template: spec: ports: - - name: default - containerPort: 8080 + - name: default + containerPort: 8080 health: initialDelaySeconds: 30 periodSeconds: 60 template: spec: containers: - - name: supertuxkart - image: us-docker.pkg.dev/agones-images/examples/supertuxkart-example:0.8 + - name: supertuxkart + image: us-docker.pkg.dev/agones-images/examples/supertuxkart-example:0.8 diff --git a/examples/supertuxkart/gameserver.yaml b/examples/supertuxkart/gameserver.yaml index d20d1888ab..13a5deb875 100644 --- a/examples/supertuxkart/gameserver.yaml +++ b/examples/supertuxkart/gameserver.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2020 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -11,8 +12,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - -apiVersion: "agones.dev/v1" +apiVersion: agones.dev/v1 kind: GameServer metadata: name: supertuxkart @@ -23,9 +23,9 @@ spec: template: spec: containers: - - name: supertuxkart - image: us-docker.pkg.dev/agones-images/examples/supertuxkart-example:0.8 - # imagePullPolicy: Always # add for development - env: - - name: ENABLE_PLAYER_TRACKING - value: 'false' + - name: supertuxkart + image: us-docker.pkg.dev/agones-images/examples/supertuxkart-example:0.8 + # imagePullPolicy: Always # add for development + env: + - name: ENABLE_PLAYER_TRACKING + value: 'false' diff --git a/examples/supertuxkart/gameserverallocation.yaml b/examples/supertuxkart/gameserverallocation.yaml index 53894bca39..f769a092c7 100644 --- a/examples/supertuxkart/gameserverallocation.yaml +++ b/examples/supertuxkart/gameserverallocation.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2020 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -11,8 +12,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - -apiVersion: "allocation.agones.dev/v1" +apiVersion: allocation.agones.dev/v1 kind: GameServerAllocation spec: selectors: diff --git a/examples/unity-simple/gameserver.yaml b/examples/unity-simple/gameserver.yaml index 5cddc40067..976db4609f 100644 --- a/examples/unity-simple/gameserver.yaml +++ b/examples/unity-simple/gameserver.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2019 Google LLC # All Rights Reserved. # @@ -12,25 +13,24 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - -apiVersion: "agones.dev/v1" +apiVersion: agones.dev/v1 kind: GameServer metadata: - generateName: "unity-simple-server-" + generateName: unity-simple-server- spec: ports: - - name: default - portPolicy: Dynamic - containerPort: 7777 + - name: default + portPolicy: Dynamic + containerPort: 7777 template: spec: containers: - - name: unity-simple-server - image: us-docker.pkg.dev/agones-images/examples/unity-simple-server:0.3 + - name: unity-simple-server + image: us-docker.pkg.dev/agones-images/examples/unity-simple-server:0.3 resources: requests: - memory: "128Mi" - cpu: "128m" + memory: 128Mi + cpu: 128m limits: - memory: "128Mi" - cpu: "128m" \ No newline at end of file + memory: 128Mi + cpu: 128m diff --git a/examples/webhookfleetautoscaler.yaml b/examples/webhookfleetautoscaler.yaml index 9a086f3131..42b71e14cc 100644 --- a/examples/webhookfleetautoscaler.yaml +++ b/examples/webhookfleetautoscaler.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2018 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -20,8 +21,7 @@ # # For a full reference and details: https://agones.dev/site/docs/reference/fleetautoscaler/ # - -apiVersion: "autoscaling.agones.dev/v1" +apiVersion: autoscaling.agones.dev/v1 kind: FleetAutoscaler metadata: name: webhook-fleet-autoscaler @@ -37,6 +37,6 @@ spec: name: autoscaler-webhook-service namespace: default path: scale - # optional for URL defined webhooks - # url: "" - # caBundle: optional, used for HTTPS webhook type + # optional for URL defined webhooks + # url: "" + # caBundle: optional, used for HTTPS webhook type diff --git a/examples/webhookfleetautoscalertls.yaml b/examples/webhookfleetautoscalertls.yaml index b0fcac6ff7..059ad3d2b3 100644 --- a/examples/webhookfleetautoscalertls.yaml +++ b/examples/webhookfleetautoscalertls.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2018 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -20,8 +21,7 @@ # # For a full reference and details: https://agones.dev/site/docs/reference/fleetautoscaler/ # - -apiVersion: "autoscaling.agones.dev/v1" +apiVersion: autoscaling.agones.dev/v1 kind: FleetAutoscaler metadata: name: webhook-fleetautoscaler-tls @@ -34,6 +34,6 @@ spec: webhook: # use a service, or URL # optional for URL defined webhooks - url: "https://autoscaler-tls-service.default.svc:8000/scale" + url: https://autoscaler-tls-service.default.svc:8000/scale # optional, if you want to provide your own ca cert to test against - caBundle: "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUN1RENDQWFBQ0NRQ29kcEFNbTlTd0pqQU5CZ2txaGtpRzl3MEJBUXNGQURBZU1Rc3dDUVlEVlFRR0V3SlYKVXpFUE1BMEdBMVVFQ3d3R1FXZHZibVZ6TUI0WERURTVNREV3TkRFeE5URTBORm9YRFRJeE1UQXlOREV4TlRFMApORm93SGpFTE1Ba0dBMVVFQmhNQ1ZWTXhEekFOQmdOVkJBc01Ca0ZuYjI1bGN6Q0NBU0l3RFFZSktvWklodmNOCkFRRUJCUUFEZ2dFUEFEQ0NBUW9DZ2dFQkFOQ0h5dndDOTZwZDlTdkFhMUIvRWg2ekcxeDBLS1dPaVhtNzhJcngKKzZ5WHd5YVpsMVo1cVExbUZoOThMSGVZUmQwWVgzRTJnelZ5bFpvUlUra1ZESzRUc0VzV0tNUFVpdVo0MUVrdApwbythbEN6alAyaXZzRGZaOGEvdnByL3dZZ2FrWGtWalBUaGpKUk9xTnFIdWROMjZVcUFJYnNOTVpoUkxkOVFFCnFLSjRPNmFHNVMxTVNqZFRGVHFlbHJiZitDcXNKaHltZEIzZmxGRUVvdXExSmoxS0RoQjRXWlNTbS9VSnpCNkcKNHUzY3BlQm1jTFVRR202ZlFHb2JFQSt5SlpMaEVXcXBrd3ZVZ2dCNmRzWE8xZFNIZXhhZmlDOUVUWGxVdFRhZwo1U2JOeTVoYWRWUVV3Z253U0J2djR2R0t1UUxXcWdXc0JyazB5Wll4Sk5Bb0V5RUNBd0VBQVRBTkJna3Foa2lHCjl3MEJBUXNGQUFPQ0FRRUFRMkgzaWJRcWYzQTNES2l1eGJISURkbll6TlZ2Z0dhRFpwaVZyM25ocm55dmxlNVgKR09hRm0rMjdRRjRWV29FMzZDTGhYZHpEWlM4bEpIY09YUW5KOU83Y2pPYzkxVmh1S2NmSHgwS09hU1oweVNrVAp2bEtXazlBNFdoNGE0QXFZSlc3Z3BUVHR1UFpydnc4VGsvbjFaWEZOYVdBeDd5RU5OdVdiODhoNGRBRDVaTzRzCkc5SHJIdlpuTTNXQzFBUXA0Q3laRjVyQ1I2dkVFOWRkUmlKb3IzM3pLZTRoRkJvN0JFTklZZXNzZVlxRStkcDMKK0g4TW5LODRXeDFUZ1N5Vkp5OHlMbXFpdTJ1aThjaDFIZnh0OFpjcHg3dXA2SEZLRlRsTjlBeXZUaXYxYTBYLwpEVTk1eTEwdi9oTlc0WHpuMDJHNGhrcjhzaUduSEcrUEprT3hBdz09Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K" + caBundle: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUN1RENDQWFBQ0NRQ29kcEFNbTlTd0pqQU5CZ2txaGtpRzl3MEJBUXNGQURBZU1Rc3dDUVlEVlFRR0V3SlYKVXpFUE1BMEdBMVVFQ3d3R1FXZHZibVZ6TUI0WERURTVNREV3TkRFeE5URTBORm9YRFRJeE1UQXlOREV4TlRFMApORm93SGpFTE1Ba0dBMVVFQmhNQ1ZWTXhEekFOQmdOVkJBc01Ca0ZuYjI1bGN6Q0NBU0l3RFFZSktvWklodmNOCkFRRUJCUUFEZ2dFUEFEQ0NBUW9DZ2dFQkFOQ0h5dndDOTZwZDlTdkFhMUIvRWg2ekcxeDBLS1dPaVhtNzhJcngKKzZ5WHd5YVpsMVo1cVExbUZoOThMSGVZUmQwWVgzRTJnelZ5bFpvUlUra1ZESzRUc0VzV0tNUFVpdVo0MUVrdApwbythbEN6alAyaXZzRGZaOGEvdnByL3dZZ2FrWGtWalBUaGpKUk9xTnFIdWROMjZVcUFJYnNOTVpoUkxkOVFFCnFLSjRPNmFHNVMxTVNqZFRGVHFlbHJiZitDcXNKaHltZEIzZmxGRUVvdXExSmoxS0RoQjRXWlNTbS9VSnpCNkcKNHUzY3BlQm1jTFVRR202ZlFHb2JFQSt5SlpMaEVXcXBrd3ZVZ2dCNmRzWE8xZFNIZXhhZmlDOUVUWGxVdFRhZwo1U2JOeTVoYWRWUVV3Z253U0J2djR2R0t1UUxXcWdXc0JyazB5Wll4Sk5Bb0V5RUNBd0VBQVRBTkJna3Foa2lHCjl3MEJBUXNGQUFPQ0FRRUFRMkgzaWJRcWYzQTNES2l1eGJISURkbll6TlZ2Z0dhRFpwaVZyM25ocm55dmxlNVgKR09hRm0rMjdRRjRWV29FMzZDTGhYZHpEWlM4bEpIY09YUW5KOU83Y2pPYzkxVmh1S2NmSHgwS09hU1oweVNrVAp2bEtXazlBNFdoNGE0QXFZSlc3Z3BUVHR1UFpydnc4VGsvbjFaWEZOYVdBeDd5RU5OdVdiODhoNGRBRDVaTzRzCkc5SHJIdlpuTTNXQzFBUXA0Q3laRjVyQ1I2dkVFOWRkUmlKb3IzM3pLZTRoRkJvN0JFTklZZXNzZVlxRStkcDMKK0g4TW5LODRXeDFUZ1N5Vkp5OHlMbXFpdTJ1aThjaDFIZnh0OFpjcHg3dXA2SEZLRlRsTjlBeXZUaXYxYTBYLwpEVTk1eTEwdi9oTlc0WHpuMDJHNGhrcjhzaUduSEcrUEprT3hBdz09Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K diff --git a/examples/xonotic/cloudbuild.yaml b/examples/xonotic/cloudbuild.yaml index 00c123ce80..3d70a3a0f5 100644 --- a/examples/xonotic/cloudbuild.yaml +++ b/examples/xonotic/cloudbuild.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -11,30 +12,27 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - steps: # # Creates the initial make + docker build platform # - - name: "ubuntu" + - name: ubuntu script: | echo 'FROM gcr.io/cloud-builders/docker\nRUN apt-get install make\nENTRYPOINT [\"/usr/bin/make\"]' > Dockerfile.build - name: gcr.io/cloud-builders/docker id: build-make-docker - entrypoint: "docker" - args: ["build", "-f", "Dockerfile.build", "-t", "make-docker", "."] + entrypoint: docker + args: [build, -f, Dockerfile.build, -t, make-docker, .] # build and push xonotic image to GCR - - name: "make-docker" + - name: make-docker id: push - dir: "." - env: - - REPOSITORY=${_REPOSITORY} + dir: . + env: ['REPOSITORY=${_REPOSITORY}'] script: | make push options: dynamic_substitutions: true - substitutions: _REPOSITORY: us-docker.pkg.dev/${PROJECT_ID}/examples -timeout: 1800s \ No newline at end of file +timeout: 1800s diff --git a/examples/xonotic/fleet.yaml b/examples/xonotic/fleet.yaml index bfd9de06d0..3fa0380eb5 100644 --- a/examples/xonotic/fleet.yaml +++ b/examples/xonotic/fleet.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2018 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -14,8 +15,7 @@ # Usually you would define a Fleet rather than a GameServerSet # directly. This is here mostly for testing purposes - -apiVersion: "agones.dev/v1" +apiVersion: agones.dev/v1 kind: Fleet metadata: name: xonotic @@ -26,13 +26,13 @@ spec: template: spec: ports: - - name: default - containerPort: 26000 + - name: default + containerPort: 26000 health: initialDelaySeconds: 30 periodSeconds: 60 template: spec: containers: - - name: xonotic - image: us-docker.pkg.dev/agones-images/examples/xonotic-example:1.2 + - name: xonotic + image: us-docker.pkg.dev/agones-images/examples/xonotic-example:1.2 diff --git a/examples/xonotic/fleetautoscaler.yaml b/examples/xonotic/fleetautoscaler.yaml index 1f4462d68e..ac121d8ad0 100644 --- a/examples/xonotic/fleetautoscaler.yaml +++ b/examples/xonotic/fleetautoscaler.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2018 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -16,8 +17,7 @@ # A FleetAutoscaler is used to scale the fleet automatically # up and down depending on usage # - -apiVersion: "autoscaling.agones.dev/v1" +apiVersion: autoscaling.agones.dev/v1 kind: FleetAutoscaler metadata: name: xonotic-autoscaler diff --git a/examples/xonotic/gameserver.yaml b/examples/xonotic/gameserver.yaml index 0101931473..ebf06b506a 100644 --- a/examples/xonotic/gameserver.yaml +++ b/examples/xonotic/gameserver.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2017 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -11,11 +12,10 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - -apiVersion: "agones.dev/v1" +apiVersion: agones.dev/v1 kind: GameServer metadata: - name: "xonotic" + name: xonotic spec: ports: - name: default @@ -23,6 +23,6 @@ spec: template: spec: containers: - - name: xonotic - image: us-docker.pkg.dev/agones-images/examples/xonotic-example:1.2 - # imagePullPolicy: Always # add for development + - name: xonotic + image: us-docker.pkg.dev/agones-images/examples/xonotic-example:1.2 + # imagePullPolicy: Always # add for development diff --git a/examples/xonotic/gameserverallocation.yaml b/examples/xonotic/gameserverallocation.yaml index dc78b46284..74bbc70df1 100644 --- a/examples/xonotic/gameserverallocation.yaml +++ b/examples/xonotic/gameserverallocation.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2018 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -11,8 +12,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - -apiVersion: "allocation.agones.dev/v1" +apiVersion: allocation.agones.dev/v1 kind: GameServerAllocation spec: # GameServer selector from which to choose GameServers from. diff --git a/site/app.yaml b/site/app.yaml index 21114ac893..975278c50f 100644 --- a/site/app.yaml +++ b/site/app.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2018 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -11,10 +12,8 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - runtime: go116 service: ${SERVICE} - handlers: - url: /site/$ static_files: public/index.html diff --git a/site/cloudbuild.yaml b/site/cloudbuild.yaml index b375a180ae..ecb0084bf7 100644 --- a/site/cloudbuild.yaml +++ b/site/cloudbuild.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2019 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -11,57 +12,50 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - # # Google Cloud Builder -- Push site to production # on merge with main # - steps: - -# -# Creates the initial make + docker build platform -# - -- name: "ubuntu" - args: ["bash", "-c", "echo 'FROM gcr.io/cloud-builders/docker\nRUN apt-get install make\nENTRYPOINT [\"/usr/bin/make\"]' > Dockerfile.build"] -- name: "gcr.io/cloud-builders/docker" - args: ['build', '-f', 'Dockerfile.build', '-t', 'make-docker', '.'] # we need docker and make to run everything. -- name: "make-docker" - dir: "build" - env: - - "REGISTRY=${_REGISTRY}" - args: ["pull-build-image"] # since we are past CI build, we can assume that the build image exists. - -# -# Build production site and deploy -# - -- name: "make-docker" # build production version of the site - dir: "build" - args: ["site-static", "site-gen-app-yaml", "ENV=HUGO_ENV=production"] -- name: "gcr.io/cloud-builders/gcloud" # deploy the website - dir: "site" - args: ["app", "deploy", ".app.yaml", "--promote", "--version=$SHORT_SHA"] - env: - - GOPATH=/workspace/go - - GO111MODULE=on - -# -# Build development site and deploy -# - - -- name: "make-docker" # build a preview of the website - dir: "build" - args: ["site-static-preview", "site-gen-app-yaml", "SERVICE=development"] -- name: "gcr.io/cloud-builders/gcloud" # deploy the preview of the website - dir: "site" - args: ["app", "deploy", ".app.yaml", "--promote", "--version=$SHORT_SHA"] - env: - - GOPATH=/workspace/go - - GO111MODULE=on - + # + # Creates the initial make + docker build platform + # + - name: ubuntu + args: + - bash + - -c + - "echo 'FROM gcr.io/cloud-builders/docker\nRUN apt-get install make\nENTRYPOINT\ + \ [\"/usr/bin/make\"]' > Dockerfile.build" + - name: gcr.io/cloud-builders/docker + args: [build, -f, Dockerfile.build, -t, make-docker, .] # we need docker and make to run everything. + - name: make-docker + dir: build + env: ['REGISTRY=${_REGISTRY}'] + args: [pull-build-image] # since we are past CI build, we can assume that the build image exists. + + # + # Build production site and deploy + # + - name: make-docker # build production version of the site + dir: build + args: [site-static, site-gen-app-yaml, ENV=HUGO_ENV=production] + - name: gcr.io/cloud-builders/gcloud # deploy the website + dir: site + args: [app, deploy, .app.yaml, --promote, --version=$SHORT_SHA] + env: + - GOPATH=/workspace/go + - GO111MODULE=on + + # + # Build development site and deploy + # + - name: make-docker # build a preview of the website + dir: build + args: [site-static-preview, site-gen-app-yaml, SERVICE=development] + - name: gcr.io/cloud-builders/gcloud # deploy the preview of the website + dir: site + args: [app, deploy, .app.yaml, --promote, --version=$SHORT_SHA] + env: [GOPATH=/workspace/go, GO111MODULE=on] substitutions: _REGISTRY: us-docker.pkg.dev/${PROJECT_ID}/ci -tags: ["site"] \ No newline at end of file +tags: [site] diff --git a/site/htmltest.yaml b/site/htmltest.yaml index ab917cd769..1e033cec23 100644 --- a/site/htmltest.yaml +++ b/site/htmltest.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2019 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -11,7 +12,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - TestFilesConcurrently: false IgnoreInternalEmptyHash: true OutputDir: /go/src/agones.dev/agones/site/tmp @@ -22,4 +22,5 @@ IgnoreURLs: - http://localhost - https://twitter.com/agonesdev HTTPHeaders: - User-Agent: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" + User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) + Chrome/100.0.4896.127 Safari/537.36 diff --git a/site/vanity.yaml b/site/vanity.yaml index 335f80d5e1..db4d9afda5 100644 --- a/site/vanity.yaml +++ b/site/vanity.yaml @@ -1,5 +1,5 @@ +--- host: agones.dev - paths: /agones: - repo: https://github.com/googleforgames/agones \ No newline at end of file + repo: https://github.com/googleforgames/agones diff --git a/test/load/allocation/autoscaler.yaml b/test/load/allocation/autoscaler.yaml index e76fdbb58f..66f5731542 100644 --- a/test/load/allocation/autoscaler.yaml +++ b/test/load/allocation/autoscaler.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2023 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -11,8 +12,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - -apiVersion: "autoscaling.agones.dev/v1" +apiVersion: autoscaling.agones.dev/v1 kind: FleetAutoscaler metadata: name: fleet-autoscaler-scenario-test diff --git a/test/load/allocation/fleet.yaml b/test/load/allocation/fleet.yaml index 185b3f1632..519cc667e7 100644 --- a/test/load/allocation/fleet.yaml +++ b/test/load/allocation/fleet.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2020 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -11,8 +12,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - -apiVersion: "agones.dev/v1" +apiVersion: agones.dev/v1 kind: Fleet metadata: name: load-test-fleet @@ -25,23 +25,20 @@ spec: foo: bar # GameServer specification spec: - ports: + ports: - containerPort: 7654 name: default - # The GameServer's Pod template - template: - spec: - containers: - - args: - # We setup the simple-game-server server to shutdown 10 mins after allocation - - -automaticShutdownDelaySec=600 - image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.17 - name: simple-game-server - resources: - limits: - cpu: 20m - memory: 32Mi - requests: - cpu: 20m - memory: 32Mi - + # The GameServer's Pod template + template: + spec: + containers: + - args: [-automaticShutdownDelaySec=600] + image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.17 + name: simple-game-server + resources: + limits: + cpu: 20m + memory: 32Mi + requests: + cpu: 20m + memory: 32Mi diff --git a/test/load/allocation/scenario-fleet.yaml b/test/load/allocation/scenario-fleet.yaml index 1f99d2ea76..0907678720 100644 --- a/test/load/allocation/scenario-fleet.yaml +++ b/test/load/allocation/scenario-fleet.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2023 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -11,8 +12,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - -apiVersion: "agones.dev/v1" +apiVersion: agones.dev/v1 kind: Fleet metadata: name: scenario-test @@ -24,28 +24,26 @@ spec: gameName: simple-game-server spec: ports: - - containerPort: 7654 - name: default + - containerPort: 7654 + name: default health: initialDelaySeconds: 30 periodSeconds: 60 template: spec: tolerations: - - effect: NoExecute - key: scenario-test.io/game-servers - operator: Equal - value: 'true' + - effect: NoExecute + key: scenario-test.io/game-servers + operator: Equal + value: 'true' containers: - - name: simple-game-server - image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.17 - args: - - -automaticShutdownDelaySec=60 - - -readyIterations=10 - resources: - limits: - cpu: 20m - memory: 24Mi - requests: - cpu: 20m - memory: 24Mi + - name: simple-game-server + image: us-docker.pkg.dev/agones-images/examples/simple-game-server:0.17 + args: [-automaticShutdownDelaySec=60, -readyIterations=10] + resources: + limits: + cpu: 20m + memory: 24Mi + requests: + cpu: 20m + memory: 24Mi diff --git a/test/load/allocation/scenario-values.yaml b/test/load/allocation/scenario-values.yaml index f5babf10c2..30976aae6f 100644 --- a/test/load/allocation/scenario-values.yaml +++ b/test/load/allocation/scenario-values.yaml @@ -1,3 +1,4 @@ +--- # Copyright 2022 Google LLC All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -11,7 +12,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - agones: controller: resources: @@ -23,18 +23,18 @@ agones: preferredDuringSchedulingIgnoredDuringExecution: null requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - - matchExpressions: - - key: agones.dev/agones-system - operator: Exists + - matchExpressions: + - key: agones.dev/agones-system + operator: Exists ping: affinity: nodeAffinity: preferredDuringSchedulingIgnoredDuringExecution: null requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - - matchExpressions: - - key: agones.dev/agones-system - operator: Exists + - matchExpressions: + - key: agones.dev/agones-system + operator: Exists allocator: resources: requests: @@ -45,6 +45,6 @@ agones: preferredDuringSchedulingIgnoredDuringExecution: null requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - - matchExpressions: - - key: agones.dev/agones-system - operator: Exists + - matchExpressions: + - key: agones.dev/agones-system + operator: Exists