-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tiltfile
136 lines (119 loc) · 2.41 KB
/
Tiltfile
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# Parse args
config.define_string_list("to-run", args=True)
cfg = config.parse()
resources = [
'go-compile-qms',
'go-compile-sut',
'grafana-agent-logs',
'grafana-agent-metrics',
'grafana-agent-traces',
'grafana',
'loki',
'mimir',
'tempo',
'sut'
]
groups = {
'monolith': ['qms'],
'microservices': ['qms-proxy', 'qms-rate', 'qms-alloc'],
}
for arg in cfg.get('to-run', []):
if arg in groups:
resources += groups[arg]
else:
# also support specifying individual services instead of groups, e.g. `tilt up a b d`
resources.append(arg)
config.set_enabled_resources(resources)
# Compile
local_resource(
'go-compile-qms',
cmd='GOARCH=amd64 GOOS=linux make build',
deps=['./Makefile', './cmd/qms', './internal', './pkg'],
labels=["local-job"],
)
local_resource(
'go-compile-sut',
cmd='GOARCH=amd64 GOOS=linux make build-sut',
deps=['./Makefile', './cmd/sut', './internal', './pkg'],
labels=["local-job"],
)
# Build Docker images
docker_build(
'qms',
'.',
dockerfile='cmd/qms/Dockerfile',
)
docker_build(
'sut',
'.',
dockerfile='cmd/sut/Dockerfile',
)
k8s_yaml(kustomize('./deployments/kubernetes/envs/dev'))
k8s_resource(
'grafana-agent-logs',
labels=['operations'],
)
k8s_resource(
'grafana-agent-metrics',
labels=['operations'],
)
k8s_resource(
'grafana-agent-traces',
labels=['operations'],
)
k8s_resource(
'grafana',
port_forwards=['3000'],
labels=['observability'],
)
k8s_resource(
'loki',
labels=['observability'],
)
k8s_resource(
'mimir',
labels=['observability'],
)
k8s_resource(
'tempo',
labels=['observability'],
)
# Microservices
k8s_resource(
'qms-proxy',
port_forwards=['10000:6789'],
links=[
link("http://localhost:10000/metrics", "/metrics"),
],
labels=["qms"],
)
k8s_resource(
'qms-rate',
port_forwards=['10001:6789'],
links=[
link("http://localhost:10000/metrics", "/metrics"),
],
labels=["qms"],
)
k8s_resource(
'qms-alloc',
port_forwards=['10002:6789'],
links=[
link("http://localhost:10000/metrics", "/metrics"),
],
labels=["qms"],
)
# Monolith
k8s_resource(
'qms',
port_forwards=['10000:6789'],
links=[
link("http://localhost:10000/metrics", "/metrics"),
],
labels=["qms"],
)
k8s_resource(
'sut',
port_forwards=['8080'],
labels=["sut"],
)