Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating a Fleet creates a GameServerSet #174

Merged

Conversation

markmandel
Copy link
Member

All this commit is doing is create a GameServerSet when a Fleet is created. Also, if the Replicas in
a Fleet are updated, then the owned GameServerSet's Replicas are also updated.

For this commit, we are not worrying about handling updates to the Spec (e.g. new image) to the Fleet,
and doing updates to a live Fleet, we are just concerned with scaling up and down.

Parent ticket: #70

@markmandel markmandel added the kind/feature New features for Agones label Apr 12, 2018
@markmandel markmandel added this to the 0.2 milestone Apr 12, 2018
@markmandel markmandel mentioned this pull request Apr 12, 2018
5 tasks
@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 9e08eb3d-a08b-4b9a-af63-5120d777ee87

Build Logs
starting build "9e08eb3d-a08b-4b9a-af63-5120d777ee87"

FETCHSOURCE
Initialized empty Git repository in /workspace/.git/
From https://source.developers.google.com/p/agones-images/r/agones
 * branch            63314dbb48377c98273ea2dc733746ceb8b1f846 -> FETCH_HEAD
HEAD is now at 63314db Creating a Fleet creates a GameServerSet
BUILD
Starting Step #0
Step #0: Already have image (with digest): ubuntu
Finished Step #0
Starting Step #1
Step #1: Already have image (with digest): gcr.io/cloud-builders/docker
Step #1: Sending build context to Docker daemon  130.9MB

