-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[containerapp] Add support to initialize Dapr components #6857
[containerapp] Add support to initialize Dapr components #6857
Conversation
|
rule | cmd_name | rule_message | suggest_message |
---|---|---|---|
containerapp env dapr-component init | cmd containerapp env dapr-component init added |
Hi @shubham1172, |
containerapp |
Please fix CI issues. |
Thanks @yonzhan, done! |
Signed-off-by: Shubham Sharma <[email protected]>
Signed-off-by: Shubham Sharma <[email protected]>
; Signed-off-by: Shubham Sharma <[email protected]>
g Signed-off-by: Shubham Sharma <[email protected]>
Signed-off-by: Shubham Sharma <[email protected]>
Signed-off-by: Shubham Sharma <[email protected]>
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 @Juliehzl Could you help to review this PR?
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
Signed-off-by: Shubham Sharma <[email protected]>
Signed-off-by: Shubham Sharma <[email protected]>
Signed-off-by: Shubham Sharma <[email protected]>
@shubham1172 Please resolve the conflict |
Signed-off-by: Shubham Sharma <[email protected]>
@@ -389,6 +389,18 @@ | |||
az containerapp env certificate delete -g MyResourceGroup --name MyEnvironment --thumbprint MyCertificateThumbprint | |||
""" | |||
|
|||
helps['containerapp env dapr-component init'] = """ | |||
type: command | |||
short-summary: Initializes Dapr components and dev services for an environment. |
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.
Initializes -> Initialize
to align with other commands
@@ -66,6 +66,10 @@ def load_arguments(self, _): | |||
c.argument('managed_certificates_only', options_list=['--managed-certificates-only', '-m'], help='List managed certificates only.') | |||
c.argument('private_key_certificates_only', options_list=['--private-key-certificates-only', '-p'], help='List private-key certificates only.') | |||
|
|||
with self.argument_context('containerapp env dapr-component init') as c: | |||
c.argument('statestore', help="The state store component and dev service to create.") |
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 use argument --state-store which will be easy to view for customer like what we do for most arguments? For arguments with multiple words should be separated with -
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, for users coming from the Dapr world, they will be more familiar with statestore
and pubsub
. Also please check #6857 (comment)
@@ -66,6 +66,10 @@ def load_arguments(self, _): | |||
c.argument('managed_certificates_only', options_list=['--managed-certificates-only', '-m'], help='List managed certificates only.') | |||
c.argument('private_key_certificates_only', options_list=['--private-key-certificates-only', '-p'], help='List private-key certificates only.') | |||
|
|||
with self.argument_context('containerapp env dapr-component init') as c: | |||
c.argument('statestore', help="The state store component and dev service to create.") | |||
c.argument('pubsub', help="The pubsub component and dev service to create.") |
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.
should --pub-sub be easy to understand for customer?
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.
Same as above
This PR adds support to initialize dapr-components in a containerapps environment for development purpose, and introduces a new command -
az containerapp env dapr-component init
.Sample code to try out this feature: https://github.com/shubham1172/aca-dapr-example
Behaviour overview:
dapr-component init
(DCI) on a fresh ContainerApps environment, it creates the dev service and Dapr component with a binding to the dev service.Screenshots
Help text:
Running the command on a fresh containerapps:
Running the command, a second time:
Running the command when a Dapr component already exists (user created):
Statestore component definition, created by init command:
This checklist is used to make sure that common guidelines for a pull request are followed.
Related command
az containerapp env dapr-component
General Guidelines
azdev style <YOUR_EXT>
locally? (pip install azdev
required)python scripts/ci/test_index.py -q
locally? (pip install wheel==0.30.0
required)FYI to run
azdev test
, had to do the following:For new extensions:
About Extension Publish
There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update
src/index.json
automatically.You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify
src/index.json
.