honor port env variable for python web server examples#338
Open
ajshedivy wants to merge 5 commits intoIBM:masterfrom
Open
honor port env variable for python web server examples#338ajshedivy wants to merge 5 commits intoIBM:masterfrom
ajshedivy wants to merge 5 commits intoIBM:masterfrom
Conversation
7b1db2d to
3ea9654
Compare
kadler
reviewed
Sep 19, 2022
|
|
||
| app.debug = True | ||
| app.run(host='0.0.0.0', port=9000,) | ||
| app.run(host='0.0.0.0', port=os.getenv('PORT', '9000'),) |
Member
There was a problem hiding this comment.
I don't think Flask allows the port to be specified as a string. You'd need to wrap this: int(os.getenv('PORT', 9000))
I'm not sure if bottle has the same limitation, but I suspect so.
Member
Author
There was a problem hiding this comment.
I'll add the int wrapper to the flask example. I have tested the active-jobs-dashboard locally and with ServiceCommander, and doesn't seem to enforce PORT being an int
Member
|
Realizing that these examples really could use some sprucing up to show best practices. The dashboard example should be converted to use Flask and the bottle example should probably be removed (or a disclaimer that Flask is much more widely used). |
1016697 to
5202022
Compare
Signed-off-by: ajshedivy <ajshedivy@wisc.edu>
Signed-off-by: ajshedivy <ajshedivy@wisc.edu>
Signed-off-by: ajshedivy <ajshedivy@wisc.edu>
Signed-off-by: ajshedivy <ajshedivy@wisc.edu>
Signed-off-by: ajshedivy <ajshedivy@wisc.edu>
be83eba to
4c90b22
Compare
Member
Author
|
moving #339 to this pull request |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This should make all python web server examples compatible with cluster mode in ServiceCommander.