-
Notifications
You must be signed in to change notification settings - Fork 75
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
Tracking release/workbench-alpha branch to support the workbench #399
Tracking release/workbench-alpha branch to support the workbench #399
Conversation
Fixed a couple models that were pointing to the wrong html name.
…nload independent from the windows installer, mac dmg.
… made are unclear, unverified, and untested. RE#384
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.
Looks good to me! I tried out the new invest serve
command. Love how you can exit it with ctrl+C 😀 My only comment is about the output of serve
:
$ invest serve
* Serving Flask app "natcap.invest.ui_server" (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: off
* Running on http://127.0.0.1:56789/ (Press CTRL+C to quit)
What is the 'Environment' setting and if this is a development server, should we change it to say 'Development'?
Hey @emlys , thanks for bringing this up. By default, flask starts up in production mode. I haven't read about all the implications of that, but one implication is the subsequent WARNING about using the dev server in production. So the options seem to be:
|
serve_subparser = subparsers.add_parser( | ||
'serve', help=('Start the flask app on the localhost.')) | ||
serve_subparser.add_argument( | ||
'--port', type=int, default=56789, | ||
help='Port number for the Flask server') |
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!
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.
Hey @davemfish this looks good to me. I'd be fine with punting the production vs development issue Emily brought up into a separate issue. Off the top of my head I'd say number 1 or 3 would be the way to go.
Also, did you add a comment to History? I know James had mentioned maybe adding something.
I agree it's fine to go in a separate issue |
Okay we have passing builds now! Well, except for Mac. Since you all last looked at this, Doug & I added the optional subargument to specify a port when starting the flask app. e.g. Also brought this branch up-to-date with |
numpy>=1.11.0,!=1.16.0 | ||
Rtree>=0.8.2,!=0.9.1 | ||
Rtree>=0.8.2,!=0.9.1,<=0.9.4 # rtree/pyinstaller compatibility |
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.
Thanks for the comment!
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.
Thanks Dave!
Add logger name to logging format
remove fix for old actions bug
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.
Thanks, Dave!
I agree with the other comments about discussing the use of a webserver in a separate thread as well.
Looks like I'm the last one to submit an approval and all of the builds are passing (except RTD, which is currently an expected failure), so I'll merge this. |
I just created the new branch
release/workbench-alpha
- branched fromrelease/3.9
. This PR includes the changes needed to support the python side of the invest-workbench. Those changes are listed in #341 and amount to a small flask app that now lives undernatcap.invest.web_api
natcap.invest.ui_server
(thoughts on this name?) and a newinvest serve
CLI entry-point to start the flask dev server and run the app.There is a test here to cover the new
invest serve
subcommand. It imports the new modulenatcap.invest.ui_server
, but so far there are no tests here to cover the flask app's endpoints. We do have tests for those endpoints in the workbench's test suite. And right now the workbench is the only use-case for thenatcap.invest.ui_server
module. I'm interested to hear opinions about whether those tests should live here in this repo instead.Fixes #341
Checklist