Skip to content

Commit 105869c

Browse files
committed
updates
Signed-off-by: Kendall Roden <[email protected]>
1 parent 0c067c7 commit 105869c

File tree

3 files changed

+46
-46
lines changed

3 files changed

+46
-46
lines changed

jobs/python/sdk/README.md

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -39,21 +39,21 @@ pip3 install -r requirements.txt
3939
name: Run multi app run template
4040
expected_stdout_lines:
4141
- '== APP - job-scheduler-sdk == Sending request to schedule job: R2-D2'
42-
- '== APP - job-service == Scheduling job: R2-D2'
43-
- '== APP - job-service == Job scheduled: R2-D2'
44-
- '== APP - job-scheduler == Response: {"name":"R2-D2","job":"Oil Change","dueTime":15}'
45-
- '== APP - job-scheduler == Sending request to retrieve job: R2-D2'
46-
- '== APP - job-service == Retrieving job: R2-D2'
47-
- '== APP - job-scheduler == Job details for R2-D2: {"name":"R2-D2","due_time":"15s","data":{"droid":"R2-D2","task":"Oil Change"}}'
48-
- '== APP - job-scheduler == Sending request to schedule job: C-3PO'
49-
- '== APP - job-service == Scheduling job: C-3PO'
50-
- '== APP - job-service == Job scheduled: C-3PO'
51-
- '== APP - job-service == Starting droid: R2-D2'
52-
- '== APP - job-service == Executing maintenance job: Oil Change'
53-
- '== APP - job-scheduler == Response: {"name":"C-3PO","job":"Limb Calibration","dueTime":20}'
54-
- '== APP - job-scheduler == Sending request to retrieve job: C-3PO'
55-
- '== APP - job-service == Retrieving job: C-3PO'
56-
- '== APP - job-scheduler == Job details for C-3PO: {"name":"C-3PO","due_time":"20s","data":{"droid":"C-3PO","task":"Limb Calibration"}}'
42+
- '== APP - job-service-sdk == Scheduling job: R2-D2'
43+
- '== APP - job-service-sdk == Job scheduled: R2-D2'
44+
- '== APP - job-scheduler-sdk == Response: {"name":"R2-D2","job":"Oil Change","dueTime":15}'
45+
- '== APP - job-scheduler-sdk == Sending request to retrieve job: R2-D2'
46+
- '== APP - job-service-sdk == Retrieving job: R2-D2'
47+
- '== APP - job-scheduler-sdk == Job details for R2-D2: {"name":"R2-D2","due_time":"15s","data":{"droid":"R2-D2","task":"Oil Change"}}'
48+
- '== APP - job-scheduler-sdk == Sending request to schedule job: C-3PO'
49+
- '== APP - job-service-sdk == Scheduling job: C-3PO'
50+
- '== APP - job-service-sdk == Job scheduled: C-3PO'
51+
- '== APP - job-service-sdk == Starting droid: R2-D2'
52+
- '== APP - job-service-sdk == Executing maintenance job: Oil Change'
53+
- '== APP - job-scheduler-sdk == Response: {"name":"C-3PO","job":"Limb Calibration","dueTime":20}'
54+
- '== APP - job-scheduler-sdk == Sending request to retrieve job: C-3PO'
55+
- '== APP - job-service-sdk == Retrieving job: C-3PO'
56+
- '== APP - job-scheduler-sdk == Job details for C-3PO: {"name":"C-3PO","due_time":"20s","data":{"droid":"C-3PO","task":"Limb Calibration"}}'
5757
expected_stderr_lines:
5858
output_match_mode: substring
5959
match_order: none
@@ -76,29 +76,29 @@ The terminal console output should look similar to this, where:
7676
- The `C-3PO` job is being executed after 20 seconds.
7777

