Repository navigation
Expand file tree
/
Copy pathdevfile.yaml
More file actions
76 lines (72 loc) · 2.48 KB
/
Copy pathdevfile.yaml
File metadata and controls
76 lines (72 loc) · 2.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
schemaVersion: 2.3.0
metadata:
name: workshop-python-kafka
version: 1.0.0
description: Grid operations dashboard — wire up sidecars and watch the data flow
attributes:
che-editor: vscode
components:
- name: tools
container:
image: image-registry.openshift-image-registry.svc:5000/workspace-images/udi-rhel9:latest
endpoints:
- exposure: public
name: grid-dashboard
protocol: https
targetPort: 8080
path: /
env:
- name: KAFKA_BOOTSTRAP_SERVERS
value: localhost:9092
- name: KAFKA_TOPIC
value: meter-readings
- name: KAFKA_GROUP_ID
value: grid-dashboard
cpuLimit: '2'
cpuRequest: '500m'
memoryLimit: '4Gi'
memoryRequest: '2Gi'
mountSources: true
# ---------------------------------------------------------------
# TODO — Task 1: Add the Kafka sidecar component below this line
# See the lab guide in docs/index.md for the YAML to paste in.
# ---------------------------------------------------------------
# ---------------------------------------------------------------
# TODO — Task 4: Add the datasette sidecar component below this line
# See the lab guide in docs/index.md for the YAML to paste in.
# ---------------------------------------------------------------
# ---------------------------------------------------------------
# TODO — Task 6: Add the electricity price sidecar below this line
# See the lab guide in docs/index.md for the YAML to paste in.
# ---------------------------------------------------------------
commands:
- id: 1-install
exec:
label: "1. Install dependencies"
component: tools
workingDir: ${PROJECT_SOURCE}
commandLine: "python3.11 -m pip install -r requirements-dev.txt"
group:
kind: build
isDefault: true
- id: 2-start
exec:
label: "2. Start HomeGrid dashboard"
component: tools
workingDir: ${PROJECT_SOURCE}
commandLine: "python3.11 -m uvicorn app.main:app --host 0.0.0.0 --port 8080 --reload"
group:
kind: run
isDefault: true
- id: 3-create-topic
exec:
label: "3. Create meter-readings topic"
component: tools
workingDir: ${PROJECT_SOURCE}
commandLine: "python3.11 -m app.create_topic"
- id: 4-produce
exec:
label: "4. Start meter reading producer"
component: tools
workingDir: ${PROJECT_SOURCE}
commandLine: "python3.11 -m app.producer"