From eab7975f9148a858c747214899cc5d4b0743d8f1 Mon Sep 17 00:00:00 2001 From: Hannah Hunter Date: Fri, 26 Jan 2024 15:19:46 -0500 Subject: [PATCH 1/5] add reqs to multi run instructions Signed-off-by: Hannah Hunter --- .../quickstarts/pubsub-quickstart.md | 58 +++++++++++++++++++ .../serviceinvocation-quickstart.md | 52 +++++++++++++++++ .../quickstarts/statemanagement-quickstart.md | 33 +++++++++++ 3 files changed, 143 insertions(+) diff --git a/daprdocs/content/en/getting-started/quickstarts/pubsub-quickstart.md b/daprdocs/content/en/getting-started/quickstarts/pubsub-quickstart.md index 108225377e6..3b459afebfd 100644 --- a/daprdocs/content/en/getting-started/quickstarts/pubsub-quickstart.md +++ b/daprdocs/content/en/getting-started/quickstarts/pubsub-quickstart.md @@ -51,6 +51,20 @@ From the root of the Quickstarts directory, navigate into the pub/sub directory: cd pub_sub/python/sdk ``` +Install the dependencies for the `order-processor` and `checkout` apps: + +```bash +cd ./checkout +pip3 install -r requirements.txt +cd .. +cd ./order-processor +pip3 install -r requirements.txt +cd .. +cd ./order-processor-fastapi +pip3 install -r requirements.txt +cd .. +``` + ### Step 3: Run the publisher and subscriber With the following command, simultaneously run the following services alongside their own Dapr sidecars: @@ -215,6 +229,17 @@ From the root of the Quickstarts directory, navigate into the pub/sub directory: cd pub_sub/javascript/sdk ``` +Install the dependencies for the `order-processor` and `checkout` apps: + +```bash +cd ./order-processor +npm install +cd .. +cd ./checkout +npm install +cd .. +``` + ### Step 3: Run the publisher and subscriber With the following command, simultaneously run the following services alongside their own Dapr sidecars: @@ -352,6 +377,18 @@ From the root of the Quickstarts directory, navigate into the pub/sub directory: cd pub_sub/csharp/sdk ``` +Install the dependencies for the `order-processor` and `checkout` apps: + +```bash +cd ./order-processor +dotnet restore +dotnet build +cd ../checkout +dotnet restore +dotnet build +cd .. +``` + ### Step 3: Run the publisher and subscriber With the following command, simultaneously run the following services alongside their own Dapr sidecars: @@ -497,6 +534,17 @@ From the root of the Quickstarts directory, navigate into the pub/sub directory: cd pub_sub/java/sdk ``` +Install the dependencies for the `order-processor` and `checkout` apps: + +```bash +cd ./order-processor +mvn clean install +cd .. +cd ./checkout +mvn clean install +cd .. +``` + ### Step 3: Run the publisher and subscriber With the following command, simultaneously run the following services alongside their own Dapr sidecars: @@ -647,6 +695,16 @@ From the root of the Quickstarts directory, navigate into the pub/sub directory: cd pub_sub/go/sdk ``` +Install the dependencies for the `order-processor` and `checkout` apps: + +```bash +cd ./order-processor +go build . +cd ../checkout +go build . +cd .. +``` + ### Step 3: Run the publisher and subscriber With the following command, simultaneously run the following services alongside their own Dapr sidecars: diff --git a/daprdocs/content/en/getting-started/quickstarts/serviceinvocation-quickstart.md b/daprdocs/content/en/getting-started/quickstarts/serviceinvocation-quickstart.md index d75e1a7a6e3..0164e35fddf 100644 --- a/daprdocs/content/en/getting-started/quickstarts/serviceinvocation-quickstart.md +++ b/daprdocs/content/en/getting-started/quickstarts/serviceinvocation-quickstart.md @@ -48,6 +48,16 @@ From the root of the Quickstart clone directory, navigate to the quickstart dire cd service_invocation/python/http ``` +Install the dependencies for the `order-processor` and `checkout` apps: + +```bash +cd ./order-processor +pip3 install -r requirements.txt +cd ../checkout +pip3 install -r requirements.txt +cd .. +``` + ### Step 3: Run the `order-processor` and `checkout` services With the following command, simultaneously run the following services alongside their own Dapr sidecars: @@ -184,6 +194,16 @@ From the root of the Quickstart clone directory, navigate to the quickstart dire cd service_invocation/javascript/http ``` +Install the dependencies for the `order-processor` and `checkout` apps: + +```bash +cd ./order-processor +npm install +cd ../checkout +npm install +cd .. +``` + ### Step 3: Run the `order-processor` and `checkout` services With the following command, simultaneously run the following services alongside their own Dapr sidecars: @@ -314,6 +334,18 @@ From the root of the Quickstart clone directory, navigate to the quickstart dire cd service_invocation/csharp/http ``` +Install the dependencies for the `order-processor` and `checkout` apps: + +```bash +cd ./order-processor +dotnet restore +dotnet build +cd ../checkout +dotnet restore +dotnet build +cd .. +``` + ### Step 3: Run the `order-processor` and `checkout` services With the following command, simultaneously run the following services alongside their own Dapr sidecars: @@ -448,6 +480,16 @@ From the root of the Quickstart clone directory, navigate to the quickstart dire cd service_invocation/java/http ``` +Install the dependencies for the `order-processor` and `checkout` apps: + +```bash +cd ./order-processor +mvn clean install +cd ../checkout +mvn clean install +cd .. +``` + ### Step 3: Run the `order-processor` and `checkout` services With the following command, simultaneously run the following services alongside their own Dapr sidecars: @@ -577,6 +619,16 @@ From the root of the Quickstart clone directory, navigate to the quickstart dire cd service_invocation/go/http ``` +Install the dependencies for the `order-processor` and `checkout` apps: + +```bash +cd ./order-processor +go build . +cd ../checkout +go build . +cd .. +``` + ### Step 3: Run the `order-processor` and `checkout` services With the following command, simultaneously run the following services alongside their own Dapr sidecars: diff --git a/daprdocs/content/en/getting-started/quickstarts/statemanagement-quickstart.md b/daprdocs/content/en/getting-started/quickstarts/statemanagement-quickstart.md index 26d63ae9826..bfa8427da8c 100644 --- a/daprdocs/content/en/getting-started/quickstarts/statemanagement-quickstart.md +++ b/daprdocs/content/en/getting-started/quickstarts/statemanagement-quickstart.md @@ -48,6 +48,12 @@ In a terminal window, navigate to the `order-processor` directory. cd state_management/python/sdk/order-processor ``` +Install the dependencies: + +```bash +pip3 install -r requirements.txt +``` + Run the `order-processor` service alongside a Dapr sidecar using [Multi-App Run]({{< ref multi-app-dapr-run >}}). ```bash @@ -163,6 +169,14 @@ Clone the [sample provided in the Quickstarts repo](https://github.com/dapr/quic git clone https://github.com/dapr/quickstarts.git ``` +Install the dependencies for the `order-processor` app: + +```bash +cd ./order-processor +npm install +cd .. +``` + ### Step 2: Manipulate service state In a terminal window, navigate to the `order-processor` directory. @@ -171,6 +185,12 @@ In a terminal window, navigate to the `order-processor` directory. cd state_management/javascript/sdk/order-processor ``` +Install the dependencies: + +```bash +npm install +``` + Run the `order-processor` service alongside a Dapr sidecar. ```bash @@ -297,6 +317,13 @@ In a terminal window, navigate to the `order-processor` directory. cd state_management/csharp/sdk/order-processor ``` +Install the dependencies: + +```bash +dotnet restore +dotnet build +``` + Run the `order-processor` service alongside a Dapr sidecar. ```bash @@ -557,6 +584,12 @@ In a terminal window, navigate to the `order-processor` directory. cd state_management/go/sdk/order-processor ``` +Install the dependencies: + +```bash +go build . +``` + Run the `order-processor` service alongside a Dapr sidecar. ```bash From c2a51984a735874cc09365a666ae78bbaf28ed2e Mon Sep 17 00:00:00 2001 From: Hannah Hunter Date: Fri, 26 Jan 2024 16:50:43 -0500 Subject: [PATCH 2/5] add workaround Signed-off-by: Hannah Hunter --- .../getting-started/install-dapr-selfhost.md | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/daprdocs/content/en/getting-started/install-dapr-selfhost.md b/daprdocs/content/en/getting-started/install-dapr-selfhost.md index 135c1458746..55168bb1898 100644 --- a/daprdocs/content/en/getting-started/install-dapr-selfhost.md +++ b/daprdocs/content/en/getting-started/install-dapr-selfhost.md @@ -23,9 +23,9 @@ Dapr initialization includes: 1. Running a **Dapr placement service container instance** for local actor support. {{% alert title="Docker" color="primary" %}} -The recommended development environment requires [Docker](https://docs.docker.com/install/). While you can [initialize Dapr without a dependency on Docker]({{}})), the next steps in this guide assume the recommended Docker development environment. +The recommended development environment requires [Docker](https://docs.docker.com/install/). While you can [initialize Dapr without a dependency on Docker]({{< ref self-hosted-no-docker.md >}})), the next steps in this guide assume the recommended Docker development environment. -You can also install [Podman](https://podman.io/) in place of Docker. Read more about [initializing Dapr using Podman]({{}}). +You can also install [Podman](https://podman.io/) in place of Docker. Read more about [initializing Dapr using Podman]({{< ref dapr-init.md >}}). {{% /alert %}} ### Step 1: Open an elevated terminal @@ -54,12 +54,35 @@ Run Windows Terminal or command prompt as administrator. ### Step 2: Run the init CLI command +{{< tabs "Linux/MacOS" "Windows">}} + +{{% codetab %}} + +Install the latest Dapr runtime binaries: + +```bash +dapr init +``` + +**If you are installing on Mac OS Silicon with Docker,** you may need to perform the following workaround to enable `dapr init` to talk to Docker without using Kubernetes. +1. Navigate to **Docker Desktop** > **Settings** > **Advanced**. +1. Select the **Enable default Docker socket** checkbox. + +{{% /codetab %}} + +{{% codetab %}} + Install the latest Dapr runtime binaries: ```bash dapr init ``` +{{% /codetab %}} + +{{< /tabs >}} + + ### Step 3: Verify Dapr version ```bash From fab5b197d2c7ec489e10ce1326ad3dbbd1cb14de Mon Sep 17 00:00:00 2001 From: kaibocai <89094811+kaibocai@users.noreply.github.com> Date: Sat, 27 Jan 2024 07:39:40 -0600 Subject: [PATCH 3/5] Update limitation for js Update limitation for js Signed-off-by: kaibocai <89094811+kaibocai@users.noreply.github.com> --- .../workflow/workflow-features-concepts.md | 51 ++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-features-concepts.md b/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-features-concepts.md index ce39d4bac96..a3dcd7c6bb0 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-features-concepts.md +++ b/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-features-concepts.md @@ -162,7 +162,7 @@ APIs that generate random numbers, random UUIDs, or the current date are _non-de For example, instead of this: -{{< tabs ".NET" Java >}} +{{< tabs ".NET" Java JavaScript >}} {{% codetab %}} @@ -186,6 +186,17 @@ string randomString = GetRandomString(); {{% /codetab %}} +{{% codetab %}} + +```javascript +// DON'T DO THIS! +const currentTime = new Date(); +const newIdentifier = uuidv4(); +const randomString = getRandomString(); +``` + +{{% /codetab %}} + {{< /tabs >}} Do this: @@ -214,6 +225,16 @@ String randomString = context.callActivity(GetRandomString.class.getName(), Stri {{% /codetab %}} +{{% codetab %}} + +```javascript +// Do this!! +const currentTime = context.getCurrentUtcDateTime(); +const randomString = yield context.callActivity(getRandomString); +``` + +{{% /codetab %}} + {{< /tabs >}} @@ -247,6 +268,24 @@ HttpResponse response = HttpClient.newBuilder().build().send(request, Ht {{% /codetab %}} +```javascript +// DON'T DO THIS! +// Accessing an Environment Variable (Node.js) +const configuration = process.env.MY_CONFIGURATION; + +fetch('https://postman-echo.com/get') + .then(response => response.text()) + .then(data => { + console.log(data); + }) + .catch(error => { + console.error('Error:', error); + }); + +``` + +{{% /codetab %}} + {{< /tabs >}} Do this: @@ -273,6 +312,16 @@ String data = ctx.callActivity(MakeHttpCall.class, "https://example.com/api/data {{% /codetab %}} +{{% codetab %}} + +```javascript +// Do this!! +const configuation = workflowInput.getConfiguration(); // imaginary workflow input argument +const data = yield ctx.callActivity(makeHttpCall, "https://example.com/api/data"); +``` + +{{% /codetab %}} + {{< /tabs >}} From da0fd19ce8f02dc1e03d54edf9fb1dc52c967c85 Mon Sep 17 00:00:00 2001 From: kaibocai <89094811+kaibocai@users.noreply.github.com> Date: Sat, 27 Jan 2024 07:42:22 -0600 Subject: [PATCH 4/5] Update workflow-features-concepts.md Signed-off-by: kaibocai <89094811+kaibocai@users.noreply.github.com> --- .../building-blocks/workflow/workflow-features-concepts.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-features-concepts.md b/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-features-concepts.md index a3dcd7c6bb0..ce2000021fc 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-features-concepts.md +++ b/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-features-concepts.md @@ -201,7 +201,7 @@ const randomString = getRandomString(); Do this: -{{< tabs ".NET" Java >}} +{{< tabs ".NET" Java JavaScript >}} {{% codetab %}} @@ -245,7 +245,7 @@ Instead, workflows should interact with external state _indirectly_ using workfl For example, instead of this: -{{< tabs ".NET" Java >}} +{{< tabs ".NET" Java JavaScript >}} {{% codetab %}} @@ -290,7 +290,7 @@ fetch('https://postman-echo.com/get') Do this: -{{< tabs ".NET" Java >}} +{{< tabs ".NET" Java JavaScript >}} {{% codetab %}} From f949c5ae8920e9fbcd02da368629530c4252e4b0 Mon Sep 17 00:00:00 2001 From: kaibocai <89094811+kaibocai@users.noreply.github.com> Date: Wed, 31 Jan 2024 08:46:53 -0600 Subject: [PATCH 5/5] Update daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-features-concepts.md Co-authored-by: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com> Signed-off-by: kaibocai <89094811+kaibocai@users.noreply.github.com> --- .../building-blocks/workflow/workflow-features-concepts.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-features-concepts.md b/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-features-concepts.md index ce2000021fc..17aec65532b 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-features-concepts.md +++ b/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-features-concepts.md @@ -268,6 +268,8 @@ HttpResponse response = HttpClient.newBuilder().build().send(request, Ht {{% /codetab %}} +{{% codetab %}} + ```javascript // DON'T DO THIS! // Accessing an Environment Variable (Node.js)