Step #1: Step 1/3 : FROM gcr.io/cloud-builders/docker
Step #1:  ---> 18b36e490519
Step #1: Step 2/3 : RUN apt-get install make
Step #1:  ---> Running in 5e7339836186
Step #1: Reading package lists...
Step #1: Building dependency tree...
Step #1: Reading state information...
Step #1: Suggested packages:
Step #1:   make-doc
Step #1: The following NEW packages will be installed:
Step #1:   make
Step #1: 0 upgraded, 1 newly installed, 0 to remove and 29 not upgraded.
Step #1: Need to get 151 kB of archives.
Step #1: After this operation, 365 kB of additional disk space will be used.
Step #1: Get:1 http://archive.ubuntu.com/ubuntu xenial/main amd64 make amd64 4.1-6 [151 kB]
Step #1: �[91mdebconf: unable to initialize frontend: Dialog
Step #1: �[0m�[91mdebconf: (TERM is not set, so the dialog frontend is not usable.)
Step #1: �[0m�[91mdebconf: falling back to frontend: Readline
Step #1: �[0m�[91mdebconf: unable to initialize frontend: Readline
Step #1: �[0m�[91mdebconf: (This frontend requires a controlling tty.)
Step #1: �[0m�[91mdebconf: falling back to frontend: Teletype
Step #1: �[0m�[91mdpkg-preconfigure: unable to re-open stdin: 
Step #1: �[0mFetched 151 kB in 0s (253 kB/s)
Step #1: Selecting previously unselected package make.
Step #1: (Reading database ... 
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 11239 files and directories currently installed.)
Step #1: Preparing to unpack .../archives/make_4.1-6_amd64.deb ...
Step #1: Unpacking make (4.1-6) ...
Step #1: Setting up make (4.1-6) ...
Step #1: Removing intermediate container 5e7339836186
Step #1:  ---> ef2d8c778011
Step #1: Step 3/3 : ENTRYPOINT ["/usr/bin/make"]
Step #1:  ---> Running in 77c14f847041
Step #1: Removing intermediate container 77c14f847041
Step #1:  ---> da7860fff475
Step #1: Successfully built da7860fff475
Step #1: Successfully tagged make-docker:latest
Finished Step #1
Starting Step #2
Step #2: Already have image: make-docker
Step #2: docker pull gcr.io/agones-images/agones-build:fbb00a6f77 && docker tag gcr.io/agones-images/agones-build:fbb00a6f77 agones-build:fbb00a6f77
Step #2: fbb00a6f77: Pulling from agones-images/agones-build
Step #2: c73ab1c6897b: Already exists
Step #2: a8818f135186: Pulling fs layer
Step #2: 028bb24b1505: Pulling fs layer
Step #2: 14cbd492f8cf: Pulling fs layer
Step #2: 7c8b9ba14115: Pulling fs layer
Step #2: f65ca2139a9a: Pulling fs layer
Step #2: 5399e2c84bf1: Pulling fs layer
Step #2: d5c423142e44: Pulling fs layer
Step #2: 65121dd604cd: Pulling fs layer
Step #2: 3c6430bdce48: Pulling fs layer
Step #2: ee9a473b14dc: Pulling fs layer
Step #2: 2e573ff3c0af: Pulling fs layer
Step #2: 460964c26331: Pulling fs layer
Step #2: 704181ae2c89: Pulling fs layer
Step #2: f1ac6ad94766: Pulling fs layer
Step #2: 7c8b9ba14115: Waiting
Step #2: f65ca2139a9a: Waiting
Step #2: 5399e2c84bf1: Waiting
Step #2: d5c423142e44: Waiting
Step #2: 65121dd604cd: Waiting
Step #2: 3c6430bdce48: Waiting
Step #2: ee9a473b14dc: Waiting
Step #2: 2e573ff3c0af: Waiting
Step #2: 460964c26331: Waiting
Step #2: 704181ae2c89: Waiting
Step #2: f1ac6ad94766: Waiting
Step #2: 14cbd492f8cf: Verifying Checksum
Step #2: 14cbd492f8cf: Download complete
Step #2: a8818f135186: Verifying Checksum
Step #2: a8818f135186: Download complete
Step #2: 7c8b9ba14115: Verifying Checksum
Step #2: 7c8b9ba14115: Download complete
Step #2: f65ca2139a9a: Verifying Checksum
Step #2: f65ca2139a9a: Download complete
Step #2: d5c423142e44: Verifying Checksum
Step #2: d5c423142e44: Download complete
Step #2: 5399e2c84bf1: Verifying Checksum
Step #2: 5399e2c84bf1: Download complete
Step #2: 65121dd604cd: Verifying Checksum
Step #2: 65121dd604cd: Download complete
Step #2: 3c6430bdce48: Verifying Checksum
Step #2: 3c6430bdce48: Download complete
Step #2: 2e573ff3c0af: Verifying Checksum
Step #2: 2e573ff3c0af: Download complete
Step #2: a8818f135186: Pull complete
Step #2: 460964c26331: Verifying Checksum
Step #2: 460964c26331: Download complete
Step #2: 704181ae2c89: Verifying Checksum
Step #2: 704181ae2c89: Download complete
Step #2: f1ac6ad94766: Verifying Checksum
Step #2: f1ac6ad94766: Download complete
Step #2: 028bb24b1505: Verifying Checksum
Step #2: 028bb24b1505: Download complete
Step #2: ee9a473b14dc: Verifying Checksum
Step #2: ee9a473b14dc: Download complete
Step #2: 028bb24b1505: Pull complete
Step #2: 14cbd492f8cf: Pull complete
Step #2: 7c8b9ba14115: Pull complete
Step #2: f65ca2139a9a: Pull complete
Step #2: 5399e2c84bf1: Pull complete
Step #2: d5c423142e44: Pull complete
Step #2: 65121dd604cd: Pull complete
Step #2: 3c6430bdce48: Pull complete
Step #2: ee9a473b14dc: Pull complete
Step #2: 2e573ff3c0af: Pull complete
Step #2: 460964c26331: Pull complete
Step #2: 704181ae2c89: Pull complete
Step #2: f1ac6ad94766: Pull complete
Step #2: Digest: sha256:126b6a072f164d3f8eb563dc8114a6d358ca635bdc77356baef8530062874187
Step #2: Status: Downloaded newer image for gcr.io/agones-images/agones-build:fbb00a6f77
Finished Step #2
Starting Step #3
Step #3: Already have image: make-docker
Step #3: mkdir -p ~/.kube
Step #3: mkdir -p /workspace/build//.config/gcloud
Step #3: docker run --rm -v /workspace/build//.config/gcloud:/root/.config/gcloud -v ~/.kube:/root/.kube -v /workspace:/go/src/agones.dev/agones agones-build:fbb00a6f77 go test -race agones.dev/agones/...
Step #3: warning: ignoring symlink /go/src/agones.dev/agones/vendor/github.com/prometheus/procfs/fixtures/self
Step #3: ?   	agones.dev/agones	[no test files]
Step #3: ?   	agones.dev/agones/cmd/controller	[no test files]
Step #3: ?   	agones.dev/agones/cmd/sdk-server	[no test files]
Step #3: ?   	agones.dev/agones/examples/simple-udp/client	[no test files]
Step #3: ?   	agones.dev/agones/examples/simple-udp/server	[no test files]
Step #3: ?   	agones.dev/agones/examples/xonotic	[no test files]
Step #3: ?   	agones.dev/agones/pkg	[no test files]
Step #3: ?   	agones.dev/agones/pkg/apis	[no test files]
Step #3: ?   	agones.dev/agones/pkg/apis/stable	[no test files]
Step #3: ok  	agones.dev/agones/pkg/apis/stable/v1alpha1	1.532s
Step #3: ?   	agones.dev/agones/pkg/client	[no test files]
Step #3: ?   	agones.dev/agones/pkg/client/clientset/versioned	[no test files]
Step #3: ?   	agones.dev/agones/pkg/client/clientset/versioned/fake	[no test files]
Step #3: ?   	agones.dev/agones/pkg/client/clientset/versioned/scheme	[no test files]
Step #3: ?   	agones.dev/agones/pkg/client/clientset/versioned/typed/stable/v1alpha1	[no test files]
Step #3: ?   	agones.dev/agones/pkg/client/clientset/versioned/typed/stable/v1alpha1/fake	[no test files]
Step #3: ?   	agones.dev/agones/pkg/client/informers/externalversions	[no test files]
Step #3: ?   	agones.dev/agones/pkg/client/informers/externalversions/internalinterfaces	[no test files]
Step #3: ?   	agones.dev/agones/pkg/client/informers/externalversions/stable	[no test files]
Step #3: ?   	agones.dev/agones/pkg/client/informers/externalversions/stable/v1alpha1	[no test files]
Step #3: ?   	agones.dev/agones/pkg/client/listers/stable/v1alpha1	[no test files]
Step #3: ok  	agones.dev/agones/pkg/fleets	3.364s
Step #3: ok  	agones.dev/agones/pkg/gameservers	17.343s
Step #3: ok  	agones.dev/agones/pkg/gameserversets	3.409s
Step #3: ?   	agones.dev/agones/pkg/sdk	[no test files]
Step #3: ?   	agones.dev/agones/pkg/testing	[no test files]
Step #3: ?   	agones.dev/agones/pkg/util	[no test files]
Step #3: ok  	agones.dev/agones/pkg/util/crd	4.501s
Step #3: ?   	agones.dev/agones/pkg/util/runtime	[no test files]
Step #3: ?   	agones.dev/agones/pkg/util/signals	[no test files]
Step #3: ok  	agones.dev/agones/pkg/util/webhooks	1.600s
Step #3: ok  	agones.dev/agones/pkg/util/workerqueue	3.546s
Step #3: ok  	agones.dev/agones/sdks/go	1.015s
Step #3: mkdir -p /tmp/agones-install
Step #3: cp /workspace/install/yaml/install.yaml /tmp/agones-install/install.yaml
Step #3: sort /tmp/agones-install/install.yaml > /tmp/agones-install/install.yaml.sorted
Step #3: /usr/bin/make gen-install
Step #3: make[1]: Entering directory '/workspace/build'
Step #3: mkdir -p ~/.kube
Step #3: mkdir -p /workspace/build//.config/gcloud
Step #3: docker run --rm -v /workspace/build//.config/gcloud:/root/.config/gcloud -v ~/.kube:/root/.kube -v /workspace:/go/src/agones.dev/agones  agones-build:fbb00a6f77 bash -c \
Step #3: 	'helm template --name=agones-manual /go/src/agones.dev/agones/install/helm/agones > /go/src/agones.dev/agones/install/yaml/install.yaml'
Step #3: make[1]: Leaving directory '/workspace/build'
Step #3: sort /workspace/install/yaml/install.yaml > /tmp/agones-install/install.current.yaml.sorted
Step #3: diff /tmp/agones-install/install.yaml.sorted /tmp/agones-install/install.current.yaml.sorted
Step #3: make: *** [test-install-yaml] Error 1
Step #3: 510c510
Step #3: <   resources: ["gameservers", "gameserversets"]
Step #3: ---
Step #3: >   resources: ["gameservers", "gameserversets", "fleets"]
Step #3: Makefile:110: recipe for target 'test-install-yaml' failed
Finished Step #3
ERROR
ERROR: build step 3 "make-docker" failed: exit status 2

