Skip to content

Commit

Permalink
Website for Agones
Browse files Browse the repository at this point in the history
This is a new static site for Agones, as well as the tools to enable people to
write documentation for new features, without it displaying until the feature
is released.

Integration with cloudbuild for previews is also build in (preview is the
current documentation + all the documentation for the new features), as well
as a link checker that runs as part of the test suite.

This also brings into the codebase all the redirect code for go-get as
well as the chart redirects as well.

Closes googleforgames#410
  • Loading branch information
markmandel authored and pm7h committed Feb 9, 2019
1 parent 160131a commit 6ef9882
Show file tree
Hide file tree
Showing 8,214 changed files with 333,145 additions and 1,043 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
!.gitattributes
!.dockerignore
!.golangci.yml
!.gcloudignore
*.iml
bin
*.o
Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ Participation in this project comes under the [Contributor Covenant Code of Cond
"[kind/design](https://github.com/googleprivate/agones/issues?q=is%3Aissue+is%3Aopen+label%3Akind%2Fdesign)"
outlining the feature that you wish to build, and describing how it will be implemented. This gives a chance
for review to happen early, and ensures no wasted effort occurs.
- For new features, documentation *must* be included. Review the [Documentation Editing and Contribution](https://agones.dev/site/docs/contribute/)
guide for details.
- All submissions, including submissions by project members, will require review before being merged.
- Once review has occurred, please rebase your PR down to a single commit. This will ensure a nice clean Git history.
- Finally - *Thanks* for considering submitting code to Agones!
Expand Down
73 changes: 12 additions & 61 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,73 +12,24 @@ _Agones, is derived from the Greek word agōn which roughly translates to “con
## Disclaimer
This software is currently alpha, and subject to change. Not to be used in production systems.

## Major Features
- Be able to define a `GameServer` within Kubernetes - either through yaml or via the API
- Manage GameServer lifecycles - including health checking and connection information.
- Client SDKs for integration with dedicated game servers to work with Agones.

## Why does this project exist?
For more details on why this project was written, read the
[announcement blog post](https://cloudplatform.googleblog.com/2018/03/introducing-Agones-open-source-multiplayer-dedicated-game-server-hosting-built-on-Kubernetes.html).
Agones replaces usual bespoke or proprietary cluster management and game server scaling solutions with a [Kubernetes](https://kubernetes.io/) cluster
that includes the Agones custom _[Kubernetes Controller](https://kubernetes.io/docs/concepts/api-extension/custom-resources/#custom-controllers)_ and matching [Custom Resource Definitions](https://kubernetes.io/docs/concepts/api-extension/custom-resources/#customresourcedefinitions) for _GameServers_, _Fleets_ and more.

## Requirements
- Kubernetes cluster version 1.11+
- [Minikube](https://github.com/kubernetes/minikube), [Google Kubernetes Engine](https://cloud.google.com/kubernetes-engine/) and [Azure Kubernetes Service](https://azure.microsoft.com/en-us/services/kubernetes-service/) have been tested
- If you are creating and managing your own Kubernetes cluster, the
[MutatingAdmissionWebhook](https://kubernetes.io/docs/admin/admission-controllers/#mutatingadmissionwebhook-beta-in-19), and
[ValidatingAdmissionWebhook](https://kubernetes.io/docs/admin/admission-controllers/#validatingadmissionwebhook-alpha-in-18-beta-in-19)
admission controllers are required.
We also recommend following the
[recommended set of admission controllers](https://kubernetes.io/docs/admin/admission-controllers/#is-there-a-recommended-set-of-admission-controllers-to-use).
- Firewall access for the range of ports that Game Servers can be connected to in the cluster.
- Game Servers must have the [project SDK](sdks) integrated, to manage Game Server state, health checking, etc.
With Agones, Kubernetes gets native abilities to create, run, manage and scale dedicated game server processes within Kubernetes clusters using standard Kubernetes tooling and APIs. This model also allows any matchmaker to interact directly with Agones via the Kubernetes API to provision a dedicated a game server.

## Installation
For more details on why this project was written, read the
[announcement blog post](https://cloudplatform.googleblog.com/2018/03/introducing-Agones-open-source-multiplayer-dedicated-game-server-hosting-built-on-Kubernetes.html).

Follow [these instructions](install/README.md) to create a cluster on Google Kubernetes Engine (GKE), Minikube or Azure Kubernetes Service (AKS), and install Agones.
## Major Features
- Define a single `GameServer`, and/or large game server `Fleets` within Kubernetes - either through yaml or via the API
- Manage GameServer lifecycles - including health checking and connection information.
- `Fleet` Autoscaling capabilities that integrate with Kubernetes' native cluster autoscaling
- Gameserver specific metric exports and dashboards for ops teams

## Usage

Documentation and usage guides on how to develop and host dedicated game servers on top of Agones.

### Quickstarts:
- [Create a Game Server](./docs/create_gameserver.md)
- [Create a Game Server Fleet](./docs/create_fleet.md)
- [Create a Fleet Autoscaler](./docs/create_fleetautoscaler.md)
- [Create a Webhook for FleetAutoscaler](./docs/create_webhook_fleetautoscaler.md)
- [Edit Your First Game Server (Go)](./docs/edit_first_game_server.md)

### Guides
- [Integrating the Game Server SDK](sdks)
- [GameServer Health Checking](./docs/health_checking.md)
- [Latency Testing with Multiple Clusters](./docs/ping_service.md)
- [Accessing Agones via the Kubernetes API](./docs/access_api.md)
- [Troubleshooting](./docs/troubleshooting.md)

### Tutorials
- [Create an Allocator Service (Go)](./docs/create_allocator_service.md) - Learn to programmatically access Agones via the API

### Reference
- [Game Server Specification](./docs/gameserver_spec.md)
- [Fleet Specification](./docs/fleet_spec.md)
- [Fleet Autoscaler Specification](./docs/fleetautoscaler_spec.md)
- [Metrics](./docs/metrics.md)

### Examples
- [Full GameServer Configuration](./examples/gameserver.yaml)
- [Full Fleet Configuration](./examples/fleet.yaml)
- [Full Fleet Allocation Configuration](./examples/fleetallocation.yaml)
- [Full Autoscaler Configuration](./examples/fleetautoscaler.yaml)
- [Simple UDP](./examples/simple-udp) (Go) - simple server and client that send UDP packets back and forth.
- [CPP Simple](./examples/cpp-simple) (C++) - C++ example that starts up, stays healthy and then shuts down after 60 seconds.
- [Xonotic](./examples/xonotic) - Wraps the SDK around the open source FPS game [Xonotic](http://www.xonotic.org) and hosts it on Agones.

### Advanced
- [Scheduling and Autoscaling](./docs/scheduling_autoscaling.md)
- [Limiting CPU/Memory](./docs/limiting_resources.md)

### Third Party Content
- [Videos and Presentation](./docs/videos_presentations.md)
Documentation can be found on the [Agones website](https://agones.dev/site/docs/).

## Get involved

Expand All @@ -92,7 +43,7 @@ Participation in this project comes under the [Contributor Covenant Code of Cond

## Development and Contribution

Please read the [contributing](CONTRIBUTING.md) guide for directions on submitting Pull Requests to Agones.
Please read the [contributing](CONTRIBUTING.md) guide for directions on submitting Pull Requests to Agones, and community membership governance.

See the [Developing, Testing and Building Agones](build/README.md) documentation for developing, testing and building Agones from source.

Expand Down
31 changes: 31 additions & 0 deletions agones-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 10 additions & 2 deletions build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,15 @@ ifndef FULL_BUILD
zip_flags = -0
endif

# ___ _ _
# |_ _|_ __ ___| |_ _ __| | ___ ___
# | || '_ \ / __| | | | |/ _` |/ _ \ __|
# | || | | | (__| | |_| | (_| | __\__ \
# |___|_| |_|\___|_|\__,_|\__,_|\___|___/
#

include ./includes/website.mk

# _____ _
# |_ _|_ _ _ __ __ _ ___| |_ ___
# | |/ _` | '__/ _` |/ _ \ __/ __|
Expand Down Expand Up @@ -163,7 +172,7 @@ push-release-chart: $(ensure-build-image)
build-sdks: build-sdk-cpp

# Run all tests
test: $(ensure-build-image) test-go test-install-yaml
test: $(ensure-build-image) test-go test-install-yaml site-test

# Run go tests
test-go:
Expand Down Expand Up @@ -636,7 +645,6 @@ kind-push:
rm -f $$BUNDLE_FILE

# Runs e2e tests against our kind cluster
kind-test-e2e:
kind-test-e2e:
$(MAKE) KUBECONFIG="$(shell kind get kubeconfig-path --name="$(KIND_PROFILE)")" \
DOCKER_RUN_ARGS=--network=host \
Expand Down
20 changes: 18 additions & 2 deletions build/build-image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
FROM gcr.io/agones-images/grpc-cxx:1.16.1

RUN apt-get update && \
apt-get install -y wget psmisc rsync make python bash-completion zip nano jq graphviz && \
apt-get install -y wget psmisc rsync make python bash-completion zip nano jq graphviz linkchecker gettext-base && \
apt-get clean

# _
Expand Down Expand Up @@ -62,7 +62,7 @@ RUN wget -q https://dl.google.com/dl/cloudsdk/release/google-cloud-sdk.zip && un
ENV PATH /usr/local/go/bin:/go/bin:/opt/google-cloud-sdk/bin:$PATH

# RUN gcloud components update
RUN gcloud components update
RUN gcloud components update && gcloud components install app-engine-go

# overwrite kubectl as we want a specific version
ENV KUBECTL_VER 1.11.5
Expand Down Expand Up @@ -109,6 +109,22 @@ RUN curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.s
RUN mkdir -p /go/src && cd /go/src && mkdir -p k8s.io && cd k8s.io && \
git clone -b kubernetes-1.11.5 --depth=3 https://github.com/kubernetes/code-generator.git

#
# \ \ / /__| |__ ___(_) |_ ___
# \ \ /\ / / _ \ '_ \/ __| | __/ _ \
# \ V V / __/ |_) \__ \ | |_ __/
# \_/\_/ \___|_.__/|___/_|\__\___|
#

RUN mkdir /tmp/hugo && \
wget -O /tmp/hugo/hugo.tar.gz https://github.com/gohugoio/hugo/releases/download/v0.53/hugo_extended_0.53_Linux-64bit.tar.gz && \
tar -zxvf /tmp/hugo/hugo.tar.gz -C /tmp/hugo/ && \
mv /tmp/hugo/hugo /usr/local/bin/ && \
rm -r /tmp/hugo

RUN curl -sL https://deb.nodesource.com/setup_11.x | bash - && \
apt-get install -y nodejs

# make sure we keep the path to go
RUN echo "export PATH=/usr/local/go/bin:/go/bin/:\$PATH" >> /root/.bashrc
# make nano the editor
Expand Down
68 changes: 68 additions & 0 deletions build/includes/website.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Copyright 2018 Google Inc. All Rights Reserved.
#
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# 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.


# __ __ _ _ _
# \ \ / /__| |__ ___(_) |_ ___
# \ \ /\ / / _ \ '_ \/ __| | __/ _ \
# \ V V / __/ |_) \__ \ | |_ __/
# \_/\_/ \___|_.__/|___/_|\__\___|
#

#
# Website targets
#

# generate the latest website
site-server: ARGS ?=-F
site-server: ENV ?= RELEASE_VERSION="$(base_version)"
site-server: ensure-build-image
docker run --rm $(common_mounts) --workdir=$(mount_path)/site $(DOCKER_RUN_ARGS) -p 1313:1313 $(build_tag) bash -c \
"$(ENV) hugo server --watch --baseURL=http://localhost:1313/ --bind=0.0.0.0 $(ARGS)"

site-static: ensure-build-image
-docker run --rm $(common_mounts) --workdir=$(mount_path)/site $(DOCKER_RUN_ARGS) $(build_tag) rm -r ./public
-mkdir $(agones_path)/site/public
# for some reason, this only work locally
docker run --rm $(common_mounts) --workdir=$(mount_path)/site $(DOCKER_RUN_ARGS) $(build_tag) \
bash -c "npm list postcss-cli || npm install postcss-cli"
docker run --rm $(common_mounts) --workdir=$(mount_path)/site $(DOCKER_RUN_ARGS) $(build_tag) \
bash -c "npm list autoprefixer || npm install autoprefixer"
docker run --rm $(common_mounts) --workdir=$(mount_path)/site $(DOCKER_RUN_ARGS) $(build_tag) bash -c \
"$(ENV) hugo --config=config.toml $(ARGS)"

site-gen-app-yaml: SERVICE ?= default
site-gen-app-yaml:
docker run --rm $(common_mounts) --workdir=$(mount_path)/site $(DOCKER_RUN_ARGS) $(build_tag) bash -c \
"SERVICE=$(SERVICE) envsubst < app.yaml > .app.yaml"

site-deploy: site-gen-app-yaml site-static
docker run --rm $(common_mounts) --workdir=$(mount_path)/site $(DOCKER_RUN_ARGS) $(build_tag) \
gcloud app deploy .app.yaml --no-promote --version=$(shell git rev-parse --short=7 HEAD)

site-static-preview:
$(MAKE) site-static ARGS="-F" ENV=RELEASE_VERSION=$(base_version)

site-deploy-preview: site-static-preview
$(MAKE) site-deploy SERVICE=preview

site-test:
docker run --rm --name=agones-website $(common_mounts) --workdir=$(mount_path)/site $(DOCKER_RUN_ARGS) $(build_tag) \
hugo server --watch --baseURL="http://localhost:1313/site/" &
until docker exec agones-website curl -o /dev/null --silent http://localhost:1313/site/; \
do \
echo "Waiting for server to start..."; \
sleep 1; \
done
( trap 'docker stop agones-website' EXIT; docker exec agones-website linkchecker --anchors http://localhost:1313/site/ )
23 changes: 22 additions & 1 deletion cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,30 @@ steps:
id: lint
- name: "make-docker"
dir: "build"
args: [ "test" ] # run tests
args: [ "-j", "3", "test" ] # run tests, in parallel
waitFor: ['lint']
id: tests

#
# Site preview
#

- name: "make-docker" # build a preview of the website
id: "site-static"
dir: "build"
args: ["site-static-preview", "site-gen-app-yaml", "SERVICE=preview"]
waitFor: ['tests']
- name: "ubuntu" # fake a new gopath
id: "site-gopath"
args: ["bash", "-c", "mkdir -p ./go/src && mv ./site ./go/src && cp -r ./vendor/gopkg.in ./go/src && ls -a ./go/src/site"]
- name: "gcr.io/cloud-builders/gcloud" # deploy the preview of the website
id: "deploy-site-static"
dir: "go/src/site"
args: ["app", "deploy", ".app.yaml", "--no-promote", "--version=$SHORT_SHA"]
waitFor: ['site-gopath']
env:
- GOPATH=/workspace/go

- name: "make-docker"
dir: "build"
args: [ "build", "push" ] # build all the things, and push images
Expand Down
24 changes: 14 additions & 10 deletions docs/governance/templates/release_issue.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,25 @@ and copy it into a release issue. Fill in relevent values, found inside {}
- [ ] Ensure the [helm `tag` value][values] is correct (should be the {version} if a full release, {version}-rc if release candidate)
- [ ] Ensure the [helm `Chart` version values][chart] are correct (should be the {version} if a full release, {version}-rc if release candidate)
- [ ] Run `make gen-install`
- [ ] Ensure all example images exist on gcr.io/agones-images
- [ ] If full release, update documentation with updated example images tags
- [ ] If RC release, update all ⚠️⚠️⚠️ warnings to: "**This is currently a release candidate feature**"
- [ ] If full release, remove all instances of "⚠️⚠️⚠️ **This is currently a development feature and has not been released** ⚠️⚠️⚠️"
- [ ] If full release, update install docs with the new release version
- [ ] Ensure all example images exist on gcr.io/agones-images-
- [ ] Create a *draft* release with the [release template][release-template]
- [ ] Make a `tag` with the release version.
- [ ] Site updated
- [ ] If full release, review and remove all instances of the `feature` shortcode
- [ ] Update to the new release branch (`release-branch` in config.toml) to {version}, or {version}-rc if release candidate.
- [ ] If full release, update site with the new release version (`release-version` in config.toml) to {version}
- [ ] If full release, update documentation with updated example images tags
- [ ] Copy the draft release content into a new `/site/content/en/blog/releases` content (this will be what you send via email).
- [ ] Create PR with these changes, and merge them with approval
- [ ] Confirm local git remote `upstream` points at `git@github.com:GoogleCloudPlatform/agones.git`
- [ ] Run `git remote update && git checkout master && git reset --hard upstream/master` to ensure your code is in line with upstream (unless this is a hotfix, then do the same, but for the the release branch)
- [ ] Run `make do-release`. (if release candidate `make do-release RELEASE_VERSION={version}-rc`) to create and push the docker images and helm chart.
- [ ] Run `make do-release`. (if release candidate: `make do-release RELEASE_VERSION={version}-rc`) to create and push the docker images and helm chart.
- [ ] Do a `helm repo add agones https://agones.dev/chart/stable` and verify that the new version is available via the command `helm search agones/`
- [ ] Do a `helm install` and a smoke test to confirm everything is working.
- [ ] Create a release with the [release template][release-template]
- [ ] Make a `tag` with the release version.
- [ ] Attach all assets found in the `release` folder to the release.
- [ ] Send an email to the [mailing list][list] with the release details (copy-paste the github release)
- [ ] Attach all assets found in the `release` folder to the release.
- [ ] Submit the Release.
- [ ] Run `make site-deploy` (if release candidate: `make site-deploy SERVICE=rc`), and make it the default version
- [ ] Send an email to the [mailing list][list] with the release details (copy-paste the release blog post)
- [ ] If full release, then increment the `base_version` in [`build/Makefile`][build-makefile]
- [ ] Ensure the [helm `tag` value][values] is set to the next version (should be the {version}+0.1 if a full release, {version}+0.1-rc if release candidate)
- [ ] Ensure the [helm `Chart` version values][chart] is set to the next version (should be the {version}+0.1 if a full release, {version} if release candidate)
Expand Down
11 changes: 0 additions & 11 deletions docs/videos_presentations.md

This file was deleted.

2 changes: 1 addition & 1 deletion examples/autoscaler-webhook/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ When this endpoint is called, target Replica count gets calculated. If a fleet d

Note that scaling up logic is based on the percentage of allocated gameservers in a fleet. If this fraction is more than threshold (i. e. 0.7) than `Scale` parameter in `FleetAutoscaleResponse` is set to `true` and `Replica` value is returned increased by the `scaleFactor` (in this example twice) which results in creating more `Ready` GameServers. If the fraction below the threshold (i. e. 0.3) we decrease the count of gameservers in a fleet. There is a `minReplicasCount` parameters which defined the lower limit of the gameservers number in a Fleet.

To learn how to deploy the fleet to GKE, please see the tutorial [Create a Fleet (Go)](../../docs/create_fleet.md).
To learn how to deploy the fleet to GKE, please see the tutorial [Create a Fleet (Go)](https://agones.dev/site/docs/getting-started/create-fleet/).

## Example flow

Expand Down
Loading

0 comments on commit 6ef9882

Please sign in to comment.