updates per mukundand and pravin

Signed-off-by: Hannah Hunter <hannahhunter@microsoft.com>
This commit is contained in:
Hannah Hunter 2023-02-03 10:33:52 -06:00
parent caaa1e7c7d
commit 9b12a599c8
2 changed files with 61 additions and 13 deletions

View File

@ -23,7 +23,7 @@ With Multi-app Run, you can start multiple applications in self-hosted mode usin
## MapR template file
When you execute `dapr run -f`, uses the multi-app template file to run all the applications.
When you execute `dapr run -f .`, it uses the multi-app template file (named `dapr.yaml`) present in the current directory to run all the applications.
You can name template file with preferred name other than the default. For example `dapr run -f ./<your-preferred-file-name>.yaml`.
@ -33,12 +33,12 @@ The following `dapr.yaml` example includes some of the template properties you c
version: 1
apps:
- appID: processor
appDirPath: ../../../apps/processor/
appDirPath: ../apps/processor/
appPort: 9081
daprHTTPPort: 3510
command: ["go","run", "app.go"]
- appID: emit-metrics
appDirPath: ../../../apps/emit-metrics/
appDirPath: ../apps/emit-metrics/
daprHTTPPort: 3511
env:
DAPR_HOST_ADD: localhost
@ -57,9 +57,9 @@ You can set all of your applications resources and configurations at the `~/.dap
### Separate file locations for each application (with convention)
When developing multiple applications, each app directory can have a `.dapr` folder, which contains a `config.yaml` file and a `resources` directory. Otherwise, if the `.dapr` directory is not present within the app directory, the default `~/.dapr/resources/` and `~/.dapr/config.yaml` locations are used.
When using MapR, each application directory can have a `.dapr` folder, which contains a `config.yaml` file and a `resources` directory. Otherwise, if the `.dapr` directory is not present within the app directory, the default `~/.dapr/resources/` and `~/.dapr/config.yaml` locations are used.
If you decide to add a `.dapr` directory in each app directory, with a `/resources` directory and `config.yaml` file, you can specify different resources paths for each application. This approach remains within convention by using the default `.dapr`
If you decide to add a `.dapr` directory in each application directory, with a `/resources` directory and `config.yaml` file, you can specify different resources paths for each application. This approach remains within convention by using the default `~/.dapr`.
### Point to separate locations (custom)
@ -67,12 +67,12 @@ You can also name each app directory's `.dapr` directory something other than `.
## Logs
Logs for application and `daprd` are captured in separate files. These log files are created automatically under `.dapr/logs` directory under each app director. These log file names follow the below pattern:
Logs for application and `daprd` are captured in separate files. These log files are created automatically under `.dapr/logs` directory under each application directory (`appDirPath` in the template). These log file names follow the pattern seen below:
- `<appID>_app_<timestamp>.log` (file name format for app's log)
- `<appID>_app_<timestamp>.log` (file name format for `app` log)
- `<appID>_daprd_<timestamp>.log` (file name format for `daprd` log)
Even if you've decided to rename your resources folder to something other than `.dapr`, the logs file are written to `.dapr` folder.
Even if you've decided to rename your resources folder to something other than `.dapr`, the log files are written only to the `.dapr/logs` folder (created in the application directory).
## Watch the demo

View File

@ -1,7 +1,7 @@
---
type: docs
title: MapR template file
linkTitle: MapR template
title: "How to: Use the MapR template file"
linkTitle: "How to: Use the MapR template"
weight: 2000
description: Unpack the MapR template file and its properties
---
@ -10,20 +10,59 @@ description: Unpack the MapR template file and its properties
MapR (Multi-app Run using `dapr run -f`) is currently a preview feature only supported in Linux/MacOS.
{{% /alert %}}
The MapR template file is a YAML file that you can use to run multiple applications at once. Execute the following CLI command to read the MapR template file, named `dapr.yaml` by default:
The MapR template file is a YAML file that you can use to run multiple applications at once. In this guide, you'll learn how to:
- Use the multi-app template
- View started applications
- Stop the multi-app template
- Stucture the multi-app template file
## Use the multi-app template
You can use the multi-app template file in one of the following two ways:
### Execute by providing a directory path
When you provide a directory path, the CLI will try to locate the MapR template file, named `dapr.yaml` by default in the directory. If the file is not found, the CLI will return an error.
Execute the following CLI command to read the MapR template file, named `dapr.yaml` by default:
```cmd
// the template file needs to be called `dapr.yaml` by default
dapr run -f
dapr run -f <dir_path>
```
If the MapR template file is named something other than `dapr.yaml`, run:
### Execute by providing a file path
If the MapR template file is named something other than `dapr.yaml`, then you can provide the relative or absolute file path to the command:
```cmd
dapr run -f ./<your-preferred-file-name>.yaml
```
## View the started applications
Once the multi-app template is running, you can view the started applications with the following command:
```cmd
dapr list
```
## Stop the multi-app template
Stop the multi-app run template anytime with either of the following commands:
```cmd
dapr stop -f
```
or:
```cmd
dapr stop -f dapr.yaml
```
## Template file structure
The MapR template file can include the following properties. Below is an example template showing two applications that are configured with some of the properties.
```yaml
@ -51,6 +90,15 @@ apps:
command: ["./backend"]
```
{{% alert title="Important" color="warning" %}}
The following rules apply for all the paths present in the template file:
- If the path is absolute, it is used as is.
- All relative paths under comman section should be provided relative to the template file path.
- `appDirPath` under apps section should be provided relative to the template file path.
- All relative paths under app section should be provided relative to the appDirPath.
{{% /alert %}}
## Template properties
The properties for the MapR template align with the `dapr run` CLI flags, [listed in the CLI reference documentation]({{< ref "dapr-run.md#flags" >}}).