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

Add Sidecar log level parameter to GS specification #1007

Merged
merged 1 commit into from Sep 20, 2019

Conversation

aLekSer
Copy link
Collaborator

@aLekSer aLekSer commented Aug 21, 2019

Add ability to specify logrus log level in yaml configuration and apply this log level on GameServer creation step.

Closes #971 .

@aLekSer
Copy link
Collaborator Author

aLekSer commented Aug 21, 2019

What is left: documentation update and UT.

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 0d2740fa-f270-417d-9191-c6db48c68592

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@aLekSer
Copy link
Collaborator Author

aLekSer commented Aug 21, 2019

Build failed because I should have performed make gen-api-docs

Step #15 - "tests": includes/website.mk:96: recipe for target 'test-gen-api-docs' failed

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 8723c226-c6d1-4a63-9c26-21833df2e505

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

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/GoogleCloudPlatform/agones.git pull/1007/head:pr_1007 && git checkout pr_1007
  • helm install install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.0.0-0402062

@aLekSer aLekSer changed the title Add Sidecar log level through GS specification Add Sidecar log level parameter to GS specification Aug 21, 2019
@@ -135,6 +135,8 @@ type GameServerSpec struct {
Health Health `json:"health,omitempty"`
// Scheduling strategy. Defaults to "Packed".
Scheduling apis.SchedulingStrategy `json:"scheduling,omitempty"`
// LogLevel specifies the log level for gameserver sidecar.
LogLevel string `json:"loglevel,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

Random thought: Is "loglevel" too generic? Considering it's just for the sdk sidecar - should we pick a name that's more specific? sdk-server-loglevel (seems long), not sure what the right answer is here, figured I would ask the question first.

Just wondering if the name might be confusing.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, you are right, that would suit better.

@aLekSer aLekSer force-pushed the feature/gs-log-level branch 2 times, most recently from f96fe14 to d9987ac Compare August 22, 2019 17:32
@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 1c8ebc65-0e9b-4acb-8802-a3d4997cdf23

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: ff00d479-51e0-4d7f-b23d-ef6e6e874236

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

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/GoogleCloudPlatform/agones.git pull/1007/head:pr_1007 && git checkout pr_1007
  • helm install install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.0.0-d9987ac

@aLekSer
Copy link
Collaborator Author

aLekSer commented Aug 22, 2019

Flaky E2E test:

Step #20: --- FAIL: TestFleetScaleUpEditAndScaleDown (0.01s)
Step #20: --- FAIL: TestFleetScaleUpEditAndScaleDown/Use_fleet_Patch_false (156.24s)
Step #20: fleet_test.go:120: 
Step #20: Error Trace:	fleet_test.go:120
Step #20: Error: Expected nil, but got: &errors.errorString{s:"timed out waiting for the condition"}
Step #20: Test: TestFleetScaleUpEditAndScaleDown/Use_fleet_Patch_false

@aLekSer aLekSer marked this pull request as ready for review August 22, 2019 18:34
@@ -49,6 +49,8 @@ spec:
# Minimum consecutive failures for the health probe to be considered failed after having succeeded.
# Defaults to 3. Minimum value is 1
failureThreshold: 3
# SdkServer Log Level configuration. Could be any of panic, fatal, error, warn, warning, info, debug and trace. Defaults to info
Copy link
Member

Choose a reason for hiding this comment

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

we should feature wrap these items.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

@@ -860,6 +882,17 @@ spec:
type: integer
minimum: 1
maximum: 65535
loglevel:
Copy link
Member

Choose a reason for hiding this comment

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

Pretty sure this validation also needs to be changed, with the rename?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, that's true

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 916af54a-7c22-486c-91e7-78312ceb0c55

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

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/GoogleCloudPlatform/agones.git pull/1007/head:pr_1007 && git checkout pr_1007
  • helm install install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.0.0-8c570b0

@@ -92,6 +92,17 @@ properties:
type: integer
minimum: 1
maximum: 65535
sdk-server-loglevel:
type: string
enum:
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we should expose so many log levels. This seems to be externalizing the fact that we are using logrus and would make it nearly impossible to change our logging library in the future. I feel like there are really three categories that people want:

  1. Default (what we have today, which in basically the info level)
  2. Errors and above
  3. Debugging - everything

What if we abstracted the log levels from logrus and just offered something smaller like those three? Alternatively, we could give people a way to specifically disable the ping logs since those are the ones that cause the most noise in the log file.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, less level would be more concise. I will do the change cause that would actually give more space for the changes in the future.

@aLekSer aLekSer force-pushed the feature/gs-log-level branch 2 times, most recently from f5247f7 to 1d3ef31 Compare August 27, 2019 15:45
@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: b0632155-c2e8-47fb-86e2-f91d56737d23

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

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/GoogleCloudPlatform/agones.git pull/1007/head:pr_1007 && git checkout pr_1007
  • helm install install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.0.0-f5247f7

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 7a085cc1-0600-4f5b-ba38-802783b8a935

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

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/GoogleCloudPlatform/agones.git pull/1007/head:pr_1007 && git checkout pr_1007
  • helm install install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.0.0-1d3ef31

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: d0d73236-6774-4ffd-b06f-22b26ae6feaf

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

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/GoogleCloudPlatform/agones.git pull/1007/head:pr_1007 && git checkout pr_1007
  • helm install install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.0.0-458876a

Copy link
Member

@markmandel markmandel left a comment

Choose a reason for hiding this comment

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

This looks good to me. Since this adds a configuration option to GameServer which we can't break once its out there, @roberthbailey you good to give me an also +1 that's we're both happy with this PR ?

@aLekSer
Copy link
Collaborator Author

aLekSer commented Aug 28, 2019

/assign @aLekSer

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 3678dba6-96b2-4238-b041-81027322a405

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

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/GoogleCloudPlatform/agones.git pull/1007/head:pr_1007 && git checkout pr_1007
  • helm install install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.0.0-1c126f7

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: d87c24ed-d156-49ec-a95a-e7bb9e576411

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@aLekSer
Copy link
Collaborator Author

aLekSer commented Sep 10, 2019

I have merged master to the branch.

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 7f74c6d7-1178-4b09-9fc4-0bbfdd359d26

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

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/GoogleCloudPlatform/agones.git pull/1007/head:pr_1007 && git checkout pr_1007
  • helm install install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.0.0-d55e6ae

@markmandel markmandel added the feature-freeze-do-not-merge Only eligible to be merged once we are out of feature freeze (next full release) label Sep 10, 2019
@markmandel markmandel removed the feature-freeze-do-not-merge Only eligible to be merged once we are out of feature freeze (next full release) label Sep 17, 2019
@aLekSer
Copy link
Collaborator Author

aLekSer commented Sep 18, 2019

Updated publishVersion to a new one:
{{% feature publishVersion="1.1.0" %}}

Also I have found an issue with make gen-api-docs that if PR moves through the release, then it doesn't see new changes and doesn't update versions accordingly.
So it was needed to perform an extra step before the command:
git checkout master ../site/content/en/docs/Reference/agones_crd_api_reference.html

PR is now ready for review (and merge).

@aLekSer
Copy link
Collaborator Author

aLekSer commented Sep 19, 2019

Build failed for some strange reason - no status comment was generated here on github PR:

Status	
 Build failed
Status detail	
failed unmarshalling build config cloudbuild.yaml: proto: google.devtools.cloudbuild.v1.Build.timeout|"timeout": google.protobuf.Duration: invalid duration value "1h"
Build id	
0867e0f5-6a9b-48b8-92bb-f9abb0d96c16
Image	
—
Trigger	
Push to github_pr_1007 branch (agones)

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 619e3d42-f1ba-4483-88e5-ed3d1f426774

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

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/GoogleCloudPlatform/agones.git pull/1007/head:pr_1007 && git checkout pr_1007
  • helm install install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.1.0-ffd2890

Copy link
Member

@roberthbailey roberthbailey left a comment

Choose a reason for hiding this comment

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

I did another pass and had a few more comments for you.

pkg/apis/agones/v1/gameserver.go Outdated Show resolved Hide resolved
// Template describes the Pod that will be created for the GameServer
Template corev1.PodTemplateSpec `json:"template"`
}

// Logging contains log levels for Agones system containers
type Logging struct {
// SdkServer is a log level for SDK server (sidecar) logs
Copy link
Member

Choose a reason for hiding this comment

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

Please add Defaults to "Info" at the end of this comment.

pkg/apis/agones/v1/gameserver_test.go Show resolved Hide resolved
@@ -205,17 +212,19 @@ func TestGameServerApplyDefaults(t *testing.T) {
Protocol: corev1.ProtocolTCP,
},
},
Health: Health{Disabled: true},
Health: Health{Disabled: true},
Logging: Logging{SdkServer: "Debug"},
Copy link
Member

Choose a reason for hiding this comment

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

rather than piggyback on an existing test case ("convert from legacy single port to multiple" to test applying a custom log level, please add a new test case that specifically tests setting the log level.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

OK, adding a separate test

@@ -57,6 +57,11 @@ spec:
health:
initialDelaySeconds: 30
periodSeconds: 60
{{% feature publishVersion="1.0.0" %}}
Copy link
Member

Choose a reason for hiding this comment

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

This should now be 1.1.0

@aLekSer aLekSer force-pushed the feature/gs-log-level branch 2 times, most recently from a4156b8 to b0b913e Compare September 20, 2019 10:23
@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 838b17fc-c2cb-4970-a589-7685c6b8b927

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@aLekSer
Copy link
Collaborator Author

aLekSer commented Sep 20, 2019

Applied comments and added agones_crd_api_reference.html

@agones-bot
Copy link
Collaborator

Build Failed 😱

Build Id: 41a79350-09d9-4c67-a281-2231e8cdeb9f

To get permission to view the Cloud Build view, join the agones-discuss Google Group.

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 1dae75b1-a06d-4fe4-9539-cedca78bdd42

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

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/GoogleCloudPlatform/agones.git pull/1007/head:pr_1007 && git checkout pr_1007
  • helm install install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.1.0-3e4c972

Add ability to specify logrus log level in yaml configuration and
apply this log level on creating the GameServer.
@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: e93355dd-0519-42b2-a1a6-cc9b3cd7c4a6

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

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/GoogleCloudPlatform/agones.git pull/1007/head:pr_1007 && git checkout pr_1007
  • helm install install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.1.0-51ea158

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: f0e5420e-e806-4bb7-be59-98c10c281c98

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

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/GoogleCloudPlatform/agones.git pull/1007/head:pr_1007 && git checkout pr_1007
  • helm install install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.1.0-3b2365a

@google-oss-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: aLekSer, roberthbailey
To complete the pull request process, please assign
You can assign the PR to them by writing /assign in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@roberthbailey roberthbailey merged commit fc9169c into googleforgames:master Sep 20, 2019
@roberthbailey roberthbailey added this to the 1.1.0 milestone Sep 20, 2019
@markmandel markmandel added area/operations Installation, updating, metrics etc kind/feature New features for Agones labels Oct 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/operations Installation, updating, metrics etc kind/feature New features for Agones lgtm size/XXL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Configurable log level for agones sidecar
5 participants