replace actions with dapr (#58)

* replace actions with dapr

* replace daprrt with daprd
This commit is contained in:
Yaron Schneider 2019-10-04 21:01:50 -07:00 committed by GitHub
parent 20a43f33b7
commit de673ecfea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
25 changed files with 168 additions and 168 deletions

View File

@ -1,11 +1,11 @@
# Debugging and Troubleshooting
This section describes different tools, techniques and common problems to help users debug and diagnose issues with Actions.
This section describes different tools, techniques and common problems to help users debug and diagnose issues with Dapr.
1. [Logs](logs.md)
2. [Tracing and diagnostics](tracing.md)
3. [Profiling and debugging](profiling_debugging.md)
4. [Common issues](common_issues.md)
Please open a new Bug or Feature Request item on our [issues section](https://github.com/actionscore/actions/issues) if you've encountered a problem running Actions.
If a security vulnerability has been found, contact the [Actions team](actionsct@microsoft.com).
Please open a new Bug or Feature Request item on our [issues section](https://github.com/daprcore/dapr/issues) if you've encountered a problem running Dapr.
If a security vulnerability has been found, contact the [Dapr team](daprct@microsoft.com).

View File

@ -2,7 +2,7 @@
This section will walk you through some common issues and problems.
### I don't see the Actions sidecar injected to my pod
### I don't see the Dapr sidecar injected to my pod
There could be several reasons to why a sidecar will not be injected into a pod.
First, check your Deployment or Pod YAML file, and check that you have the following annotations in the right place:
@ -26,33 +26,33 @@ spec:
labels:
app: node
annotations:
<b>actions.io/enabled: "true"</b>
<b>actions.io/id: "nodeapp"</b>
<b>actions.io/port: "3000"</b>
<b>dapr.io/enabled: "true"</b>
<b>dapr.io/id: "nodeapp"</b>
<b>dapr.io/port: "3000"</b>
spec:
containers:
- name: node
image: actionscore.azurecr.io/samples/nodeapp
image: daprcore.azurecr.io/samples/nodeapp
ports:
- containerPort: 3000
imagePullPolicy: Always
</pre>
If your pod spec template is annotated correctly and you still don't see the sidecar injected, make sure Actions was deployed to the cluster before your deployment or pod were deployed.
If your pod spec template is annotated correctly and you still don't see the sidecar injected, make sure Dapr was deployed to the cluster before your deployment or pod were deployed.
If this is the case, restarting the pods will fix the issue.
In order to further diagnose any issue, check the logs of the Actions sidecar injector:
In order to further diagnose any issue, check the logs of the Dapr sidecar injector:
```
kubectl logs -l app=actions-sidecar-injector -n actions-system
kubectl logs -l app=dapr-sidecar-injector -n dapr-system
```
*Note: If you installed Actions to a different namespace, replace actions-system above with the desired namespace*
*Note: If you installed Dapr to a different namespace, replace dapr-system above with the desired namespace*
### I am unable to save state or get state
Have you installed an Actions State store in your cluster?
Have you installed an Dapr State store in your cluster?
To check, use kubectl get a list of components:
@ -62,13 +62,13 @@ If there isn't a state store component, it means you need to set one up.
Visit [here](../components/redis.md) for more details.
If everything's set up correctly, make sure you got the credentials right.
Search the Actions runtime logs and look for any state store errors:
Search the Dapr runtime logs and look for any state store errors:
`kubectl logs <name-of-pod> actionsrt`.
`kubectl logs <name-of-pod> daprd`.
### I am unable to publish and receive events
Have you installed an Actions Message Bus in your cluster?
Have you installed an Dapr Message Bus in your cluster?
To check, use kubectl get a list of components:
@ -78,47 +78,47 @@ If there isn't a pub-sub component, it means you need to set one up.
Visit [here](../components/redis.md#configuring-redis-for-pubsub) for more details.
If everything's set up correctly, make sure you got the credentials right.
Search the Actions runtime logs and look for any pub-sub errors:
Search the Dapr runtime logs and look for any pub-sub errors:
`kubectl logs <name-of-pod> actionsrt`.
`kubectl logs <name-of-pod> daprd`.
### The Actions Operator pod keeps crashing
### The Dapr Operator pod keeps crashing
Check that there's only one installation of the Actions Operator in your cluster.
Find out by running `kubectl get pods -l app=actions-operator --all-namespaces`.
Check that there's only one installation of the Dapr Operator in your cluster.
Find out by running `kubectl get pods -l app=dapr-operator --all-namespaces`.
If two pods appear, delete the redundant Actions installation.
If two pods appear, delete the redundant Dapr installation.
### I'm getting 500 Error responses when calling Actions
### I'm getting 500 Error responses when calling Dapr
This means there are some internal issue inside the Actions runtime.
This means there are some internal issue inside the Dapr runtime.
To diagnose, view the logs of the sidecar:
`kubectl logs <name-of-pod> actionsrt`.
`kubectl logs <name-of-pod> daprd`.
### I'm getting 404 Not Found responses when calling Actions
### I'm getting 404 Not Found responses when calling Dapr
This means you're trying to call an Actions API endpoint that either doesn't exist or the URL is malformed.
Look at the Actions API spec [here](https://github.com/actionscore/spec) and make sure you're calling the right endpoint.
This means you're trying to call an Dapr API endpoint that either doesn't exist or the URL is malformed.
Look at the Dapr API spec [here](https://github.com/daprcore/spec) and make sure you're calling the right endpoint.
### I don't see any incoming events or calls from other services
Have you specified the port your app is listening on?
In Kubernetes, make sure the `actions.io/port` annotation is specified:
In Kubernetes, make sure the `dapr.io/port` annotation is specified:
<pre>
annotations:
actions.io/enabled: "true"
actions.io/id: "nodeapp"
<b>actions.io/port: "3000"</b>
dapr.io/enabled: "true"
dapr.io/id: "nodeapp"
<b>dapr.io/port: "3000"</b>
</pre>
If using Actions Standalone and the Actions CLI, make sure you pass the `--app-port` flag to the `actions run` command.
If using Dapr Standalone and the Dapr CLI, make sure you pass the `--app-port` flag to the `dapr run` command.
### My Actions-enabled app isn't behaving correctly
### My Dapr-enabled app isn't behaving correctly
The first thing to do is inspect the HTTP error code returned from the Actions API, if any.
If you still can't find the issue, try enabling `debug` log levels for the Actions runtime. See [here](logs.md) how to do so.
The first thing to do is inspect the HTTP error code returned from the Dapr API, if any.
If you still can't find the issue, try enabling `debug` log levels for the Dapr runtime. See [here](logs.md) how to do so.
You might also want to look at error logs from your own process. If running on Kubernetes, find the pod containing your app, and execute the following:

View File

@ -1,67 +1,67 @@
# Logs
This section will assist you in understanding how logging works in Actions, configuring and viewing logs.
This section will assist you in understanding how logging works in Dapr, configuring and viewing logs.
## Overview
Logs have different, configurable verbosity levels.
The levels outlined below are the same for both system components and the Actions sidecar process/container:
The levels outlined below are the same for both system components and the Dapr sidecar process/container:
1. error
2. warning
3. info
3. debug
error produces the minimum amount of output, where debug produces the maximum amount. The default level is info, which provides a balanced amount of information for operating Actions in normal conditions.
error produces the minimum amount of output, where debug produces the maximum amount. The default level is info, which provides a balanced amount of information for operating Dapr in normal conditions.
To set the output level, you can use the `--log-level` command-line option. For example:
`./actionsrt --log-level error` <br>
`./daprd --log-level error` <br>
`./placement --log-level debug`
This will start the Actions runtime binary with a log level of `error` and the Actions Actor Placement Service with a log level of `debug`.
This will start the Dapr runtime binary with a log level of `error` and the Dapr Actor Placement Service with a log level of `debug`.
## Configuring logs on Standalone Mode
As outlined above, every Actions binary takes a `--log-level` argument. For example, to launch the placement service with a log level of warning:
As outlined above, every Dapr binary takes a `--log-level` argument. For example, to launch the placement service with a log level of warning:
`./placement --log-level warning`
To set the log level when running your app with the Actions CLI, pass the `log-level` param:
To set the log level when running your app with the Dapr CLI, pass the `log-level` param:
`actions run --log-level warning node myapp.js`
`dapr run --log-level warning node myapp.js`
## Viewing Logs on Standalone Mode
When running Actions with the Actions CLI, both your app's log output and the runtime's output will be redirected to the same session, for easy debugging.
For example, this is the output when running Actions:
When running Dapr with the Dapr CLI, both your app's log output and the runtime's output will be redirected to the same session, for easy debugging.
For example, this is the output when running Dapr:
```
actions run node myapp.js
Starting Actions with id Trackgreat-Lancer on port 56730
✅ You're up and running! Both Actions and your app logs will appear here.
dapr run node myapp.js
Starting Dapr with id Trackgreat-Lancer on port 56730
✅ You're up and running! Both Dapr and your app logs will appear here.
== APP == App listening on port 3000!
== ACTIONS == time="2019-09-05T12:26:43-07:00" level=info msg="starting Actions Runtime -- version 0.3.0-alpha -- commit b6f2810-dirty"
== ACTIONS == time="2019-09-05T12:26:43-07:00" level=info msg="log level set to: info"
== ACTIONS == time="2019-09-05T12:26:43-07:00" level=info msg="standalone mode configured"
== ACTIONS == time="2019-09-05T12:26:43-07:00" level=info msg="action id: Trackgreat-Lancer"
== ACTIONS == time="2019-09-05T12:26:43-07:00" level=info msg="loaded component statestore (state.redis)"
== ACTIONS == time="2019-09-05T12:26:43-07:00" level=info msg="loaded component messagebus (pubsub.redis)"
== ACTIONS == 2019/09/05 12:26:43 redis: connecting to localhost:6379
== ACTIONS == 2019/09/05 12:26:43 redis: connected to localhost:6379 (localAddr: [::1]:56734, remAddr: [::1]:6379)
== ACTIONS == time="2019-09-05T12:26:43-07:00" level=warning msg="failed to init input bindings: app channel not initialized"
== ACTIONS == time="2019-09-05T12:26:43-07:00" level=info msg="actor runtime started. actor idle timeout: 1h0m0s. actor scan interval: 30s"
== ACTIONS == time="2019-09-05T12:26:43-07:00" level=info msg="actors: starting connection attempt to placement service at localhost:50005"
== ACTIONS == time="2019-09-05T12:26:43-07:00" level=info msg="http server is running on port 56730"
== ACTIONS == time="2019-09-05T12:26:43-07:00" level=info msg="gRPC server is running on port 56731"
== ACTIONS == time="2019-09-05T12:26:43-07:00" level=info msg="actions initialized. Status: Running. Init Elapsed 8.772922000000001ms"
== ACTIONS == time="2019-09-05T12:26:43-07:00" level=info msg="actors: established connection to placement service at localhost:50005"
== DAPR == time="2019-09-05T12:26:43-07:00" level=info msg="starting Dapr Runtime -- version 0.3.0-alpha -- commit b6f2810-dirty"
== DAPR == time="2019-09-05T12:26:43-07:00" level=info msg="log level set to: info"
== DAPR == time="2019-09-05T12:26:43-07:00" level=info msg="standalone mode configured"
== DAPR == time="2019-09-05T12:26:43-07:00" level=info msg="action id: Trackgreat-Lancer"
== DAPR == time="2019-09-05T12:26:43-07:00" level=info msg="loaded component statestore (state.redis)"
== DAPR == time="2019-09-05T12:26:43-07:00" level=info msg="loaded component messagebus (pubsub.redis)"
== DAPR == 2019/09/05 12:26:43 redis: connecting to localhost:6379
== DAPR == 2019/09/05 12:26:43 redis: connected to localhost:6379 (localAddr: [::1]:56734, remAddr: [::1]:6379)
== DAPR == time="2019-09-05T12:26:43-07:00" level=warning msg="failed to init input bindings: app channel not initialized"
== DAPR == time="2019-09-05T12:26:43-07:00" level=info msg="actor runtime started. actor idle timeout: 1h0m0s. actor scan interval: 30s"
== DAPR == time="2019-09-05T12:26:43-07:00" level=info msg="actors: starting connection attempt to placement service at localhost:50005"
== DAPR == time="2019-09-05T12:26:43-07:00" level=info msg="http server is running on port 56730"
== DAPR == time="2019-09-05T12:26:43-07:00" level=info msg="gRPC server is running on port 56731"
== DAPR == time="2019-09-05T12:26:43-07:00" level=info msg="dapr initialized. Status: Running. Init Elapsed 8.772922000000001ms"
== DAPR == time="2019-09-05T12:26:43-07:00" level=info msg="actors: established connection to placement service at localhost:50005"
```
## Configuring Logs on Kubernetes
This section shows you how to configure the log levels for Actions system pods and the Actions sidecar running on Kubernetes.
This section shows you how to configure the log levels for Dapr system pods and the Dapr sidecar running on Kubernetes.
### Setting the sidecar log level
@ -69,35 +69,35 @@ You can set the log level individually for every sidecar by providing the follow
```
annotations:
actions.io/log-level: "debug"
dapr.io/log-level: "debug"
```
### Setting system pods log level
When deploying Actions to your cluster using Helm, you can individually set the log level for every Actions system component.
When deploying Dapr to your cluster using Helm, you can individually set the log level for every Dapr system component.
#### Setting the Operator log level
`helm install actionscore/actions-operator -n actions --namespace actions-system --set actions_operator.logLevel=error`
`helm install daprcore/dapr-operator -n dapr --namespace dapr-system --set dapr_operator.logLevel=error`
#### Setting the Placement Service log level
`helm install actionscore/actions-placement -n actions --namespace actions-system --set actions_placement.logLevel=error`
`helm install daprcore/dapr-placement -n dapr --namespace dapr-system --set dapr_placement.logLevel=error`
#### Setting the Sidecar Injector log level
`helm install actionscore/actions-sidecar-injector -n actions --namespace actions-system --set actions_sidecar_injector.logLevel=error`
`helm install daprcore/dapr-sidecar-injector -n dapr --namespace dapr-system --set dapr_sidecar_injector.logLevel=error`
## Viewing Logs on Kubernetes
Actions logs are written to stdout and stderr.
This section will guide you on how to view logs for Actions system components as well as the Actions sidecar.
Dapr logs are written to stdout and stderr.
This section will guide you on how to view logs for Dapr system components as well as the Dapr sidecar.
### Sidecar Logs
When deployed in Kubernetes, the Actions sidecar injector will inject an Actions container named `actionsrt` into your annotated pod.
When deployed in Kubernetes, the Dapr sidecar injector will inject an Dapr container named `daprd` into your annotated pod.
In order to view logs for the sidecar, simply find the pod in question by running `kubectl get pods`:
```
@ -105,66 +105,66 @@ NAME READY STATUS RESTARTS AGE
addapp-74b57fb78c-67zm6 2/2 Running 0 40h
```
Next, get the logs for the Actions sidecar container:
Next, get the logs for the Dapr sidecar container:
`kubectl logs addapp-74b57fb78c-67zm6 -c actionsrt`
`kubectl logs addapp-74b57fb78c-67zm6 -c daprd`
```
time="2019-09-04T02:52:27Z" level=info msg="starting Actions Runtime -- version 0.3.0-alpha -- commit b6f2810-dirty"
time="2019-09-04T02:52:27Z" level=info msg="starting Dapr Runtime -- version 0.3.0-alpha -- commit b6f2810-dirty"
time="2019-09-04T02:52:27Z" level=info msg="log level set to: info"
time="2019-09-04T02:52:27Z" level=info msg="kubernetes mode configured"
time="2019-09-04T02:52:27Z" level=info msg="action id: addapp"
time="2019-09-04T02:52:27Z" level=info msg="application protocol: http. waiting on port 6000"
time="2019-09-04T02:52:27Z" level=info msg="application discovered on port 6000"
time="2019-09-04T02:52:27Z" level=info msg="actor runtime started. actor idle timeout: 1h0m0s. actor scan interval: 30s"
time="2019-09-04T02:52:27Z" level=info msg="actors: starting connection attempt to placement service at actions-placement.actions-system.svc.cluster.local:80"
time="2019-09-04T02:52:27Z" level=info msg="actors: starting connection attempt to placement service at dapr-placement.dapr-system.svc.cluster.local:80"
time="2019-09-04T02:52:27Z" level=info msg="http server is running on port 3500"
time="2019-09-04T02:52:27Z" level=info msg="gRPC server is running on port 50001"
time="2019-09-04T02:52:27Z" level=info msg="actions initialized. Status: Running. Init Elapsed 64.234049ms"
time="2019-09-04T02:52:27Z" level=info msg="actors: established connection to placement service at actions-placement.actions-system.svc.cluster.local:80"
time="2019-09-04T02:52:27Z" level=info msg="dapr initialized. Status: Running. Init Elapsed 64.234049ms"
time="2019-09-04T02:52:27Z" level=info msg="actors: established connection to placement service at dapr-placement.dapr-system.svc.cluster.local:80"
```
### System Logs
Actions runs the following system pods:
Dapr runs the following system pods:
* Actions operator
* Actions sidecar injector
* Actions placement service
* Dapr operator
* Dapr sidecar injector
* Dapr placement service
#### Viewing Operator Logs
```
kubectl logs -l app=actions-operator -n actions-system
kubectl logs -l app=dapr-operator -n dapr-system
time="2019-09-05T19:03:43Z" level=info msg="log level set to: info"
time="2019-09-05T19:03:43Z" level=info msg="starting Actions Operator -- version 0.3.0-alpha -- commit b6f2810-dirty"
time="2019-09-05T19:03:43Z" level=info msg="Actions Operator is started"
time="2019-09-05T19:03:43Z" level=info msg="starting Dapr Operator -- version 0.3.0-alpha -- commit b6f2810-dirty"
time="2019-09-05T19:03:43Z" level=info msg="Dapr Operator is started"
```
*Note: If Actions is installed to a different namespace than actions-system, simply replace the namespace to the desired one in the command above*
*Note: If Dapr is installed to a different namespace than dapr-system, simply replace the namespace to the desired one in the command above*
#### Viewing Sidecar Injector Logs
```
kubectl logs -l app=actions-sidecar-injector -n actions-system
kubectl logs -l app=dapr-sidecar-injector -n dapr-system
time="2019-09-03T21:01:12Z" level=info msg="log level set to: info"
time="2019-09-03T21:01:12Z" level=info msg="starting Actions Sidecar Injector -- version 0.3.0-alpha -- commit b6f2810-dirty"
time="2019-09-03T21:01:12Z" level=info msg="Sidecar injector is listening on :4000, patching Actions-enabled pods"
time="2019-09-03T21:01:12Z" level=info msg="starting Dapr Sidecar Injector -- version 0.3.0-alpha -- commit b6f2810-dirty"
time="2019-09-03T21:01:12Z" level=info msg="Sidecar injector is listening on :4000, patching Dapr-enabled pods"
```
*Note: If Actions is installed to a different namespace than actions-system, simply replace the namespace to the desired one in the command above*
*Note: If Dapr is installed to a different namespace than dapr-system, simply replace the namespace to the desired one in the command above*
#### Viewing Placement Service Logs
```
kubectl logs -l app=actions-placement -n actions-system
kubectl logs -l app=dapr-placement -n dapr-system
time="2019-09-03T21:01:12Z" level=info msg="log level set to: info"
time="2019-09-03T21:01:12Z" level=info msg="starting Actions Placement Service -- version 0.3.0-alpha -- commit b6f2810-dirty"
time="2019-09-03T21:01:12Z" level=info msg="starting Dapr Placement Service -- version 0.3.0-alpha -- commit b6f2810-dirty"
time="2019-09-03T21:01:12Z" level=info msg="placement Service started on port 50005"
time="2019-09-04T00:21:57Z" level=info msg="host added: 10.244.1.89"
```
*Note: If Actions is installed to a different namespace than actions-system, simply replace the namespace to the desired one in the command above*
*Note: If Dapr is installed to a different namespace than dapr-system, simply replace the namespace to the desired one in the command above*
### Non Kubernetes Environments
The examples above are specific specific to Kubernetes, but the principal is the same for any kind of container based environment: simply grab the container ID of the Actions sidecar and/or system component (if applicable) and view its logs.
The examples above are specific specific to Kubernetes, but the principal is the same for any kind of container based environment: simply grab the container ID of the Dapr sidecar and/or system component (if applicable) and view its logs.

View File

@ -3,37 +3,37 @@
In any real world scenario, an app might start exhibiting undesirable behavior in terms of resource spikes.
CPU/Memory spikes are not uncommon in most cases.
Actions allows users to start an on-demand profiling session using `pprof` through its profiling server endpoint and start an instrumentation session to discover problems and issues such as concurrency, performance, cpu and memory usage.
Dapr allows users to start an on-demand profiling session using `pprof` through its profiling server endpoint and start an instrumentation session to discover problems and issues such as concurrency, performance, cpu and memory usage.
## Enable profiling
Actions allows you to enable profiling in both Kubernetes and Standalone modes.
Dapr allows you to enable profiling in both Kubernetes and Standalone modes.
### Kubernetes
To enable profiling in Kubernetes, simply add the following annotation to your Actions annotated pod:
To enable profiling in Kubernetes, simply add the following annotation to your Dapr annotated pod:
<pre>
annotations:
actions.io/enabled: "true"
actions.io/id: "rust-app"
<b>actions.io/profiling: "true"</b>
dapr.io/enabled: "true"
dapr.io/id: "rust-app"
<b>dapr.io/profiling: "true"</b>
</pre>
### Standalone
To enable profiling in Standalone mode, pass the `enable-profiling` and the `profile-port` flags to the Actions CLI:
Note that `profile-port` is not required, and Actions will pick an available port.
To enable profiling in Standalone mode, pass the `enable-profiling` and the `profile-port` flags to the Dapr CLI:
Note that `profile-port` is not required, and Dapr will pick an available port.
`actions run --enable-profiling true --profile-port 7777 python myapp.py`
`dapr run --enable-profiling true --profile-port 7777 python myapp.py`
## Debug a profiling session
After profiloing is enabled, we can start a profiling session to investigate what's going on with the Actions runtime.
After profiloing is enabled, we can start a profiling session to investigate what's going on with the Dapr runtime.
### Kubernetes
First, find the pod containing the Actions runtime. If you don't already know the the pod name, type `kubectl get pods`:
First, find the pod containing the Dapr runtime. If you don't already know the the pod name, type `kubectl get pods`:
```
NAME READY STATUS RESTARTS AGE
@ -43,7 +43,7 @@ divideapp-6dddf7dc74-6sq4l 2/2 Running 0 2d23h
If profiling has been enabled successfully, the runtime logs should show the following:
`time="2019-09-09T20:56:21Z" level=info msg="starting profiling server on port 7777"`
In this case, we want to start a session with the Actions runtime inside of pod `divideapp-6dddf7dc74-6sq4l`.
In this case, we want to start a session with the Dapr runtime inside of pod `divideapp-6dddf7dc74-6sq4l`.
We can do so by connecting to the pod via port forwarding:
@ -54,7 +54,7 @@ Forwarding from [::1]:7777 -> 7777
Handling connection for 7777
```
Now that the connection has been established, we can use `pprof` to profile the Actions runtime.
Now that the connection has been established, we can use `pprof` to profile the Dapr runtime.
The following example will create a `cpu.pprof` file containing samples from a profile session that lasts 120 seconds:
`curl "http://localhost:7777/debug/pprof/profile?seconds=120" > cpu.pprof`
@ -81,27 +81,27 @@ Profiling allocated objects:
go tool pprof http://localhost:7777/debug/pprof/heap
> exit
Saved profile in /Users/myusername/pprof/pprof.actionsrt.alloc_objects.alloc_space.inuse_objects.inuse_space.003.pb.gz
Saved profile in /Users/myusername/pprof/pprof.daprd.alloc_objects.alloc_space.inuse_objects.inuse_space.003.pb.gz
```
To analyze, grab the file path above (its a dynamic file path, so pay attention to note paste this one), and execute:
`go tool pprof -alloc_objects --pdf /Users/myusername/pprof/pprof.actionsrt.alloc_objects.alloc_space.inuse_objects.inuse_space.003.pb.gz > alloc-objects.pdf`
`go tool pprof -alloc_objects --pdf /Users/myusername/pprof/pprof.daprd.alloc_objects.alloc_space.inuse_objects.inuse_space.003.pb.gz > alloc-objects.pdf`
![alloc](../imgs/alloc.png)
### Standalone
For Standalone mode, locate the Actions instance that you want to profile:
For Standalone mode, locate the Dapr instance that you want to profile:
```
actions list
APP ID ACTIONS PORT APP PORT COMMAND AGE CREATED PID
dapr list
APP ID DAPR PORT APP PORT COMMAND AGE CREATED PID
node-subscriber 3500 3000 node app.js 12s 2019-09-09 15:11.24 896
```
Grab the ACTIONS PORT, and if profiling has been enabled as desribed above, you can now start using `pprof` to profile Actions.
Look at the Kubernetes examples above for some useful commands to profile Actions.
Grab the DAPR PORT, and if profiling has been enabled as desribed above, you can now start using `pprof` to profile Dapr.
Look at the Kubernetes examples above for some useful commands to profile Dapr.
More info on pprof can be found [here](https://github.com/google/pprof).

View File

@ -1,7 +1,7 @@
# Azure Blob Storage Binding Spec
```
apiVersion: actions.io/v1alpha1
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: <name>

View File

@ -1,7 +1,7 @@
# Azure CosmosDB Binding Spec
```
apiVersion: actions.io/v1alpha1
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: <name>

View File

@ -1,7 +1,7 @@
# AWS DynamoDB Binding Spec
```
apiVersion: actions.io/v1alpha1
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: <name>

View File

@ -1,7 +1,7 @@
# Azure EventHubs Binding Spec
```
apiVersion: actions.io/v1alpha1
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: <name>

View File

@ -1,7 +1,7 @@
# GCP Storage Bucket Spec
```
apiVersion: actions.io/v1alpha1
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: <name>

View File

@ -1,7 +1,7 @@
# GCP Cloud Pub/Sub Binding Spec
```
apiVersion: actions.io/v1alpha1
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: <name>

View File

@ -1,7 +1,7 @@
# HTTP Binding Spec
```
apiVersion: actions.io/v1alpha1
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: <name>

View File

@ -1,7 +1,7 @@
# Kafka Binding Spec
```
apiVersion: actions.io/v1alpha1
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: <name>

View File

@ -1,7 +1,7 @@
# Kubernetes Events Binding Spec
```
apiVersion: actions.io/v1alpha1
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: <name>

View File

@ -1,7 +1,7 @@
# MQTT Binding Spec
```
apiVersion: actions.io/v1alpha1
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: <name>

View File

@ -1,7 +1,7 @@
# RabbitMQ Binding Spec
```
apiVersion: actions.io/v1alpha1
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: <name>

View File

@ -1,7 +1,7 @@
# Redis Binding Spec
```
apiVersion: actions.io/v1alpha1
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: <name>

View File

@ -1,7 +1,7 @@
# AWS S3 Binding Spec
```
apiVersion: actions.io/v1alpha1
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: <name>

View File

@ -1,7 +1,7 @@
# Azure Service Bus Queues Binding Spec
```
apiVersion: actions.io/v1alpha1
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: <name>

View File

@ -1,7 +1,7 @@
# AWS SNS Binding Spec
```
apiVersion: actions.io/v1alpha1
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: <name>

View File

@ -1,7 +1,7 @@
# AWS SQS Binding Spec
```
apiVersion: actions.io/v1alpha1
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: <name>

View File

@ -1,13 +1,13 @@
# Redis and Actions
# Redis and Dapr
Actions can use Redis in two ways:
Dapr can use Redis in two ways:
1. For state persistence and restoration
2. For enabling pub-sub async style message delivery
## Creating a Redis Store
Actions can use any Redis instance - containerized, running on your local dev machine, or a managed cloud service. If you already have a Redis store, move on to the [Configuration](#configuration) section.
Dapr can use any Redis instance - containerized, running on your local dev machine, or a managed cloud service. If you already have a Redis store, move on to the [Configuration](#configuration) section.
### Creating an Azure Managed Redis Cache
@ -17,13 +17,13 @@ Actions can use any Redis instance - containerized, running on your local dev ma
2. Fill out necessary information and **check the "Unblock port 6379" box**, which will allow us to persist state without SSL.
3. Click "Create" to kickoff deployment of your Redis instance.
4. Once your instance is created, you'll need to grab your access key. Navigate to "Access Keys" under "Settings" and copy your key.
5. Finally, we need to add our key and our host to a `redis.yaml` file that Actions can apply to our cluster. If you're running a sample, you'll add the host and key to the provided `redis.yaml`. If you're creating a project from the ground up, you'll create a `redis.yaml` file as specified in [Configuration](#configuration). Set the `redisHost` key to `actions-redis.redis.cache.windows.net:6379` and the `redisPassword` key to the key you copied in step 4. **Note:** In a production-grade application, follow [secret management](https://github.com/actionscore/docs/blob/master/concepts/components/secrets.md) instructions to securely manage your secrets.
5. Finally, we need to add our key and our host to a `redis.yaml` file that Dapr can apply to our cluster. If you're running a sample, you'll add the host and key to the provided `redis.yaml`. If you're creating a project from the ground up, you'll create a `redis.yaml` file as specified in [Configuration](#configuration). Set the `redisHost` key to `dapr-redis.redis.cache.windows.net:6379` and the `redisPassword` key to the key you copied in step 4. **Note:** In a production-grade application, follow [secret management](https://github.com/daprcore/docs/blob/master/concepts/components/secrets.md) instructions to securely manage your secrets.
### Creating a Redis Cache in your Kubernetes Cluster using Helm
We can use [Helm](https://helm.sh/) to quickly create a Redis instance in our Kubernetes cluster. This approach requires [Installing Helm](https://github.com/helm/helm#install).
1. Install Redis into your cluster: `helm install stable/redis --name redis --set image.tag=5.0.5-debian-9-r104`. Note that we're explicitly setting an image tag to get a version greater than 5, which is what Actions' pub-sub functionality requires. If you're intending on using Redis as just a state store (and not for pub-sub), you do not have to set the image version.
1. Install Redis into your cluster: `helm install stable/redis --name redis --set image.tag=5.0.5-debian-9-r104`. Note that we're explicitly setting an image tag to get a version greater than 5, which is what Dapr' pub-sub functionality requires. If you're intending on using Redis as just a state store (and not for pub-sub), you do not have to set the image version.
2. Run `kubectl get pods` to see the Redis containers now running in your cluster.
3. Run `kubectl get svc` and copy the cluster IP of your `redis-master`. Add this IP as the `redisHost` in your redis.yaml file, followed by ":6379". For example:
```yaml
@ -46,14 +46,14 @@ We can use [Helm](https://helm.sh/) to quickly create a Redis instance in our Ku
## Configuration
Actions can use Redis as a `statestore` component (for state persistence and retrieval) or as a `messagebus` component (for pub-sub). The following yaml files demonstrates how to define each. **Note:** yaml files below illustrate secret management in plain text. In a production-grade application, follow [secret management](https://github.com/actionscore/docs/blob/master/concepts/components/secrets.md) instructions to securely manage your secrets.
Dapr can use Redis as a `statestore` component (for state persistence and retrieval) or as a `messagebus` component (for pub-sub). The following yaml files demonstrates how to define each. **Note:** yaml files below illustrate secret management in plain text. In a production-grade application, follow [secret management](https://github.com/daprcore/docs/blob/master/concepts/components/secrets.md) instructions to securely manage your secrets.
### Configuring Redis for State Persistence and Retrieval
Create a file called redis.yaml, and paste the following:
```yaml
apiVersion: actions.io/v1alpha1
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: statestore
@ -69,7 +69,7 @@ spec:
Create a file called redis.yaml, and paste the following:
```yaml
apiVersion: actions.io/v1alpha1
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: messagebus
@ -90,4 +90,4 @@ kubectl apply -f redis.yaml
### Standalone
By default the Actions CLI creates a local Redis instance when you run `actions init`. However, if you want to configure a different Redis instance, create a directory named `eventsources` in the root path of your Action binary and then copy your `redis.yaml` into that directory.
By default the Dapr CLI creates a local Redis instance when you run `dapr init`. However, if you want to configure a different Redis instance, create a directory named `eventsources` in the root path of your Action binary and then copy your `redis.yaml` into that directory.

View File

@ -9,7 +9,7 @@ When running in Kubernetes, if the `auth.secretStore` is empty, the Kubernetes s
Using plain text:
```
apiVersion: actions.io/v1alpha1
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: statestore
@ -25,7 +25,7 @@ spec:
Using a Kubernetes secret:
```
apiVersion: actions.io/v1alpha1
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: statestore
@ -42,7 +42,7 @@ auth:
secretStore: kubernetes
```
The above example tells Actions to use the `kubernetes` secret store, extract a secret named `redis-secret` and assign the value of the `redis-password` key in the secret to the `redisPassword` field in the Component.
The above example tells Dapr to use the `kubernetes` secret store, extract a secret named `redis-secret` and assign the value of the `redis-password` key in the secret to the `redisPassword` field in the Component.
### Creating a secret and referencing it in a Component
@ -57,7 +57,7 @@ kubectl create secret generic eventhubs-secret --from-literal=connectionString=*
Next, reference the secret in your binding:
```
apiVersion: actions.io/v1alpha1
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: eventhubs

View File

@ -37,7 +37,7 @@ Downloading binaries and setting up components
✅ Success! Dapr is up and running
```
To see that Dapr has been installed successful, from a command prompt run the `docker ps` command and check that the `actionscore.azurecr.io/dapr:latest` and `redis` container images are both running.
To see that Dapr has been installed successful, from a command prompt run the `docker ps` command and check that the `daprcore.azurecr.io/dapr:latest` and `redis` container images are both running.
### Install a specific runtime version
You can install or upgrade to a specific version of the Dapr runtime using `dapr init --runtime-version`
@ -92,7 +92,7 @@ You can install Dapr to Kubernetes cluster using a Helm chart.
2. Add Azure Container Registry as a Helm repo
```bash
helm repo add dapr https://actionscore.azurecr.io/helm/v1/repo \
helm repo add dapr https://daprcore.azurecr.io/helm/v1/repo \
--username 390401a7-d7a6-46da-b10f-3ceff7a1cdd5 \
--password 485b3522-59bb-4152-8938-ca8b90108af6
```

View File

@ -14,7 +14,7 @@ Create the following YAML file, named binding.yaml, and save this to the /compon
*Note: When running in Kubernetes, apply this file to your cluster using `kubectl apply -f binding.yaml`*
```
apiVersion: actions.io/v1alpha1
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: myEvent

View File

@ -1,6 +1,6 @@
# Secret Store for Azure Key Vault
This document shows how to enable Azure Key Vault secret store using [Actions Secrets Component](../../concepts/components/secrets.md) for Standalone and Kubernetes mode. The Actions secret store component uses Service Principal using certificate authorization to authenticate Key Vault.
This document shows how to enable Azure Key Vault secret store using [Dapr Secrets Component](../../concepts/components/secrets.md) for Standalone and Kubernetes mode. The Dapr secret store component uses Service Principal using certificate authorization to authenticate Key Vault.
> **Note:** Managed Identity for Azure Key Vault is not currently supported.
@ -105,7 +105,7 @@ This section walks you through how to enable an Azure Key Vault secret store to
1. Create a components directory in your application root
All Actions components are stored in a directory called 'components' below at application root. Create this directory.
All Dapr components are stored in a directory called 'components' below at application root. Create this directory.
```bash
mkdir components
@ -115,10 +115,10 @@ mkdir components
3. Create a file called azurekeyvault.yaml in the components directory
Now create an Actions azurekeyvault component. Create a file called azurekeyvault.yaml in the components directory with the content below
Now create an Dapr azurekeyvault component. Create a file called azurekeyvault.yaml in the components directory with the content below
```yaml
apiVersion: actions.io/v1alpha1
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: azurekeyvault
@ -146,7 +146,7 @@ az keyvault secret set --name redisPassword --vault-name [your_keyvault_name] --
Create a statestore component file. This Redis component yaml shows how to use the `redisPassword` secret stored in an Azure Key Vault called azurekeyvault as a Redis connection password.
```yaml
apiVersion: actions.io/v1alpha1
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: statestore
@ -164,24 +164,24 @@ auth:
6. Run your app
You can check that `secretstores.azure.keyvault` component is loaded and redis server connects successfully by looking at the log output when using the actions `run` command
You can check that `secretstores.azure.keyvault` component is loaded and redis server connects successfully by looking at the log output when using the dapr `run` command
Here is the log when you run [HelloWorld sample](https://github.com/actionscore/actions/tree/master/samples/1.hello-world) with Azure Key Vault secret store.
Here is the log when you run [HelloWorld sample](https://github.com/daprcore/dapr/tree/master/samples/1.hello-world) with Azure Key Vault secret store.
```bash
$ actions run --app-id mynode --app-port 3000 --port 3500 node app.js
$ dapr run --app-id mynode --app-port 3000 --port 3500 node app.js
Starting Actions with id mynode on port 3500
✅ You're up and running! Both Actions and your app logs will appear here.
Starting Dapr with id mynode on port 3500
✅ You're up and running! Both Dapr and your app logs will appear here.
...
== ACTIONS == time="2019-09-25T17:57:37-07:00" level=info msg="loaded component azurekeyvault (secretstores.azure.keyvault)"
== DAPR == time="2019-09-25T17:57:37-07:00" level=info msg="loaded component azurekeyvault (secretstores.azure.keyvault)"
== APP == Node App listening on port 3000!
== ACTIONS == time="2019-09-25T17:57:38-07:00" level=info msg="loaded component statestore (state.redis)"
== ACTIONS == time="2019-09-25T17:57:38-07:00" level=info msg="loaded component messagebus (pubsub.redis)"
== DAPR == time="2019-09-25T17:57:38-07:00" level=info msg="loaded component statestore (state.redis)"
== DAPR == time="2019-09-25T17:57:38-07:00" level=info msg="loaded component messagebus (pubsub.redis)"
...
== ACTIONS == 2019/09/25 17:57:38 redis: connecting to [redis]:6379
== ACTIONS == 2019/09/25 17:57:38 redis: connected to [redis]:6379 (localAddr: x.x.x.x:62137, remAddr: x.x.x.x:6379)
== DAPR == 2019/09/25 17:57:38 redis: connecting to [redis]:6379
== DAPR == 2019/09/25 17:57:38 redis: connected to [redis]:6379 (localAddr: x.x.x.x:62137, remAddr: x.x.x.x:6379)
...
```
@ -204,7 +204,7 @@ kubectl create secret generic [your_k8s_spn_secret_name] --from-file=[pfx_certif
The component yaml refers to the Kubernetes secretstore using `auth` property and `secretKeyRef` refers to the certificate stored in Kubernetes secret store.
```yaml
apiVersion: actions.io/v1alpha1
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: azurekeyvault
@ -243,7 +243,7 @@ az keyvault secret set --name redisPassword --vault-name [your_keyvault_name] --
This redis state store component refers to `azurekeyvault` component as a secretstore and uses the secret for `redisPassword` stored in Azure Key Vault.
```yaml
apiVersion: actions.io/v1alpha1
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: statestore
@ -267,14 +267,14 @@ auth:
7. Deploy your app to Kubernetes
Make sure that `secretstores.azure.keyvault` is loaded successfully in `actionsrt` sidecar log
Make sure that `secretstores.azure.keyvault` is loaded successfully in `daprd` sidecar log
Here is the nodeapp log of [HelloWorld Kubernetes sample](https://github.com/actionscore/actions/tree/master/samples/2.hello-kubernetes). Note: use the nodeapp name for your deployed container instance.
Here is the nodeapp log of [HelloWorld Kubernetes sample](https://github.com/daprcore/dapr/tree/master/samples/2.hello-kubernetes). Note: use the nodeapp name for your deployed container instance.
```bash
$ kubectl logs nodeapp-f7b7576f4-4pjrj actionsrt
$ kubectl logs nodeapp-f7b7576f4-4pjrj daprd
time="2019-09-26T20:34:23Z" level=info msg="starting Actions Runtime -- version 0.4.0-alpha.4 -- commit 876474b-dirty"
time="2019-09-26T20:34:23Z" level=info msg="starting Dapr Runtime -- version 0.4.0-alpha.4 -- commit 876474b-dirty"
time="2019-09-26T20:34:23Z" level=info msg="log level set to: info"
time="2019-09-26T20:34:23Z" level=info msg="kubernetes mode configured"
time="2019-09-26T20:34:23Z" level=info msg="action id: nodeapp"