-
Notifications
You must be signed in to change notification settings - Fork 209
Correct env variables passed to child applications #770
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
Conversation
|
@yaron2 PTAL If you don't see the refactor is necessary, I can revert it |
|
@yaron2 I see the failed tests regarding to arguments Question: if the port is not set, do we need to assign it with a free port? See line https://github.com/dapr/cli/blob/master/pkg/standalone/run.go#L103 |
|
Tests are failing |
@yaron2 Pls answer my question above #770 (comment) |
@anhldbk For this scenario no we should not be setting it using Freeport since then daprd will be waiting for the port to be active to communicate with the application. This port is used for daprd to app communication and if that is not needed and only the app communicates with dapr, the port will not be specified. See the docs link for the |
|
What scenario is this change enabling? Basically trying to understand why we need to set those via env variables. |
|
@artursouza I noted on the description above.
The root cause is: dapr cli doesn't pass necessary environment variables to child processes. So is it good to make a PR? |
@anhldbk The specific settings that are in global_settings.py are specific to python SDK. They will be processed by the SDK and not by the CLI directly. For the tutorial linked, I am able to run it using dapr CLI and it is working, there is a slight change in the docs that is needed, it is currently having the curl commands as curl http://localhost:3500/v1.0/invoke/cart/method/add -X POSTWhile that is true in general cases, the dapr run command is as follows dapr run --app-id cart --app-port 5000 python app.pyHere the argument for run setting the HTTP PORT for Dapr is not given, hence a random port is selected example: $ dapr run --app-id cart --app-port 5000 python app.py
ℹ️ Starting Dapr with id cart. HTTP Port: 55738. gRPC Port: 55739The tutorial then says run curl http://localhost:3500/v1.0/invoke/cart/method/add -X POST
curl: (7) Failed to connect to localhost port 3500: Connection refusedwhich fails with the above failure. But if the CLI is used to invoke the method as shown in the CLI tab in the tutorial, it works as expected. if it is run with dapr run --app-id cart --app-port 5000 -H 3500 python app.py
ℹ️ Starting Dapr with id cart. HTTP Port: 3500. gRPC Port: 55798Then the HTTP port is also specified and the curl command also works: $ curl http://localhost:3500/v1.0/invoke/cart/method/add -X POST
Added!I think this is a change that is needed in the docs, specifying the |
|
@mukundansundar I don't think it's specific only to Python SDK. The problem here is:
@yaron2 What do you think? Please comment so I know how to proceed. |
@anhldbk you raise a real issue which is that there are inconsistencies. I think as step 1 we need to document the inconsistencies and then fix them in documentation. If you're willing to help out with this since you seem to have a good knowledge of this, then that'd be great and highly appreciated. After we have a list of inconsistencies we can decide how to tackle it. In general, there are SDK specific env vars that shouldn't be passed to the child app. So I think mapping these out are a must before we continue looking at this PR. |
Yes! Gonna work on |
|
@yaron2 Me again. I updated the docs via: dapr/docs#1835 Gonna improve this PR |
* fix shutdown hang when enable socket Signed-off-by: Loong <loong.dai@intel.com> * feedback Signed-off-by: Loong <loong.dai@intel.com> Co-authored-by: Loong <loong.dai@intel.com> Co-authored-by: Mukundan Sundararajan <musundar@microsoft.com> Signed-off-by: Andy Le <anhldbk@gmail.com>
Signed-off-by: Andy Le <anhldbk@gmail.com>
* Run tests against new hotfix releases * Update e2e test for latest runtime releases Signed-off-by: Andy Le <anhldbk@gmail.com>
Co-authored-by: Mukundan Sundararajan <musundar@microsoft.com> Signed-off-by: Andy Le <anhldbk@gmail.com>
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@gmail.com> Signed-off-by: Andy Le <anhldbk@gmail.com>
Signed-off-by: Andy Le <anhldbk@gmail.com>
Signed-off-by: Andy Le <anhldbk@gmail.com>
Signed-off-by: Andy Le <anhldbk@gmail.com>
This reverts commit 7d02ef6. Signed-off-by: Andy Le <anhldbk@gmail.com>
This reverts commit 73a414a. Signed-off-by: Andy Le <anhldbk@gmail.com>
CLI - Remove arg `place-host-address` Application - Remove env `DAPR_PROFILE_PORT`, `HOST_ADDRESS` - Pass env `APP_PORT` conditionally (if set)
* runtime: support unix domain socket Signed-off-by: Long <long.dai@intel.com> * feedback Signed-off-by: Long <long.dai@intel.com> * update example Signed-off-by: Long <long.dai@intel.com>
Signed-off-by: Long <long0dai@foxmail.com> Signed-off-by: Long <long.dai@intel.com> Signed-off-by: Andy Le <anhldbk@gmail.com>
* Fix upgrade paths to 1.5.0 runtime * Update tests/e2e/standalone/standalone_test.go * Update tests/e2e/standalone/standalone_test.go * Update tests/e2e/standalone/standalone_test.go * Update tests/e2e/standalone/standalone_test.go Co-authored-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
* Publish events with CloudEvent envelope with content type application/cloudevents+json * fix linter issue * Adding e2e test * Tweak
* fix shutdown hang when enable socket Signed-off-by: Loong <loong.dai@intel.com> * feedback Signed-off-by: Loong <loong.dai@intel.com> Co-authored-by: Loong <loong.dai@intel.com> Co-authored-by: Mukundan Sundararajan <musundar@microsoft.com> Signed-off-by: Andy Le <anhldbk@gmail.com>
Signed-off-by: Andy Le <anhldbk@gmail.com>
- In the past, I openned this PR: dapr#770 - DCO had some complaints. - I incorrectly rebased. - This PR is made by forking the master branch, modifying related files
- In the past, I openned this PR: dapr#770 - DCO had some complaints. - I incorrectly rebased. - This PR is made by forking the master branch, modifying related files Signed-off-by: Andy Le <anhldbk@gmail.com>
- In the past, I openned this PR: #770 - DCO had some complaints. - I incorrectly rebased. - This PR is made by forking the master branch, modifying related files Signed-off-by: Andy Le <anhldbk@gmail.com>
- In the past, I openned this PR: dapr#770 - DCO had some complaints. - I incorrectly rebased. - This PR is made by forking the master branch, modifying related files Signed-off-by: Andy Le <anhldbk@gmail.com> Signed-off-by: imneov <grantliu@yunify.com>
Description
not-workingtutorialChecklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: