diff --git a/.github/env/global.env b/.github/env/global.env index 15e1ac280..4087a8875 100644 --- a/.github/env/global.env +++ b/.github/env/global.env @@ -1,5 +1,5 @@ - DAPR_CLI_VERSION: 1.12.0-rc.1 - DAPR_RUNTIME_VERSION: 1.12.0-rc.3 + DAPR_CLI_VERSION: 1.12.0-rc.2 + DAPR_RUNTIME_VERSION: 1.12.0-rc.4 DAPR_INSTALL_URL: https://raw.githubusercontent.com/dapr/cli/v${DAPR_CLI_VERSION}/install/ DAPR_DEFAULT_IMAGE_REGISTRY: ghcr MACOS_PYTHON_VERSION: 3.10 diff --git a/workflows/components/state_redis.yaml b/workflows/components/state_redis.yaml index 6d568d969..7c45ff885 100644 --- a/workflows/components/state_redis.yaml +++ b/workflows/components/state_redis.yaml @@ -1,7 +1,7 @@ apiVersion: dapr.io/v1alpha1 kind: Component metadata: - name: statestore-actors + name: statestore spec: type: state.redis version: v1 diff --git a/workflows/csharp/sdk/README.md b/workflows/csharp/sdk/README.md index 22f58c642..bd96dfd71 100644 --- a/workflows/csharp/sdk/README.md +++ b/workflows/csharp/sdk/README.md @@ -33,18 +33,17 @@ dotnet build ```bash -cd ./order-processor -dapr run --app-id order-processor dotnet run +dapr run -f . ``` diff --git a/workflows/csharp/sdk/dapr.yaml b/workflows/csharp/sdk/dapr.yaml new file mode 100644 index 000000000..a97cac6e5 --- /dev/null +++ b/workflows/csharp/sdk/dapr.yaml @@ -0,0 +1,7 @@ +version: 1 +common: + resourcesPath: ../../components +apps: + - appID: order-processor + appDirPath: ./order-processor/ + command: ["dotnet", "run"] diff --git a/workflows/python/sdk/README.md b/workflows/python/sdk/README.md index 14664eeb0..6c762d5a5 100644 --- a/workflows/python/sdk/README.md +++ b/workflows/python/sdk/README.md @@ -25,6 +25,7 @@ name: Install requirements ```sh cd ./order-processor pip3 install -r requirements.txt +cd .. ``` @@ -33,20 +34,17 @@ pip3 install -r requirements.txt name: Running this example expected_stdout_lines: - "There are now 90 cars left in stock" - - "Purchase of item is Completed" + - "Workflow completed! Result: Completed" output_match_mode: substring background: true -timeout_seconds: 30 +timeout_seconds: 120 sleep: 15 --> ```sh -cd ./order-processor -dapr run --app-id order-processor --resources-path ../../../components/ -- python3 app.py +dapr run -f . ``` - - 3. Expected output ``` @@ -71,6 +69,15 @@ Workflow completed! Result: Completed Purchase of item is Completed ``` +4. Stop Dapr workflow with CTRL-C or: + + +```sh +dapr stop -f . +``` + + + ### View workflow output with Zipkin For a more detailed view of the workflow activities (duration, progress etc.), try using Zipkin. diff --git a/workflows/python/sdk/dapr.yaml b/workflows/python/sdk/dapr.yaml new file mode 100644 index 000000000..ac5f1e4e0 --- /dev/null +++ b/workflows/python/sdk/dapr.yaml @@ -0,0 +1,7 @@ +version: 1 +common: + resourcesPath: ../../components +apps: + - appDirPath: ./order-processor/ + appID: order-processor + command: ["python3", "app.py"] diff --git a/workflows/python/sdk/order-processor/app.py b/workflows/python/sdk/order-processor/app.py index 08e3f4ce8..4d2003897 100644 --- a/workflows/python/sdk/order-processor/app.py +++ b/workflows/python/sdk/order-processor/app.py @@ -10,7 +10,7 @@ verify_inventory_activity, update_inventory_activity, requst_approval_activity from model import InventoryItem, OrderPayload -store_name = "statestore-actors" +store_name = "statestore" workflow_component = "dapr" workflow_name = "order_processing_workflow" default_item_name = "cars" @@ -108,7 +108,7 @@ def restock_inventory(self, daprClient: DaprClient, baseInventory): print(f'item: {item}') item_str = f'{{"name": "{item.item_name}", "quantity": {item.quantity},\ "per_item_cost": {item.per_item_cost}}}' - daprClient.save_state("statestore-actors", key, item_str) + daprClient.save_state(store_name, key, item_str) if __name__ == '__main__': app = WorkflowConsoleApp() diff --git a/workflows/python/sdk/order-processor/workflow.py b/workflows/python/sdk/order-processor/workflow.py index 1058e265d..e93443fd5 100644 --- a/workflows/python/sdk/order-processor/workflow.py +++ b/workflows/python/sdk/order-processor/workflow.py @@ -10,7 +10,7 @@ from model import InventoryItem, Notification, InventoryRequest, OrderPayload, OrderResult,\ PaymentRequest, InventoryResult -store_name = "statestore-actors" +store_name = "statestore" logging.basicConfig(level=logging.INFO)