@fooock
Copy link
Contributor

fooock commented Apr 12, 2018

@markmandel can be the error in this line? -mkdir instead mkdir

@markmandel
Copy link
Member Author

@fooock - the - just says to Make, if this command fails, just ignore it.
Since the directory could already exist from previous runs, we just ignore the mkdir command

The test failed because I didn't run gen-install to push the changes I made to the Helm chart to the manual install. diff actually returns a non-zero exit code when it finds a difference 😄

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 7137844b-5f9f-4bd1-b6cc-2e90fc4b8bb5

The following development artifacts have been built, and will exist for the next 30 days:

@fooock
Copy link
Contributor

fooock commented Apr 12, 2018

ahhh ok, thanks for the explanation @markmandel . I didn't know it 😃

"Created GameServerSet %s", activeGsSet.ObjectMeta.Name)

} else {
// for now, we're ignoring any change to the template - will handle on the next PR
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You want to support multiple game server set to implement things like rolling update?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, exactly!

return errors.Wrapf(err, "error updating replicas for gameserverset for fleet %s", fleet.ObjectMeta.Name)
}
c.recorder.Eventf(fleet, corev1.EventTypeNormal, "ScalingGameServerSet",
"Scaling GameServerSet %s to %d", gsSetCopy.ObjectMeta.Name, gsSetCopy.Spec.Replicas)
Copy link
Collaborator

@EricFortin EricFortin Apr 13, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we add the old number too in the event so we know if it was scaling up or down?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Done.

Copy link
Collaborator

@EricFortin EricFortin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than the scaling event, LGTM!

All this commit is doing is create a GameServerSet
when a Fleet is created. Also, if the Replicas in
a Fleet are updated, then the owned GameServerSet's
Replicas are also updated.

For this commit, we are not worrying about handling
updates to the Spec (e.g. new image) to the Fleet,
and doing updates to a live Fleet, we are just concerned
with scaling up and down.

Parent ticket: googleforgames#70
@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 45742169-9cab-4b8e-a93f-b88fd9d6498a

The following development artifacts have been built, and will exist for the next 30 days:

@markmandel markmandel merged commit 184402e into googleforgames:master Apr 13, 2018
@markmandel markmandel deleted the feature/fleet-no-update branch April 13, 2018 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature New features for Agones
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants