Skip to content

Commit fe7e102

Browse files
committed
Updating readme and some tests
Signed-off-by: Ryan Lettieri <ryanLettieri@microsoft.com>
1 parent a654c0d commit fe7e102

File tree

4 files changed

+530
-1
lines changed

4 files changed

+530
-1
lines changed

examples/dts/README.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,13 @@ This directory contains examples of how to author durable orchestrations using t
44

55
## Prerequisites
66

7-
All the examples assume that you have a Durable Task Scheduler taskhub created.
7+
There are 2 separate ways to run an example:
8+
1. Using the emulator.
9+
2. Using a real scheduler and taskhub.
810

11+
All the examples by defualt assume that you have a Durable Task Scheduler taskhub created.
12+
13+
## Running with a scheduler and taskhub resource
914
The simplest way to create a taskhub is by using the az cli commands:
1015

1116
1. Create a scheduler:
@@ -46,6 +51,29 @@ The simplest way to create a taskhub is by using the az cli commands:
4651

4752
1. Grant yourself the `Durable Task Data Contributor` role over your scheduler
4853

54+
## Running with the emulator
55+
The emulator is a simulation of a scheduler and taskhub. It is the 'backend' of the durabletask-azuremanaged system packaged up into an easy to use docker container. For these steps, it is assumed that you are using port 8080.
56+
57+
In order to use the emulator for the examples, perform the following steps:
58+
1. Install docker if it is not already installed.
59+
60+
2. Pull down the docker image for the emulator:
61+
`docker pull mcr.microsoft.com/dts/dts-emulator:v0.0.4`
62+
63+
3. Run the emulator and wait a few seconds for the container to be ready:
64+
`docker run --name dtsemulator -d -p 8080:8080 mcr.microsoft.com/dts/dts-emulator:v0.0.4`
65+
66+
4. Set the environment variables that are referenced and used in the examples:
67+
1. If you are using windows powershell:
68+
`$env:TASKHUB=default`
69+
`$env:ENDPOINT=http://localhost:8080`
70+
2. If you are using bash:
71+
`export TASKHUB=default`
72+
`export ENDPOINT=http://localhost:8080`
73+
74+
5. Finally, edit the examples to change the `token_credential` input of both the `DurableTaskSchedulerWorker` and `DurableTaskSchedulerClient` to a value of `None`
75+
76+
4977
## Running the examples
5078

5179
Now, you can simply execute any of the examples in this directory using `python3`:

tests/__init__.py

Whitespace-only changes.

tests/durabletask-azuremanaged/test_activity_sequence.py renamed to tests/durabletask-azuremanaged/test_dts_activity_sequence.py

File renamed without changes.

0 commit comments

Comments
 (0)