From 3dd8edee51a7d9f0202182a214126e8b9f4117d8 Mon Sep 17 00:00:00 2001 From: joshvanl Date: Tue, 19 Dec 2023 16:40:55 +0000 Subject: [PATCH 1/6] Component Hot Reloading Adds documentation for Component Hot Reloading Part of https://github.com/dapr/dapr/issues/1172 Signed-off-by: joshvanl --- daprdocs/content/en/concepts/components-concept.md | 8 ++++++++ .../en/operations/support/support-preview-features.md | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/daprdocs/content/en/concepts/components-concept.md b/daprdocs/content/en/concepts/components-concept.md index b7248d65684..98668207690 100644 --- a/daprdocs/content/en/concepts/components-concept.md +++ b/daprdocs/content/en/concepts/components-concept.md @@ -52,6 +52,14 @@ For example: For more information read [Pluggable components overview]({{< ref "pluggable-components-overview" >}}) +## Hot Reloading + +With the [`HotReload` feature enabled]({{< ref "support-preview-features.md" >}}), Components are able to be "hot reloaded" at runtime. +This means that you can update component configuration without restarting the Dapr runtime. +Component reloading happens when a Component resource is created, updated, or deleted, either in the Kubernetes API or in Self Hosted mode when a file is changed in the `resources` directory. +When a component is updated, the Component is first closed, and then reinitialized using the new configuration. +There will be a short period of time where the component is unavailable during the duration of the reload until the component is reinitialized. + ## Available component types The following are the component types provided by Dapr: diff --git a/daprdocs/content/en/operations/support/support-preview-features.md b/daprdocs/content/en/operations/support/support-preview-features.md index 9c9fff69010..b62ea901e40 100644 --- a/daprdocs/content/en/operations/support/support-preview-features.md +++ b/daprdocs/content/en/operations/support/support-preview-features.md @@ -22,4 +22,4 @@ For CLI there is no explicit opt-in, just the version that this was first made a | **Service invocation for non-Dapr endpoints** | Allow the invocation of non-Dapr endpoints by Dapr using the [Service invocation API]({{< ref service_invocation_api.md >}}). Read ["How-To: Invoke Non-Dapr Endpoints using HTTP"]({{< ref howto-invoke-non-dapr-endpoints.md >}}) for more information. | N/A | [Service invocation API]({{< ref service_invocation_api.md >}}) | v1.11 | | **Actor State TTL** | Allow actors to save records to state stores with Time To Live (TTL) set to automatically clean up old data. In its current implementation, actor state with TTL may not be reflected correctly by clients, read [Actor State Transactions]({{< ref actors_api.md >}}) for more information. | `ActorStateTTL` | [Actor State Transactions]({{< ref actors_api.md >}}) | v1.11 | | **Transactional Outbox** | Allows state operations for inserts and updates to be published to a configured pub/sub topic using a single transaction across the state store and the pub/sub | N/A | [Transactional Outbox Feature]({{< ref howto-outbox.md >}}) | v1.12 | - +| ** Component Hot Reloading** | Allows for dapr loaded Components to be "hot reloaded". A Component spec will be reloaded when it is created/updated/deleted in Kubernetes or on file when running in Self Hosted mode.| N/A | [Hot Reloading]({{< ref components-concept.md >}}) | v1.13 | From 1a24364b3484e150ee7e4e47df9d8c4c78c3a920 Mon Sep 17 00:00:00 2001 From: Josh van Leeuwen Date: Tue, 9 Jan 2024 13:37:19 +0000 Subject: [PATCH 2/6] Apply suggestions from code review Co-authored-by: Mark Fussell Signed-off-by: Josh van Leeuwen --- daprdocs/content/en/concepts/components-concept.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/daprdocs/content/en/concepts/components-concept.md b/daprdocs/content/en/concepts/components-concept.md index 98668207690..48365186d26 100644 --- a/daprdocs/content/en/concepts/components-concept.md +++ b/daprdocs/content/en/concepts/components-concept.md @@ -54,11 +54,11 @@ For more information read [Pluggable components overview]({{< ref "pluggable-com ## Hot Reloading -With the [`HotReload` feature enabled]({{< ref "support-preview-features.md" >}}), Components are able to be "hot reloaded" at runtime. +With the [`HotReload` feature enabled]({{< ref "support-preview-features.md" >}}), components are able to be "hot reloaded" at runtime. This means that you can update component configuration without restarting the Dapr runtime. -Component reloading happens when a Component resource is created, updated, or deleted, either in the Kubernetes API or in Self Hosted mode when a file is changed in the `resources` directory. +Component reloading happens when a component resource is created, updated, or deleted, either in the Kubernetes API or in Self Hosted mode when a file is changed in the `resources` directory. When a component is updated, the Component is first closed, and then reinitialized using the new configuration. -There will be a short period of time where the component is unavailable during the duration of the reload until the component is reinitialized. +There is a short period of time where the component is unavailable during the duration of the reload until the component is reinitialized. ## Available component types From 7271911f32d0e83101f55f2e2fb9e4426f83a66f Mon Sep 17 00:00:00 2001 From: Josh van Leeuwen Date: Tue, 9 Jan 2024 13:37:50 +0000 Subject: [PATCH 3/6] Update daprdocs/content/en/concepts/components-concept.md Co-authored-by: Mark Fussell Signed-off-by: Josh van Leeuwen --- daprdocs/content/en/concepts/components-concept.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daprdocs/content/en/concepts/components-concept.md b/daprdocs/content/en/concepts/components-concept.md index 48365186d26..db5122e0a93 100644 --- a/daprdocs/content/en/concepts/components-concept.md +++ b/daprdocs/content/en/concepts/components-concept.md @@ -57,7 +57,7 @@ For more information read [Pluggable components overview]({{< ref "pluggable-com With the [`HotReload` feature enabled]({{< ref "support-preview-features.md" >}}), components are able to be "hot reloaded" at runtime. This means that you can update component configuration without restarting the Dapr runtime. Component reloading happens when a component resource is created, updated, or deleted, either in the Kubernetes API or in Self Hosted mode when a file is changed in the `resources` directory. -When a component is updated, the Component is first closed, and then reinitialized using the new configuration. +When a component is updated, the component is first closed, and then reinitialized using the new configuration. There is a short period of time where the component is unavailable during the duration of the reload until the component is reinitialized. ## Available component types From d00938488cc1d624dcbacd50c7a655cb703f39b2 Mon Sep 17 00:00:00 2001 From: joshvanl Date: Tue, 9 Jan 2024 14:13:55 +0000 Subject: [PATCH 4/6] Update compoents-updates.md with hot reloading feature Signed-off-by: joshvanl --- .../en/operations/components/component-updates.md | 15 ++++++++++++--- .../support/support-preview-features.md | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/daprdocs/content/en/operations/components/component-updates.md b/daprdocs/content/en/operations/components/component-updates.md index 583eee28e21..eb5c51ef413 100644 --- a/daprdocs/content/en/operations/components/component-updates.md +++ b/daprdocs/content/en/operations/components/component-updates.md @@ -6,18 +6,27 @@ weight: 300 description: "Updating deployed components used by applications" --- -When making an update to an existing deployed component used by an application, Dapr does not update the component automatically. The Dapr sidecar needs to be restarted in order to pick up the latest version of the component. How this done depends on the hosting environment. +When making an update to an existing deployed component used by an application, Dapr does not update the component automatically unless the `HotReload` feature gate is enabled. +The Dapr sidecar needs to be restarted in order to pick up the latest version of the component. +How this done depends on the hosting environment. + +{{% alert title="Note" color="primary" %}} +Dapr can be made to "hot reload" components where updates will be picked up automatically without needing a restart. +This is enabled by via the [`HotReload` feature gate]({{< ref "support-preview-features.md" >}}). +All component types are supported for hot reloading. +This feature is currently in preview. +{{% /alert %}} ## Kubernetes When running in Kubernetes, the process of updating a component involves two steps: 1. Applying the new component YAML to the desired namespace -2. Performing a [rollout restart operation](https://kubernetes.io/docs/reference/kubectl/cheatsheet/#updating-resources) on your deployments to pick up the latest component +2. (Unless the [`HotReload` feature gate is enabled]({{< ref "support-preview-features.md" >}})), perform a [rollout restart operation](https://kubernetes.io/docs/reference/kubectl/cheatsheet/#updating-resources) on your deployments to pick up the latest component ## Self Hosted -When running in Self Hosted mode, the process of updating a component involves a single step of stopping the `daprd` process and starting it again to pick up the latest component. +Unless the [`HotReload` feature gate is enabled]({{< ref "support-preview-features.md" >}}), the process of updating a component involves a single step of stopping the `daprd` process and starting it again to pick up the latest component. ## Further reading - [Components concept]({{< ref components-concept.md >}}) diff --git a/daprdocs/content/en/operations/support/support-preview-features.md b/daprdocs/content/en/operations/support/support-preview-features.md index b62ea901e40..c960c2e5f19 100644 --- a/daprdocs/content/en/operations/support/support-preview-features.md +++ b/daprdocs/content/en/operations/support/support-preview-features.md @@ -22,4 +22,4 @@ For CLI there is no explicit opt-in, just the version that this was first made a | **Service invocation for non-Dapr endpoints** | Allow the invocation of non-Dapr endpoints by Dapr using the [Service invocation API]({{< ref service_invocation_api.md >}}). Read ["How-To: Invoke Non-Dapr Endpoints using HTTP"]({{< ref howto-invoke-non-dapr-endpoints.md >}}) for more information. | N/A | [Service invocation API]({{< ref service_invocation_api.md >}}) | v1.11 | | **Actor State TTL** | Allow actors to save records to state stores with Time To Live (TTL) set to automatically clean up old data. In its current implementation, actor state with TTL may not be reflected correctly by clients, read [Actor State Transactions]({{< ref actors_api.md >}}) for more information. | `ActorStateTTL` | [Actor State Transactions]({{< ref actors_api.md >}}) | v1.11 | | **Transactional Outbox** | Allows state operations for inserts and updates to be published to a configured pub/sub topic using a single transaction across the state store and the pub/sub | N/A | [Transactional Outbox Feature]({{< ref howto-outbox.md >}}) | v1.12 | -| ** Component Hot Reloading** | Allows for dapr loaded Components to be "hot reloaded". A Component spec will be reloaded when it is created/updated/deleted in Kubernetes or on file when running in Self Hosted mode.| N/A | [Hot Reloading]({{< ref components-concept.md >}}) | v1.13 | +| **Component Hot Reloading** | Allows for dapr loaded Components to be "hot reloaded". A Component spec will be reloaded when it is created/updated/deleted in Kubernetes or on file when running in Self-hosted mode.| `HotReload`| [Hot Reloading]({{< ref components-concept.md >}}) | v1.13 | From afec1f1d58780f9ecc2a996b716a52849d86ecb5 Mon Sep 17 00:00:00 2001 From: Josh van Leeuwen Date: Thu, 11 Jan 2024 11:52:36 +0000 Subject: [PATCH 5/6] Apply suggestions from code review Co-authored-by: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com> Signed-off-by: Josh van Leeuwen --- daprdocs/content/en/concepts/components-concept.md | 4 ++-- .../content/en/operations/components/component-updates.md | 8 ++++---- .../en/operations/support/support-preview-features.md | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/daprdocs/content/en/concepts/components-concept.md b/daprdocs/content/en/concepts/components-concept.md index db5122e0a93..cb2f9e7ec51 100644 --- a/daprdocs/content/en/concepts/components-concept.md +++ b/daprdocs/content/en/concepts/components-concept.md @@ -56,9 +56,9 @@ For more information read [Pluggable components overview]({{< ref "pluggable-com With the [`HotReload` feature enabled]({{< ref "support-preview-features.md" >}}), components are able to be "hot reloaded" at runtime. This means that you can update component configuration without restarting the Dapr runtime. -Component reloading happens when a component resource is created, updated, or deleted, either in the Kubernetes API or in Self Hosted mode when a file is changed in the `resources` directory. +Component reloading occurs when a component resource is created, updated, or deleted, either in the Kubernetes API or in self-hosted mode when a file is changed in the `resources` directory. When a component is updated, the component is first closed, and then reinitialized using the new configuration. -There is a short period of time where the component is unavailable during the duration of the reload until the component is reinitialized. +The component is unavailable for a short period of time during reload and reinitialization. ## Available component types diff --git a/daprdocs/content/en/operations/components/component-updates.md b/daprdocs/content/en/operations/components/component-updates.md index eb5c51ef413..7f6dd50780e 100644 --- a/daprdocs/content/en/operations/components/component-updates.md +++ b/daprdocs/content/en/operations/components/component-updates.md @@ -8,7 +8,7 @@ description: "Updating deployed components used by applications" When making an update to an existing deployed component used by an application, Dapr does not update the component automatically unless the `HotReload` feature gate is enabled. The Dapr sidecar needs to be restarted in order to pick up the latest version of the component. -How this done depends on the hosting environment. +How this is done depends on the hosting environment. {{% alert title="Note" color="primary" %}} Dapr can be made to "hot reload" components where updates will be picked up automatically without needing a restart. @@ -21,12 +21,12 @@ This feature is currently in preview. When running in Kubernetes, the process of updating a component involves two steps: -1. Applying the new component YAML to the desired namespace -2. (Unless the [`HotReload` feature gate is enabled]({{< ref "support-preview-features.md" >}})), perform a [rollout restart operation](https://kubernetes.io/docs/reference/kubectl/cheatsheet/#updating-resources) on your deployments to pick up the latest component +1. Apply the new component YAML to the desired namespace +1. Unless the [`HotReload` feature gate is enabled]({{< ref "support-preview-features.md" >}}), perform a [rollout restart operation](https://kubernetes.io/docs/reference/kubectl/cheatsheet/#updating-resources) on your deployments to pick up the latest component ## Self Hosted -Unless the [`HotReload` feature gate is enabled]({{< ref "support-preview-features.md" >}}), the process of updating a component involves a single step of stopping the `daprd` process and starting it again to pick up the latest component. +Unless the [`HotReload` feature gate is enabled]({{< ref "support-preview-features.md" >}}), the process of updating a component involves a single step of stopping and restarting the `daprd` process to pick up the latest component. ## Further reading - [Components concept]({{< ref components-concept.md >}}) diff --git a/daprdocs/content/en/operations/support/support-preview-features.md b/daprdocs/content/en/operations/support/support-preview-features.md index c960c2e5f19..cd7fa499181 100644 --- a/daprdocs/content/en/operations/support/support-preview-features.md +++ b/daprdocs/content/en/operations/support/support-preview-features.md @@ -22,4 +22,4 @@ For CLI there is no explicit opt-in, just the version that this was first made a | **Service invocation for non-Dapr endpoints** | Allow the invocation of non-Dapr endpoints by Dapr using the [Service invocation API]({{< ref service_invocation_api.md >}}). Read ["How-To: Invoke Non-Dapr Endpoints using HTTP"]({{< ref howto-invoke-non-dapr-endpoints.md >}}) for more information. | N/A | [Service invocation API]({{< ref service_invocation_api.md >}}) | v1.11 | | **Actor State TTL** | Allow actors to save records to state stores with Time To Live (TTL) set to automatically clean up old data. In its current implementation, actor state with TTL may not be reflected correctly by clients, read [Actor State Transactions]({{< ref actors_api.md >}}) for more information. | `ActorStateTTL` | [Actor State Transactions]({{< ref actors_api.md >}}) | v1.11 | | **Transactional Outbox** | Allows state operations for inserts and updates to be published to a configured pub/sub topic using a single transaction across the state store and the pub/sub | N/A | [Transactional Outbox Feature]({{< ref howto-outbox.md >}}) | v1.12 | -| **Component Hot Reloading** | Allows for dapr loaded Components to be "hot reloaded". A Component spec will be reloaded when it is created/updated/deleted in Kubernetes or on file when running in Self-hosted mode.| `HotReload`| [Hot Reloading]({{< ref components-concept.md >}}) | v1.13 | +| **Component Hot Reloading** | Allows for Dapr-loaded components to be "hot reloaded". A component spec is reloaded when it is created/updated/deleted in Kubernetes or on file when running in self-hosted mode.| `HotReload`| [Hot Reloading]({{< ref components-concept.md >}}) | v1.13 | From be597e9b356713dcbbf7f26d668411bbf383fb20 Mon Sep 17 00:00:00 2001 From: Josh van Leeuwen Date: Thu, 11 Jan 2024 11:52:51 +0000 Subject: [PATCH 6/6] Update daprdocs/content/en/operations/components/component-updates.md Co-authored-by: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com> Signed-off-by: Josh van Leeuwen --- daprdocs/content/en/operations/components/component-updates.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daprdocs/content/en/operations/components/component-updates.md b/daprdocs/content/en/operations/components/component-updates.md index 7f6dd50780e..fb8a9313ce6 100644 --- a/daprdocs/content/en/operations/components/component-updates.md +++ b/daprdocs/content/en/operations/components/component-updates.md @@ -11,7 +11,7 @@ The Dapr sidecar needs to be restarted in order to pick up the latest version of How this is done depends on the hosting environment. {{% alert title="Note" color="primary" %}} -Dapr can be made to "hot reload" components where updates will be picked up automatically without needing a restart. +Dapr can be made to "hot reload" components, where updates are picked up automatically without needing a restart. This is enabled by via the [`HotReload` feature gate]({{< ref "support-preview-features.md" >}}). All component types are supported for hot reloading. This feature is currently in preview.