-
Notifications
You must be signed in to change notification settings - Fork 511
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
#682 APP_PORT not injected into app container #685
Conversation
Signed-off-by: akhilac1 <chetlapalle.akhila@gmail.com>
Signed-off-by: akhilac1 <chetlapalle.akhila@gmail.com>
…lac1/quickstarts into hotfix_quickstarts_app_port
Signed-off-by: akhilac1 <chetlapalle.akhila@gmail.com>
…lac1/quickstarts into hotfix_quickstarts_app_port Signed-off-by: akhilac1 <chetlapalle.akhila@gmail.com>
Signed-off-by: akhilac1 <chetlapalle.akhila@gmail.com>
Signed-off-by: akhilac1 <chetlapalle.akhila@gmail.com>
@paulyuk @msfussell @berndverst - The ubuntu tutorials are failing due to python app in distributed calculator. This app needs the updated docker image to pass - since the existing docker image uses flask and the app never comes up on 5001. It works on my local test with updated Docker image. My understanding is that test does not build Docker files - rather it is using old Docker file in which case this test would not pass until the image is updated. Attaching my local execution log for reference - |
Hi @akhilac1 - thank you for this. The DCO issue is separate from the Docker build and push to registry. For DCO I suggest you do every commit via a |
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.
Hi - just a few things to look at please. thank you for updating all this.
console.log('[error]: --app-port is not set. Re-run dapr run with -p or --app-port.\nUsage: https://docs.dapr.io/getting-started/quickstarts/pubsub-quickstart/\n'); | ||
process.exit(1); | ||
} | ||
const APP_PORT = process.env.APP_PORT || 5001; |
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.
const APP_PORT = process.env.APP_PORT || 5001; | |
const APP_PORT = process.env.APP_PORT ?? '5001'; |
Prefer we use ?? operator which covers more cases for false that come up in Javascript. I. believe we want port to be a string too.
@@ -32,4 +30,4 @@ def multiply(): | |||
print(f"Calculating {operand_one} * {operand_two}", flush=True) | |||
return jsonify(math.ceil(operand_one * operand_two * 100000)/100000) | |||
|
|||
app.run(port=appPort) | |||
app.run(host="0.0.0.0",port=appPort) |
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.
Why do we need "0.0.0.0" host ip?
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.
@paulyuk - to make the value being used explicit.
@@ -37,4 +35,4 @@ def multiply(): | |||
print(f"Calculating {operand_one} * {operand_two}", flush=True) | |||
return jsonify(math.ceil(operand_one * operand_two * 100000)/100000) | |||
|
|||
app.run(port) | |||
app.run(host="0.0.0.0",port=port) |
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.
Just checking we need to set host?
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.
@paulyuk - It is not mandatory. This makes the value being used explicit.
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.
@akhilac1 ok, I just want to make sure that still works in a few environments that might have benefited from defaults. E.g. have you tried this on Windows, WSL, and Mac? have you tried with Ipv6?
The other way to ask is are we fixing a problem with this change? if not we might have lower risk of regressions by not making the change, since this has worked this way for a few years.
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 said, I'll take it and let's monitor
Co-authored-by: Paul Yuknewicz <paulyuk@microsoft.com>
Co-authored-by: Paul Yuknewicz <paulyuk@microsoft.com>
Co-authored-by: Paul Yuknewicz <paulyuk@microsoft.com>
Co-authored-by: Paul Yuknewicz <paulyuk@microsoft.com>
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.
LGTM
Tests are all clean except for Validate Tutorials which is expected. I'm merging. |
Signed-off-by: akhilac1 chetlapalle.akhila@gmail.com
Description
Issue reference
We strive to have all PRs being opened based on an issue, where the problem or feature have been discussed prior to implementation.
Please reference the issue this PR will close: #682
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: