Skip to content
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

Container Apps Extension: Add Circuit Breaker Support for Dapr Component Resiliency #7228

Merged
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/containerapp/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ upcoming
* 'az containerapp env identity': support for container app environment assign/remove/show commands
* 'az containerapp env storage set': Support create or update managed environment storage with NFS Azure File.
* 'az containerapp up': Update the Docker error string used to identify unauthorized push.
* 'az containerapp env dapr-component resiliency': Add support for Dapr Component Resiliency Circuit Breakers
berndverst marked this conversation as resolved.
Show resolved Hide resolved

0.3.46
++++++
Expand Down
10 changes: 10 additions & 0 deletions src/containerapp/azext_containerapp/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,11 @@
"maxIntervalInMilliseconds": None,
}
},
"circuitBreakerPolicy": {
"consecutiveErrors": None,
"timeoutInSeconds": None,
"intervalInSeconds": None
}
},
"outboundPolicy": {
"timeoutPolicy": {
Expand All @@ -316,6 +321,11 @@
"maxIntervalInMilliseconds": None,
}
},
"circuitBreakerPolicy": {
"consecutiveErrors": None,
"timeoutInSeconds": None,
"intervalInSeconds": None
}
}
}
}
Expand Down
10 changes: 10 additions & 0 deletions src/containerapp/azext_containerapp/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@ def load_arguments(self, _):
with self.argument_context('containerapp env dapr-component resiliency', arg_group='Inbound Timeout Policy') as c:
c.argument('in_timeout_response_in_seconds', type=int, options_list=['--in-timeout'], help='Specify the response timeout in seconds for the inbound policy. This spans between the point at which the entire request has been processed and when the response has been completely processed. This timeout includes all retries.')

with self.argument_context('containerapp env dapr-component resiliency', arg_group='Inbound Circuit Breaker Policy') as c:
c.argument('in_circuit_breaker_consecutive_errors', type=int, options_list=['--in-cb-sequential-err'], help='The number of consecutive errors before the circuit is opened.')
c.argument('in_circuit_breaker_interval', type=int, options_list=['--in-cb-interval'], help='The optional interval in seconds after which the error count resets to 0. An interval of 0 will never reset. If not specified, the timeout value will be used.')
c.argument('in_circuit_breaker_timeout', type=int, options_list=['--in-cb-timeout'], help='The interval in seconds until a retry attempt is made after the circuit is opened.')

with self.argument_context('containerapp env dapr-component resiliency', arg_group='Outbound HTTP Retry Policy') as c:
c.argument('out_http_retry_max', type=int, options_list=['--out-http-retries'], help='Specify the max number of retries for the outbound policy. Default: 3.')
c.argument('out_http_retry_delay_in_milliseconds', type=int, options_list=['--out-http-delay'], help='Specify the base interval in milliseconds between retries for the outbound policy. Default: 1000.')
Expand All @@ -158,6 +163,11 @@ def load_arguments(self, _):
with self.argument_context('containerapp env dapr-component resiliency', arg_group='Outbound Timeout Policy') as c:
c.argument('out_timeout_response_in_seconds', type=int, options_list=['--out-timeout'], help='Specify the response timeout in seconds for the outbound policy. This spans between the point at which the entire request has been processed and when the response has been completely processed. This timeout includes all retries.')

with self.argument_context('containerapp env dapr-component resiliency', arg_group='Outbound Circuit Breaker Policy') as c:
c.argument('out_circuit_breaker_consecutive_errors', type=int, options_list=['--out-cb-sequential-err'], help='The number of consecutive errors before the circuit is opened.')
c.argument('out_circuit_breaker_interval', type=int, options_list=['--out-cb-interval'], help='The optional interval in seconds after which the error count resets to 0. An interval of 0 will never reset. If not specified, the timeout value will be used.')
c.argument('out_circuit_breaker_timeout', type=int, options_list=['--out-cb-timeout'], help='The interval in seconds until a retry attempt is made after the circuit is opened.')

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.")
Expand Down
16 changes: 14 additions & 2 deletions src/containerapp/azext_containerapp/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,13 @@ def create_dapr_component_resiliency(cmd, name, resource_group_name, dapr_compon
in_http_retry_delay_in_milliseconds=None,
out_http_retry_delay_in_milliseconds=None,
in_http_retry_interval_in_milliseconds=None,
out_http_retry_interval_in_milliseconds=None):
out_http_retry_interval_in_milliseconds=None,
in_circuit_breaker_consecutive_errors=None,
out_circuit_breaker_consecutive_errors=None,
in_circuit_breaker_interval=None,
out_circuit_breaker_interval=None,
in_circuit_breaker_timeout=None,
out_circuit_breaker_timeout=None):
raw_parameters = locals()
component_resiliency_create_decorator = DaprComponentResiliencyPreviewCreateDecorator(
cmd=cmd,
Expand All @@ -330,7 +336,13 @@ def update_dapr_component_resiliency(cmd, name, resource_group_name, dapr_compon
in_http_retry_delay_in_milliseconds=None,
out_http_retry_delay_in_milliseconds=None,
in_http_retry_interval_in_milliseconds=None,
out_http_retry_interval_in_milliseconds=None):
out_http_retry_interval_in_milliseconds=None,
in_circuit_breaker_consecutive_errors=None,
out_circuit_breaker_consecutive_errors=None,
in_circuit_breaker_interval=None,
out_circuit_breaker_interval=None,
in_circuit_breaker_timeout=None,
out_circuit_breaker_timeout=None):

raw_parameters = locals()
component_resiliency_update_decorator = DaprComponentResiliencyPreviewUpdateDecorator(
Expand Down
Loading
Loading