-
Notifications
You must be signed in to change notification settings - Fork 825
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 shutdown duration option to Node.js simple #1413
Add shutdown duration option to Node.js simple #1413
Conversation
Build Failed 😱 Build Id: 6200d550-c35c-404d-9503-9563df736a67 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Build Succeeded 👏 Build Id: 2cc2c5f5-db05-4272-981c-3cf6507cbcab 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:
|
@@ -43,7 +43,7 @@ build: | |||
cd $(root_path) && docker build -f $(project_path)/Dockerfile --tag=$(server_tag) . | |||
|
|||
run: | |||
docker run --network=host $(server_tag) | |||
docker run --network=host $(server_tag) $(args) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice stuff - will be useful for testing #1299 👍
We should also increment the tag version in this file, so we can rebuild and push it up for people to use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would that be server-tag and should it be 1.5 now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
server_tag = $(REPOSITORY)/nodejs-simple-server:0.3
➡️ server_tag = $(REPOSITORY)/nodejs-simple-server:0.4
It will | ||
- Setup the Agones SDK | ||
- Call `sdk.ready()` to register that it is ready with Agones. | ||
It will: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to document what the command is (or the Docker run command?) should be to run this for longer than 60 seconds?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is documented around line 120 after example debug output but perhaps clearer if I reorder?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would also like the explicit command line argument documented.
Or is it just "120" as seconds ? Should we use a key-value pair? Like --timeout=120 ?
Would be much more explicit, and also expandable down the line. WDYT?
@@ -1,6 +1,6 @@ | |||
{ | |||
"dependencies": { | |||
"@google-cloud/agones-sdk": "1.3.0" | |||
"@google-cloud/agones-sdk": "1.4.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps should update as part of the release @markmandel ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is necessary, unless there is a code change in either the SDK or the example.
Unless you can see a good reason to?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main reason would be to keep the code sample up to date and consistent with the release. We could also change to a non-pinned dependency
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But if there is no public API code change between versions, then it is up to date with the latest release 😄
examples/nodejs-simple/README.md
Outdated
Please note that there is a max sleep time in Node.js of 2,147,483 seconds (~24 days). Values will be capped at this and negative values or zero will also be set to this. | ||
So to keep the server alive for a long time you could use the following: | ||
``` | ||
$ make args="0" run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would make these (no pun intended 😄 ) the full Docker run command.
That way people don't need to pull down the full example source code -- and can also replicated within their Agones install as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah sure. I was just basing this on the previous instructions. I usually run with npm start
anyway.
If there's a need for both should we have both ways of running?
@roberthbailey you wrote the original README - any thoughts on this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, if it's been this way for a while, I'll be less opinionated on changing to Docker run... but it still would be nice I think?
Build Succeeded 👏 Build Id: 325f15de-12c4-4747-b774-66a36148bc0a 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:
|
Build Failed 😱 Build Id: dcd796ae-6334-43a8-bdfd-6e95c371f193 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Build Succeeded 👏 Build Id: 1a9f601d-f449-4d44-ae67-c8ee600e4f5e 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:
|
You can optionally specify how long the server will stay up once the basic tests are complete with the `--timeout` option. | ||
To do this pass arguments through, e.g. to increase the shutdown duration to 120 seconds: | ||
``` | ||
$ make args="--timeout=120" run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love this! 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ran a local test - all looks good!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: markmandel, steven-supersolid The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
New changes are detected. LGTM label has been removed. |
Wonder if it's because I merged without the button last time? But I had the button just now, so pressed it :) |
I'll wait for this to run through, and then it gets to be first in the queue 😄 |
Build Succeeded 👏 Build Id: 6e3a431f-1496-4bf1-85bf-f0114befa547 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:
|
* Add optional shutdown duration. Update makefile and docs * Fix dockerfile to pass through params * Improve options handling. Fix Makefile on Windows. Update documentation. Update server version
The example code now reads the first argument if specified
If --help is passed then will exit with a help message
If a number is passed then that will be used for the shutdown duration
Converted setTimeout to use
await
to make code clearerUpdated watch to give more relevant information set during the test
Clear intervals correctly so these don't prevent the app from exiting
Found the app still won't exit cleanly so potentially a bug in
sdk.close()
(fix as separate PR)Updated Makefile and dockerfile to pass in a parameter
Updated documentation