adding multi app run template for service invocation examples (#785)

* adding mullti app run template for service invocation

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* update dotnet to 7

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* remove daprhttpport

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* adding markdown validation

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

---------

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>
This commit is contained in:
Pravin Pushkar 2023-02-04 00:21:41 +05:30 committed by GitHub
parent 6d88455770
commit 72cc495563
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 1933 additions and 657 deletions

View File

@ -59,10 +59,10 @@ jobs:
distribution: 'adopt'
java-version: 11
- name: Install .NET Core
uses: actions/setup-dotnet@v1.9.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
6.0.x
7.0.x
- name: Determine latest Dapr Runtime version including Pre-releases
run: |
helm repo add dapr https://dapr.github.io/helm-charts/ && helm repo update && export RUNTIME_VERSION=$(helm search repo dapr/dapr --devel --versions | awk '/dapr\/dapr/ {print $3; exit}' )

1
.gitignore vendored
View File

@ -6,6 +6,7 @@ _ReSharper.*
bin
obj
github.com
**/*.log
## Build generated
target/

View File

@ -88,3 +88,51 @@ dapr run --app-id checkout --app-protocol http --dapr-http-port 3500 -- dotnet
```bash
dapr stop --app-id order-processor
```
### Start all apps with multi app run template file:
1. Open a new terminal window and install dependencies for `order-processor` and `checkout` apps:
<!-- STEP
name: Install Dotnet dependencies for order-processor and checkout
-->
```bash
cd ./order-processor
dotnet restore
dotnet build
cd ../checkout
dotnet restore
dotnet build
```
<!-- END_STEP -->
2. Run the multi app run template:
<!-- STEP
name: Run multi app run template
expected_stdout_lines:
- 'This is a preview feature and subject to change in future releases'
- 'Validating config and starting app "order-processor"'
- 'Started Dapr with app id "order-processor"'
- 'Writing log files to directory'
- 'Validating config and starting app "checkout"'
- 'Started Dapr with app id "checkout"'
- 'Writing log files to directory'
expected_stderr_lines:
output_match_mode: substring
background: true
sleep: 15
-->
```bash
sleep 10
dapr run -f .
```
<!-- END_STEP -->
```bash
dapr stop -f .
```

View File

@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

View File

@ -0,0 +1,9 @@
version: 1
apps:
- appDirPath: ./order-processor/
appID: order-processor
appPort: 7001
command: ["dotnet", "run"]
- appID: checkout
appDirPath: ./checkout/
command: ["dotnet", "run"]

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>

View File

@ -67,3 +67,34 @@ To stop:
dapr stop --app-id checkout
dapr stop --app-id order-processor
```
### Start all apps with multi app run template file:
1. Run the multi app run template:
<!-- STEP
name: Run multi app run template
expected_stdout_lines:
- 'This is a preview feature and subject to change in future releases'
- 'Validating config and starting app "order-processor"'
- 'Started Dapr with app id "order-processor"'
- 'Writing log files to directory'
- 'Validating config and starting app "checkout"'
- 'Started Dapr with app id "checkout"'
- 'Writing log files to directory'
expected_stderr_lines:
output_match_mode: substring
background: true
sleep: 15
-->
```bash
sleep 10
dapr run -f .
```
<!-- END_STEP -->
```bash
dapr stop -f .
```

View File

@ -0,0 +1,9 @@
version: 1
apps:
- appDirPath: ./order-processor/
appID: order-processor
appPort: 6001
command: ["go", "run", "."]
- appID: checkout
appDirPath: ./checkout/
command: ["go", "run", "."]

View File

@ -93,3 +93,49 @@ dapr run --app-id checkout --app-protocol http --dapr-http-port 3500 -- java -ja
dapr stop --app-id checkout
dapr stop --app-id order-processor
```
### Start all apps with multi app run template file:
1. Open a new terminal window and install dependencies for `order-processor` and `checkout` apps:
<!-- STEP
name: Install maven dependencies for order-processor and checkout
-->
```bash
cd ./order-processor
mvn clean install
cd ../checkout
mvn clean install
```
<!-- END_STEP -->
2. Run the multi app run template:
<!-- STEP
name: Run multi app run template
expected_stdout_lines:
- 'This is a preview feature and subject to change in future releases'
- 'Validating config and starting app "order-processor"'
- 'Started Dapr with app id "order-processor"'
- 'Writing log files to directory'
- 'Validating config and starting app "checkout"'
- 'Started Dapr with app id "checkout"'
- 'Writing log files to directory'
expected_stderr_lines:
output_match_mode: substring
background: true
sleep: 15
-->
```bash
sleep 10
dapr run -f .
```
<!-- END_STEP -->
```bash
dapr stop -f .
```

View File

@ -0,0 +1,11 @@
version: 1
common:
configFilePath: ./config.yaml
apps:
- appDirPath: ./order-processor/
appID: order-processor
appPort: 9001
command: ["java", "-jar", "target/OrderProcessingService-0.0.1-SNAPSHOT.jar"]
- appID: checkout
appDirPath: ./checkout/
command: ["java", "-jar", "target/CheckoutService-0.0.1-SNAPSHOT.jar"]

View File

@ -87,3 +87,49 @@ dapr run --app-id checkout --app-protocol http --dapr-http-port 3500 -- npm sta
dapr stop --app-id checkout
dapr stop --app-id order-processor
```
### Start all apps with multi app run template file:
1. Open a new terminal window and install dependencies for `order-processor` and `checkout` apps:
<!-- STEP
name: Install Node dependencies for order-processor and checkout
-->
```bash
cd ./order-processor
npm install
cd ../checkout
npm install
```
<!-- END_STEP -->
2. Run the multi app run template:
<!-- STEP
name: Run multi app run template
expected_stdout_lines:
- 'This is a preview feature and subject to change in future releases'
- 'Validating config and starting app "order-processor"'
- 'Started Dapr with app id "order-processor"'
- 'Writing log files to directory'
- 'Validating config and starting app "checkout"'
- 'Started Dapr with app id "checkout"'
- 'Writing log files to directory'
expected_stderr_lines:
output_match_mode: substring
background: true
sleep: 15
-->
```bash
sleep 10
dapr run -f .
```
<!-- END_STEP -->
```bash
dapr stop -f .
```

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,11 @@
version: 1
common:
configFilePath: ./config.yaml
apps:
- appDirPath: ./order-processor/
appID: order-processor
appPort: 5001
command: ["npm", "start"]
- appID: checkout
appDirPath: ./checkout/
command: ["npm", "start"]

File diff suppressed because it is too large Load Diff

View File

@ -87,3 +87,49 @@ dapr run --app-id checkout --app-protocol http --dapr-http-port 3500 -- python3
dapr stop --app-id checkout
dapr stop --app-id order-processor
```
### Start all apps with multi app run template file:
1. Open a new terminal window and install dependencies for `order-processor` and `checkout` apps:
<!-- STEP
name: Install Python dependencies for order-processor and checkout
-->
```bash
cd ./order-processor
pip3 install -r requirements.txt
cd ../checkout
pip3 install -r requirements.txt
```
<!-- END_STEP -->
2. Run the multi app run template:
<!-- STEP
name: Run multi app run template
expected_stdout_lines:
- 'This is a preview feature and subject to change in future releases'
- 'Validating config and starting app "order-processor"'
- 'Started Dapr with app id "order-processor"'
- 'Writing log files to directory'
- 'Validating config and starting app "checkout"'
- 'Started Dapr with app id "checkout"'
- 'Writing log files to directory'
expected_stderr_lines:
output_match_mode: substring
background: true
sleep: 15
-->
```bash
sleep 10
dapr run -f .
```
<!-- END_STEP -->
```bash
dapr stop -f .
```

View File

@ -0,0 +1,11 @@
version: 1
common:
configFilePath: ./config.yaml
apps:
- appDirPath: ./order-processor/
appID: order-processor
appPort: 8001
command: ["python3", "app.py"]
- appID: checkout
appDirPath: ./checkout/
command: ["python3", "app.py"]