7878
```text
79-
== APP - job-scheduler == Sending request to schedule job: R2-D2
80-
== APP - job-service == Scheduling job: R2-D2
81-
== APP - job-service == client.schedule_job_alpha1(job=job, overwrite=True)
82-
== APP - job-service == Job scheduled: R2-D2
83-
== APP - job-service == INFO: 192.168.1.106:0 - "POST /scheduleJob HTTP/1.1" 200 OK
84-
== APP - job-scheduler == Response: {"name":"R2-D2","job":"Oil Change","dueTime":15}
85-
== APP - job-scheduler == Sending request to retrieve job: R2-D2
86-
== APP - job-service == job = client.get_job_alpha1(name)
87-
== APP - job-service == Retrieving job: R2-D2
88-
== APP - job-service == INFO: 192.168.1.106:0 - "GET /getJob/R2-D2 HTTP/1.1" 200 OK
89-
== APP - job-scheduler == Job details for R2-D2: {"name":"R2-D2","due_time":"15s","data":{"droid":"R2-D2","task":"Oil Change"}}
90-
== APP - job-scheduler == Sending request to schedule job: C-3PO
91-
== APP - job-service == Scheduling job: C-3PO
92-
== APP - job-service == Job scheduled: C-3PO
93-
== APP - job-service == INFO: 192.168.1.106:0 - "POST /scheduleJob HTTP/1.1" 200 OK
94-
== APP - job-service == Starting droid: R2-D2
95-
== APP - job-service == Executing maintenance job: Oil Change
96-
== APP - job-service == INFO: 127.0.0.1:57206 - "POST /job/R2-D2 HTTP/1.1" 200 OK
97-
== APP - job-scheduler == Response: {"name":"C-3PO","job":"Limb Calibration","dueTime":20}
98-
== APP - job-scheduler == Sending request to retrieve job: C-3PO
99-
== APP - job-service == Retrieving job: C-3PO
100-
== APP - job-service == INFO: 192.168.1.106:0 - "GET /getJob/C-3PO HTTP/1.1" 200 OK
101-
== APP - job-scheduler == Job details for C-3PO: {"name":"C-3PO","due_time":"20s","data":{"droid":"C-3PO","task":"Limb Calibration"}}
79+
== APP - job-scheduler-sdk == Sending request to schedule job: R2-D2
80+
== APP - job-service-sdk == Scheduling job: R2-D2
81+
== APP - job-service-sdk == client.schedule_job_alpha1(job=job, overwrite=True)
82+
== APP - job-service-sdk == Job scheduled: R2-D2
83+
== APP - job-service-sdk == INFO: 192.168.1.106:0 - "POST /scheduleJob HTTP/1.1" 200 OK
84+
== APP - job-scheduler-sdk == Response: {"name":"R2-D2","job":"Oil Change","dueTime":15}
85+
== APP - job-scheduler-sdk == Sending request to retrieve job: R2-D2
86+
== APP - job-service-sdk == job = client.get_job_alpha1(name)
87+
== APP - job-service-sdk == Retrieving job: R2-D2
88+
== APP - job-service-sdk == INFO: 192.168.1.106:0 - "GET /getJob/R2-D2 HTTP/1.1" 200 OK
89+
== APP - job-scheduler-sdk == Job details for R2-D2: {"name":"R2-D2","due_time":"15s","data":{"droid":"R2-D2","task":"Oil Change"}}
90+
== APP - job-scheduler-sdk == Sending request to schedule job: C-3PO
91+
== APP - job-service-sdk == Scheduling job: C-3PO
92+
== APP - job-service-sdk == Job scheduled: C-3PO
93+
== APP - job-service-sdk == INFO: 192.168.1.106:0 - "POST /scheduleJob HTTP/1.1" 200 OK
94+
== APP - job-service-sdk == Starting droid: R2-D2
95+
== APP - job-service-sdk == Executing maintenance job: Oil Change
96+
== APP - job-service-sdk == INFO: 127.0.0.1:57206 - "POST /job/R2-D2 HTTP/1.1" 200 OK
97+
== APP - job-scheduler-sdk == Response: {"name":"C-3PO","job":"Limb Calibration","dueTime":20}
98+
== APP - job-scheduler-sdk == Sending request to retrieve job: C-3PO
99+
== APP - job-service-sdk == Retrieving job: C-3PO
100+
== APP - job-service-sdk == INFO: 192.168.1.106:0 - "GET /getJob/C-3PO HTTP/1.1" 200 OK
101+
== APP - job-scheduler-sdk == Job details for C-3PO: {"name":"C-3PO","due_time":"20s","data":{"droid":"C-3PO","task":"Limb Calibration"}}
102102
```
103103

