Skip to content

Commit

Permalink
Merge pull request #1077 from mikeee/fix-jobs-questionmark
Browse files Browse the repository at this point in the history
fix: job sdk / go validation
  • Loading branch information
paulyuk authored Jul 27, 2024
2 parents 427d1f0 + d6ed760 commit f1ce393
Show file tree
Hide file tree
Showing 10 changed files with 92 additions and 22 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/validate_go_quickstarts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,20 +95,33 @@ jobs:
echo "PATH=$PATH:$HOME/.local/bin" >> $GITHUB_ENV
pip3 install setuptools wheel
pip3 install mechanical-markdown
- name: Checkout Dapr
uses: actions/checkout@v4
with:
repository: dapr/dapr
ref: df7ece7b8b717b991b22e0e94556e3b16effd034
path: './dapr-dapr'
- name: Build Dapr
run: |
cd ./dapr-dapr/
make build
- name: Override dapr
run: |
cp ./dapr-dapr/dist/linux_amd64/release/daprd ~/.dapr/bin/daprd
- name: Validate building blocks with GO
run: |
variants=("http" "sdk")
building_blocks=$(find . -maxdepth 1 -mindepth 1 -type d)
for building_block in $building_blocks; do
for variant in "${variants[@]}"
do
if [ ! -d "$building_block/go/$variant" ];
if [ ! -d "$building_block/go/$variant" ];
then
echo "$building_block/go/$variant does not exist."
else
pushd $building_block/go/$variant
echo "Validating $building_block/go/$variant quickstart"
make validate
make validate
popd
fi
done
Expand Down
11 changes: 9 additions & 2 deletions jobs/go/http/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ expected_stdout_lines:
expected_stderr_lines:
output_match_mode: substring
match_order: none
background: true
background: false
sleep: 60
timeout_seconds: 120
-->
Expand Down Expand Up @@ -61,8 +61,15 @@ After 30 seconds, the terminal output should present the `C-3PO` job being proce
== APP - job-service == Executing maintenance job: Limb Calibration
```

<!-- END_STEP -->

2. Stop and clean up application processes

<!-- STEP
name: Stop multi-app run
sleep: 5
-->

```bash
dapr stop -f .
```
Expand Down Expand Up @@ -149,4 +156,4 @@ Back at the `job-service` app terminal window, the output should be:

```text
ERRO[0249] Error getting job c-3po due to: rpc error: code = Unknown desc = job not found: app||default||job-service||c-3po instance=diagrid.local scope=dapr.api type=log ver=1.14.0-rc.2
```
```
31 changes: 20 additions & 11 deletions jobs/go/sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,19 @@ This section shows how to run both applications at once using [multi-app run tem
Open a new terminal window and run the multi app run template:

<!-- STEP
name: Run multi app run template (disabled)
expected_stdout_lines:
expected_stderr_lines:
output_match_mode: substring
match_order: none
background: true
sleep: 15
timeout_seconds: 30
-->
<!-- END_STEP -->
name: Run multi app run template
expected_stdout_lines:
- '== APP - job-service == Starting droid: R2-D2'
- '== APP - job-service == Executing maintenance job: Oil Change'
- '== APP - job-service == Starting droid: C-3PO'
- '== APP - job-service == Executing maintenance job: Memory Wipe'
expected_stderr_lines:
output_match_mode: substring
match_order: none
background: false
sleep: 120
timeout_seconds: 180
-->

```bash
dapr run -f .
Expand Down Expand Up @@ -75,13 +78,19 @@ After 10 seconds, the terminal output should present the `C3-PO` job being proce
== APP - job-service == Executing maintenance job: Memory Wipe
```

<!-- END_STEP -->

2. Stop and clean up application processes
<!-- STEP
name: Stop multi-app run
sleep: 5
-->

```bash
dapr stop -f .
```


<!-- END_STEP -->

## Run the Jobs APIs individually

Expand Down
5 changes: 4 additions & 1 deletion jobs/go/sdk/dapr.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
version: 1
common:
daprdLogDestination: console
logLevel: info
apps:
- appDirPath: ./job-service/
appID: job-service
Expand All @@ -9,4 +12,4 @@ apps:
- appDirPath: ./job-scheduler/
appID: job-scheduler
appPort: 6500
command: ["go", "run", "."]
command: ["go", "run", "."]
8 changes: 7 additions & 1 deletion pub_sub/go/http/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ expected_stdout_lines:
expected_stderr_lines:
output_match_mode: substring
match_order: none
background: true
background: false
sleep: 30
timeout_seconds: 60
-->
Expand Down Expand Up @@ -59,9 +59,15 @@ The terminal console output should look similar to this:
== APP - checkout-http == Published data: {"orderId":10}
== APP - order-processor-http == Subscriber received: {"orderId":10}
```
<!-- END_STEP -->

2. Stop and clean up application processes

<!-- STEP
name: Stop multi-app run
sleep: 5
-->

```bash
dapr stop -f .
```
Expand Down
8 changes: 7 additions & 1 deletion pub_sub/go/sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ expected_stdout_lines:
expected_stderr_lines:
output_match_mode: substring
match_order: none
background: true
background: false
sleep: 30
timeout_seconds: 60
-->
Expand Down Expand Up @@ -59,8 +59,14 @@ The terminal console output should look similar to this:
== APP - checkout-sdk == Published data: {"orderId":10}
== APP - order-processor == Subscriber received: map[orderId:10]
```
<!-- END_STEP -->

2. Stop and clean up application processes
<!-- STEP
name: Stop multi-app run
sleep: 5
-->


```bash
dapr stop -f .
Expand Down
8 changes: 7 additions & 1 deletion service_invocation/go/http/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ expected_stdout_lines:
expected_stderr_lines:
output_match_mode: substring
match_order: none
background: true
background: false
sleep: 30
timeout_seconds: 60
-->
Expand Down Expand Up @@ -56,9 +56,15 @@ The terminal console output should look similar to this:
== APP - checkout-http == Published data: {"orderId":10}
== APP - order-processor == Subscriber received: {"orderId":10}
```
<!-- END_STEP -->

3. Stop and clean up application processes

<!-- STEP
name: Stop multi-app run
sleep: 5
-->

```bash
dapr stop -f .
```
Expand Down
8 changes: 7 additions & 1 deletion state_management/go/http/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,21 @@ expected_stdout_lines:
expected_stderr_lines:
output_match_mode: substring
match_order: none
background: true
background: false
sleep: 15
-->

```bash
dapr run -f .
```

<!-- END_STEP -->

2. Stop and cleanup application process
<!-- STEP
name: Stop multi-app run
sleep: 5
-->

```bash
dapr stop -f .
Expand Down
9 changes: 8 additions & 1 deletion state_management/go/sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,23 @@ expected_stdout_lines:
expected_stderr_lines:
output_match_mode: substring
match_order: none
background: true
background: false
sleep: 15
-->

```bash
dapr run -f .
```

<!-- END_STEP -->

2. Stop and cleanup application process

<!-- STEP
name: Stop multi-app run
sleep: 5
-->

```bash
dapr stop -f .
```
Expand Down
9 changes: 8 additions & 1 deletion workflows/go/sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ expected_stdout_lines:
- "There are now 90 cars left in stock"
- "Workflow completed - result: COMPLETED"
output_match_mode: substring
background: true
background: false
timeout_seconds: 120
sleep: 30
-->
Expand Down Expand Up @@ -70,10 +70,17 @@ dapr run -f .
4. Stop Dapr workflow with CTRL-C or:
<!-- END_STEP -->

<!-- STEP
name: Stop multi-app run
sleep: 5
-->

```sh
dapr stop -f .
```

<!-- END_STEP -->



### View workflow output with Zipkin
Expand Down

0 comments on commit f1ce393

Please sign in to comment.