Skip to content

Commit

Permalink
Merge branch 'issue_3868' of https://github.com/hhunter-ms/docs into …
Browse files Browse the repository at this point in the history
…issue_3868
  • Loading branch information
hhunter-ms committed Feb 20, 2024
2 parents b9a8038 + e36ecc1 commit 43dd7f7
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ await daprClient.PurgeWorkflowAsync(orderId, workflowComponent);
<!--Java-->
{{% codetab %}}

Manage your workflow within your code. [In the workflow example from the Java SDK](https://github.com/dapr/java-sdk/blob/master/examples/src/main/java/io/dapr/examples/workflows/DemoWorkflowClient.java), the workflow is registered in the code using the following APIs:
Manage your workflow within your code. [In the workflow example from the Java SDK](https://github.com/dapr/java-sdk/blob/master/examples/src/main/java/io/dapr/examples/workflows/), the workflow is registered in the code using the following APIs:

- **scheduleNewWorkflow**: Starts a new workflow instance
- **getInstanceState**: Get information on the status of the workflow
Expand Down Expand Up @@ -394,6 +394,6 @@ Learn more about these HTTP calls in the [workflow API reference guide]({{< ref
- [JavaScript example](https://github.com/dapr/js-sdk/tree/main/examples/workflow)
- [.NET example](https://github.com/dapr/dotnet-sdk/tree/master/examples/Workflow)
- [Java example](https://github.com/dapr/java-sdk/tree/master/examples/src/main/java/io/dapr/examples/workflows)
- [Go example](todo)
- [Go example](https://github.com/dapr/go-sdk/tree/main/examples/workflow)

- [Workflow API reference]({{< ref workflow_api.md >}})
42 changes: 30 additions & 12 deletions daprdocs/content/en/operations/components/component-updates.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,45 @@ 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 unless the `HotReload` feature gate is enabled.
When making an update to an existing deployed component used by an application, Dapr does not update the component automatically unless the [`HotReload`](#hot-reloading-preview-feature) feature gate is enabled.
The Dapr sidecar needs to be restarted in order to pick up the latest version of the component.
How this is done depends on the hosting environment.

{{% alert title="Note" color="primary" %}}
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.
{{% /alert %}}

## Kubernetes
### Kubernetes

When running in Kubernetes, the process of updating a component involves two steps:

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
1. Unless the [`HotReload` feature gate is enabled](#hot-reloading-preview-feature), 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](#hot-reloading-preview-feature), the process of updating a component involves a single step of stopping and restarting the `daprd` process to pick up the latest component.

## Hot Reloading (Preview Feature)

## Self Hosted
> This feature is currently in [preview]({{< ref "preview-features.md" >}}).
> Hot reloading is enabled by via the [`HotReload` feature gate]({{< ref "support-preview-features.md" >}}).
Dapr can be made to "hot reload" components whereby component updates are picked up automatically without the need to restart the Dapr sidecar process or Kubernetes pod.
This means creating, updating, or deleting a component manifest will be reflected in the Dapr sidecar during runtime.

{{% alert title="Updating Components" color="warning" %}}
When a component is updated it is first closed, and then re-initialized using the new configuration.
This causes the component to be unavailable for a short period of time during this process.
{{% /alert %}}

{{% alert title="Initialization Errors" color="warning" %}}
If the initialization processes errors when a component is created or updated through hot reloading, the Dapr sidecar respects the component field [`spec.ignoreErrors`]({{< ref component-schema.md>}}).
That is, the behaviour is the same as when the sidecar loads components on boot.
- `spec.ignoreErrors=false` (*default*): the sidecar gracefully shuts down.
- `spec.ignoreErrors=true`: the sidecar continues to run with neither the old or new component configuration registered.
{{% /alert %}}

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.
All components are supported for hot reloading except for the following types.
Any create, update, or deletion of these component types is ignored by the sidecar with a restart required to pick up changes.
- [Actor State Stores]({{< ref "state_api.md#configuring-state-store-for-actors" >}})
- [Workflow Backends]({{< ref "workflow-architecture.md#workflow-backend" >}})

## Further reading
- [Components concept]({{< ref components-concept.md >}})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 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 |
| **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. Ignores changes to actor state stores and workflow backends. | `HotReload`| [Hot Reloading]({{< ref components-concept.md >}}) | v1.13 |

0 comments on commit 43dd7f7

Please sign in to comment.