From 8a13e63f5c62e69f0a4f4c7f2b8735ce14fe7083 Mon Sep 17 00:00:00 2001 From: mikeee Date: Fri, 26 Jul 2024 19:52:55 +0100 Subject: [PATCH 1/4] fix: job sdk validation Signed-off-by: mikeee --- jobs/go/sdk/README.md | 25 ++++++++++++++----------- jobs/go/sdk/dapr.yaml | 6 +++++- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/jobs/go/sdk/README.md b/jobs/go/sdk/README.md index 682855a8d..cb3ca2c2b 100644 --- a/jobs/go/sdk/README.md +++ b/jobs/go/sdk/README.md @@ -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: - + 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: true + sleep: 120 + timeout_seconds: 180 + --> ```bash dapr run -f . @@ -81,7 +84,7 @@ After 10 seconds, the terminal output should present the `C3-PO` job being proce dapr stop -f . ``` - + ## Run the Jobs APIs individually diff --git a/jobs/go/sdk/dapr.yaml b/jobs/go/sdk/dapr.yaml index a826cb55b..257fa815b 100644 --- a/jobs/go/sdk/dapr.yaml +++ b/jobs/go/sdk/dapr.yaml @@ -1,4 +1,8 @@ version: 1 +common: + daprdLogDestination: console + logLevel: info + schedulerHostAddress: localhost:50006 apps: - appDirPath: ./job-service/ appID: job-service @@ -9,4 +13,4 @@ apps: - appDirPath: ./job-scheduler/ appID: job-scheduler appPort: 6500 - command: ["go", "run", "."] \ No newline at end of file + command: ["go", "run", "."] From 6e89fad25998d82acc0ed5250d69f9f0199bc2b3 Mon Sep 17 00:00:00 2001 From: mikeee Date: Fri, 26 Jul 2024 20:32:40 +0100 Subject: [PATCH 2/4] fix: fix mechanical markdown steps Signed-off-by: mikeee --- jobs/go/http/README.md | 11 +++++++++-- jobs/go/sdk/README.md | 8 +++++++- pub_sub/go/http/README.md | 8 +++++++- pub_sub/go/sdk/README.md | 8 +++++++- service_invocation/go/http/README.md | 8 +++++++- state_management/go/http/README.md | 8 +++++++- state_management/go/sdk/README.md | 9 ++++++++- workflows/go/sdk/README.md | 9 ++++++++- 8 files changed, 60 insertions(+), 9 deletions(-) diff --git a/jobs/go/http/README.md b/jobs/go/http/README.md index 30cab37f9..0c71fb989 100644 --- a/jobs/go/http/README.md +++ b/jobs/go/http/README.md @@ -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 --> @@ -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 ``` + + 2. Stop and clean up application processes + + ```bash dapr stop -f . ``` @@ -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 -``` \ No newline at end of file +``` diff --git a/jobs/go/sdk/README.md b/jobs/go/sdk/README.md index cb3ca2c2b..0938ebd7e 100644 --- a/jobs/go/sdk/README.md +++ b/jobs/go/sdk/README.md @@ -27,7 +27,7 @@ Open a new terminal window and run the multi app run template: expected_stderr_lines: output_match_mode: substring match_order: none - background: true + background: false sleep: 120 timeout_seconds: 180 --> @@ -78,7 +78,13 @@ After 10 seconds, the terminal output should present the `C3-PO` job being proce == APP - job-service == Executing maintenance job: Memory Wipe ``` + + 2. Stop and clean up application processes + ```bash dapr stop -f . diff --git a/pub_sub/go/http/README.md b/pub_sub/go/http/README.md index b56b7f2d8..71294e024 100644 --- a/pub_sub/go/http/README.md +++ b/pub_sub/go/http/README.md @@ -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 --> @@ -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} ``` + 2. Stop and clean up application processes + + ```bash dapr stop -f . ``` diff --git a/pub_sub/go/sdk/README.md b/pub_sub/go/sdk/README.md index 5e78c5c55..2d85e4fb6 100644 --- a/pub_sub/go/sdk/README.md +++ b/pub_sub/go/sdk/README.md @@ -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 --> @@ -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] ``` + 2. Stop and clean up application processes + + ```bash dapr stop -f . diff --git a/service_invocation/go/http/README.md b/service_invocation/go/http/README.md index c36459dc0..e2ad274e1 100644 --- a/service_invocation/go/http/README.md +++ b/service_invocation/go/http/README.md @@ -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 --> @@ -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} ``` + 3. Stop and clean up application processes + + ```bash dapr stop -f . ``` diff --git a/state_management/go/http/README.md b/state_management/go/http/README.md index 1e7d93699..efcc40a44 100644 --- a/state_management/go/http/README.md +++ b/state_management/go/http/README.md @@ -25,7 +25,7 @@ expected_stdout_lines: expected_stderr_lines: output_match_mode: substring match_order: none -background: true +background: false sleep: 15 --> @@ -33,7 +33,13 @@ sleep: 15 dapr run -f . ``` + + 2. Stop and cleanup application process + ```bash dapr stop -f . diff --git a/state_management/go/sdk/README.md b/state_management/go/sdk/README.md index af7bed04e..312c16417 100644 --- a/state_management/go/sdk/README.md +++ b/state_management/go/sdk/README.md @@ -25,7 +25,7 @@ expected_stdout_lines: expected_stderr_lines: output_match_mode: substring match_order: none -background: true +background: false sleep: 15 --> @@ -33,8 +33,15 @@ sleep: 15 dapr run -f . ``` + + 2. Stop and cleanup application process + + ```bash dapr stop -f . ``` diff --git a/workflows/go/sdk/README.md b/workflows/go/sdk/README.md index 55e2e42f1..f329334ee 100644 --- a/workflows/go/sdk/README.md +++ b/workflows/go/sdk/README.md @@ -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 --> @@ -70,10 +70,17 @@ dapr run -f . 4. Stop Dapr workflow with CTRL-C or: + + ```sh dapr stop -f . ``` + + ### View workflow output with Zipkin From 9eb6745141ae69eac62740b165fc2abb57334014 Mon Sep 17 00:00:00 2001 From: mikeee Date: Fri, 26 Jul 2024 20:59:35 +0100 Subject: [PATCH 3/4] chore: remove scheduler host address - already init by default Signed-off-by: mikeee --- jobs/go/sdk/dapr.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/jobs/go/sdk/dapr.yaml b/jobs/go/sdk/dapr.yaml index 257fa815b..4d0f47f98 100644 --- a/jobs/go/sdk/dapr.yaml +++ b/jobs/go/sdk/dapr.yaml @@ -2,7 +2,6 @@ version: 1 common: daprdLogDestination: console logLevel: info - schedulerHostAddress: localhost:50006 apps: - appDirPath: ./job-service/ appID: job-service From e6d852158e2a23f8651156b3ca0e1fdf176cb89d Mon Sep 17 00:00:00 2001 From: mikeee Date: Fri, 26 Jul 2024 21:19:16 +0100 Subject: [PATCH 4/4] ci: override daprd Signed-off-by: mikeee --- .github/workflows/validate_go_quickstarts.yaml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/validate_go_quickstarts.yaml b/.github/workflows/validate_go_quickstarts.yaml index b79a0d052..8c9e5ce68 100644 --- a/.github/workflows/validate_go_quickstarts.yaml +++ b/.github/workflows/validate_go_quickstarts.yaml @@ -95,6 +95,19 @@ 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") @@ -102,13 +115,13 @@ jobs: 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