104104
<!-- END_STEP -->
@@ -120,14 +120,14 @@ dapr stop -f .
120120

121121
### Schedule jobs
122122

123-
1. Open a terminal and run the `job-service` app. Build the dependencies if you haven't already.
123+
1. Open a terminal and run the `job-service-sdk` app. Build the dependencies if you haven't already.
124124

125125
```bash
126126
pip3 install -r requirements.txt
127127
```
128128

129129
```bash
130-
cd job-service
130+
cd job-service-sdk
131131
dapr run --app-id job-service-sdk --app-port 6200 --dapr-http-port 6280 --dapr-grpc-port 6281 -- python app.py
132132
```
133133

@@ -144,7 +144,7 @@ curl -X POST \
144144
}'
145145
```
146146

147-
In the `job-service` terminal window, the output should be:
147+
In the `job-service-sdk` terminal window, the output should be:
148148

149149
```text
150150
@@ -203,7 +203,7 @@ You should see the following:
203203
curl -X GET http://localhost:6200/getJob/C-3PO -H "Content-Type: application/json"
204204
```
205205

206-
In the `job-service` terminal window, the output should be similar to the following:
206+
In the `job-service-sdk` terminal window, the output should be similar to the following:
207207

208208
```text
209209
{"detail":"<_InactiveRpcError of RPC that terminated with:\n\tstatus = StatusCode.INTERNAL\n\tdetails = \"failed to get job due to: rpc error: code = NotFound desc = job not found: C-3PO\"\n\tdebug_error_string = \"UNKNOWN:Error received from peer ipv4:127.0.0.1:6281 {grpc_status:13, grpc_message:\"failed to get job due to: rpc error: code = NotFound desc = job not found: C-3PO\"}\"\n>"}

jobs/python/sdk/dapr.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
version: 1
22
apps:
3-
- appDirPath: ./job-service/
3+
- appDirPath: ./job-service-sdk/
44
appID: job-service-sdk
55
appPort: 6200
66
daprHTTPPort: 6280
77
daprGRPCPort: 6281
88
appLogDestination: console
99
daprdLogDestination: console
1010
command: ["python3", "app.py"]
11-
- appDirPath: ./job-scheduler/
11+
- appDirPath: ./job-scheduler-sdk/
1212
appID: job-scheduler-sdk
1313
appPort: 6300
1414
daprHTTPPort: 6380

jobs/python/sdk/job-scheduler/app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def schedule_job(job: DroidJob) -> None:
3333
"dueTime": job.due_time
3434
}
3535

36-
# Use HTTP client to call the job-service via Dapr
36+
# Use HTTP client to call the job-service-sdk via Dapr
3737
req_url = f"{dapr_host}:{dapr_port}/v1.0/invoke/job-service-sdk/method/scheduleJob"
3838

3939
response = requests.post(
@@ -61,7 +61,7 @@ def get_job_details(job: DroidJob) -> None:
6161
print(f"Sending request to retrieve job: {job.name}", flush=True)
6262

6363
try:
64-
# Use HTTP client to call the job-service via Dapr
64+
# Use HTTP client to call the job-service-sdk via Dapr
6565
req_url = f"{dapr_host}:{dapr_port}/v1.0/invoke/job-service-sdk/method/getJob/{job.name}"
6666

6767
response = requests.get(req_url)

0 commit comments

Comments
 (0)