-
Notifications
You must be signed in to change notification settings - Fork 34
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
enhance dapr run
to run multiple applications
#6
Conversation
Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
Open QuestionShould So the command becomes dapr project up We will have a |
0003-I-dapr-compose.md
Outdated
|
||
Users developing different apps using dapr will have different resources/configurations that they use per application. Each time the user has to run the application with a particular config and resources directory value, they have to override the flag for `dapr run` command. | ||
|
||
Instead the following convention is proposed for loading the resources/config for an application. |
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.
Since this is about usage during development, if an app is part of a repo, too many transient files will be created. It would be good to give the user an option to set the root directory via an ENVIRONMENT VARIABLE
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.
Could you explain this part @akhilac1?
0003-I-dapr-compose.md
Outdated
|
||
### Constraints | ||
|
||
`compose` should mimic what `run` does for the most part. The defaults should not be different from `run` command with any new configuration options having sane documented least permissions based defaults. |
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.
Assuming default values will be provided for attributes like DAPR_HTTP_PORT, what is the mechanism for the user to identify this port, so that they could execute a HTTP request etc.? It would be good to document user experience for interacting with daprd launched with compose
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.
We should be mounting these env vars on the user process.
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.
Both DAPR_HTTP_PORT and DAPR_GRPC_PORT will be passed as env vars. I do not think metrics is port is needed inside the app, that can be part of the dapr compose
output?
0003-I-dapr-compose.md
Outdated
|
||
The logs will be as shown above, it will be chaotic to see what application is in which state and so on. | ||
|
||
Instead of writing to STDOUT, each application and associated `daprd` process will write the logs to `{application dir}/.dapr/logs/{app id}/app_{datetime}.log`, `{application dir}/.dapr/logs/{app id}/daprd_{datetime}.log`. |
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.
Is the user expected to look at the latest log to get the key attributes like DAPR HTTP PORT? This does not seem to be a good experience. Can you please check if key attributes required for the user to interact with Dapr and available as output of the dapr compose command?
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.
Agreed ... That is what I was thinking as well.
@dapr/maintainers-cli Putting this on your radar for 1.10 |
0003-I-dapr-compose.md
Outdated
|
||
### Recommendation for 1.10 | ||
|
||
- Initial implementation will only support Linux OS. |
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.
- Initial implementation will only support Linux OS. | |
- Initial implementation will only support Linux OS. |
This should support both MacOS and Linux OS
0003-I-dapr-compose.md
Outdated
|
||
### Constraints | ||
|
||
`compose` should mimic what `run` does for the most part. The defaults should not be different from `run` command with any new configuration options having sane documented least permissions based defaults. |
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.
We should be mounting these env vars on the user process.
0003-I-dapr-compose.md
Outdated
|
||
### Why dapr CLI? | ||
|
||
From the initial [proposal](https://github.com/dapr/community/issues/207), the solution was proposed as a seprate repo and CLI in itself. But later it was suggested to use dapr CLI itself to have a `compose` command in it instead of a having a separate CLI. |
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.
Using the word compose
has so many connotation to Docker Compose, it leads to think this is only about running container. Given this is about mostly running processes I would use a different word, such as dapr start
which carries not baggage and is clearer IMO
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 only concern that I have here is, we would have too many start
related commands.
dapr init
, dapr start
, dapr run
.
Also dapr start
does in no way convey that it is a command to start multiple apps in a single go.
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.
dapr up
?
0003-I-dapr-compose.md
Outdated
|
||
### Subcommands and flags for `compose` command in CLI | ||
|
||
It is proposed to have a subcommand `up` in `compose` command to _bring up_ all the applications and daprd sidecars. Later on an extension can be added to _shutdown all_ application and sidecars with a `down` subcommand. |
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 introduce the 'up' command and simply have just compose
to start all the applications?
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.
This was mostly following the same way docker compose
, it will be familiar to the users.
@yaron2 @artursouza @msfussell Based on the offline discussion that we had, we tentatively agreed to use Thoughts? |
I'm not concerned with changing the existing command, if the |
I do like the approach of extending the existing |
To summarize, the proposal should be modified to
@yaron2 @msfussell @artursouza |
LGTM. |
Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
dapr run
to run multiple applications
Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
+1 binding |
1 similar comment
+1 binding |
Agreed. LGTM |
Signed-off-by: Mukundan Sundararajan 65565396+mukundansundar@users.noreply.github.com