-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathEarthfile
More file actions
381 lines (273 loc) · 8.82 KB
/
Copy pathEarthfile
File metadata and controls
381 lines (273 loc) · 8.82 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
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
VERSION 0.8
FROM golang:1.26.0-alpine
# install gcc dependencies into alpine for CGO
RUN apk --no-cache add git ca-certificates gcc musl-dev libc-dev binutils-gold curl openssh
# install docker tools
# https://docs.docker.com/engine/install/debian/
RUN apk add --update --no-cache docker
# install the go generator plugins
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
RUN go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
RUN export PATH="$PATH:$(go env GOPATH)/bin"
# install buf from source
RUN GO111MODULE=on GOBIN=/usr/local/bin go install github.com/bufbuild/buf/cmd/buf@v1.59.0
# install oapi to generate swagger
RUN go install github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen@v2.6.0
# install the various tools to generate connect-go
RUN go install github.com/fullstorydev/grpcurl/cmd/grpcurl@latest
RUN go install connectrpc.com/connect/cmd/protoc-gen-connect-go@latest
all:
BUILD +protogen
BUILD +opengen
BUILD +opengen-k8s-v2
BUILD +opengen-multi-dc
BUILD +opengen-saga
code:
WORKDIR /app
# download deps
COPY go.mod go.sum ./
RUN go mod download -x
# copy in code
COPY --dir . ./
vendor:
FROM +code
RUN go mod tidy && go mod vendor
SAVE ARTIFACT /app /files
protogen:
# copy the proto files to generate
COPY --dir protos/ ./
COPY buf.yaml buf.gen.yaml ./
# generate the pbs
RUN buf generate \
--template buf.gen.yaml \
--path protos/sample \
--path protos/helloworld \
--path protos/chat
# save artifact to
SAVE ARTIFACT gen/sample AS LOCAL internal/samplepb
SAVE ARTIFACT gen/chat AS LOCAL internal/chatpb
SAVE ARTIFACT gen/helloworld AS LOCAL internal/helloworldpb
opengen:
WORKDIR /app
COPY goakt-actors-cluster/dnssd-v2/api/openapi.yaml goakt-actors-cluster/dnssd-v2/api/cfg.yaml goakt-actors-cluster/dnssd-v2/api/
RUN cd goakt-actors-cluster/dnssd-v2/api && oapi-codegen -config cfg.yaml openapi.yaml
SAVE ARTIFACT goakt-actors-cluster/dnssd-v2/api/api.gen.go AS LOCAL goakt-actors-cluster/dnssd-v2/api/
opengen-k8s-v2:
WORKDIR /app
COPY goakt-actors-cluster/k8s-v2/api/openapi.yaml goakt-actors-cluster/k8s-v2/api/cfg.yaml goakt-actors-cluster/k8s-v2/api/
RUN cd goakt-actors-cluster/k8s-v2/api && oapi-codegen -config cfg.yaml openapi.yaml
SAVE ARTIFACT goakt-actors-cluster/k8s-v2/api/api.gen.go AS LOCAL goakt-actors-cluster/k8s-v2/api/
opengen-saga:
WORKDIR /app
COPY goakt-saga/api/openapi.yaml goakt-saga/api/cfg.yaml goakt-saga/api/
RUN cd goakt-saga/api && oapi-codegen -config cfg.yaml openapi.yaml
SAVE ARTIFACT goakt-saga/api/api.gen.go AS LOCAL goakt-saga/api/
opengen-multi-dc:
WORKDIR /app
COPY goakt-cluster/multi-dc/api/openapi.yaml goakt-cluster/multi-dc/api/cfg.yaml goakt-cluster/multi-dc/api/
RUN cd goakt-cluster/multi-dc/api && oapi-codegen -config cfg.yaml openapi.yaml
SAVE ARTIFACT goakt-cluster/multi-dc/api/api.gen.go AS LOCAL goakt-cluster/multi-dc/api/
compile-multi-dc:
COPY +vendor/files ./
RUN go build -mod=vendor -o bin/accounts ./goakt-cluster/multi-dc
SAVE ARTIFACT bin/accounts /accounts
multi-dc-image:
FROM alpine:3.21
WORKDIR /app
COPY +compile-multi-dc/accounts ./accounts
RUN chmod +x ./accounts
EXPOSE 50051
EXPOSE 50052
EXPOSE 3322
EXPOSE 3320
ENTRYPOINT ["./accounts"]
SAVE IMAGE accounts:dev-multi-dc
compile-multi-dc-isolated:
COPY +vendor/files ./
RUN go build -mod=vendor -o bin/accounts ./goakt-cluster/multi-dc-isolated
SAVE ARTIFACT bin/accounts /accounts
multi-dc-isolated-image:
FROM alpine:3.21
WORKDIR /app
COPY +compile-multi-dc-isolated/accounts ./accounts
RUN chmod +x ./accounts
EXPOSE 50051 50052 50053 50054 50061 50071 3320 3321 3322 3323 3324
ENTRYPOINT ["./accounts"]
SAVE IMAGE accounts:dev-multi-dc-isolated
compile-goakt-ai:
COPY +vendor/files ./
RUN go build -mod=vendor -o bin/goakt-ai ./goakt-ai
SAVE ARTIFACT bin/goakt-ai /goakt-ai
goakt-ai-image:
FROM alpine:3.21
WORKDIR /app
COPY +compile-goakt-ai/goakt-ai ./goakt-ai
RUN chmod +x ./goakt-ai
EXPOSE 50051
EXPOSE 50052
EXPOSE 3322
EXPOSE 3320
ENTRYPOINT ["./goakt-ai"]
SAVE IMAGE goakt-ai:dev
compile-k8s:
COPY +vendor/files ./
RUN go build -mod=vendor -o bin/accounts ./goakt-actors-cluster/k8s
SAVE ARTIFACT bin/accounts /accounts
k8s-image:
FROM alpine:3.21
WORKDIR /app
COPY +compile-k8s/accounts ./accounts
RUN chmod +x ./accounts
# expose the various ports in the container
EXPOSE 50051
EXPOSE 50052
EXPOSE 3322
EXPOSE 3320
ENTRYPOINT ["./accounts"]
SAVE IMAGE accounts:dev-k8s
compile-k8s-v2:
COPY +vendor/files ./
RUN go build -mod=vendor -o bin/accounts ./goakt-actors-cluster/k8s-v2
SAVE ARTIFACT bin/accounts /accounts
k8s-v2-image:
FROM alpine:3.21
WORKDIR /app
COPY +compile-k8s-v2/accounts ./accounts
RUN chmod +x ./accounts
# expose the various ports in the container
EXPOSE 50051
EXPOSE 50052
EXPOSE 3322
EXPOSE 3320
ENTRYPOINT ["./accounts"]
SAVE IMAGE accounts:dev-k8s-v2
compile-saga:
COPY +vendor/files ./
RUN go build -mod=vendor -o bin/saga-transfer ./goakt-saga
SAVE ARTIFACT bin/saga-transfer /saga-transfer
saga-image:
FROM alpine:3.21
WORKDIR /app
COPY +compile-saga/saga-transfer ./saga-transfer
RUN chmod +x ./saga-transfer
EXPOSE 50051
EXPOSE 50052
EXPOSE 3322
EXPOSE 3320
ENTRYPOINT ["./saga-transfer"]
SAVE IMAGE saga-transfer:dev
compile-two-pc:
COPY +vendor/files ./
RUN go build -mod=vendor -o bin/two-pc-transfer ./goakt-2pc
SAVE ARTIFACT bin/two-pc-transfer /two-pc-transfer
two-pc-image:
FROM alpine:3.21
WORKDIR /app
COPY +compile-two-pc/two-pc-transfer ./two-pc-transfer
RUN chmod +x ./two-pc-transfer
EXPOSE 50051
EXPOSE 50052
EXPOSE 3322
EXPOSE 3320
ENTRYPOINT ["./two-pc-transfer"]
SAVE IMAGE two-pc-transfer:dev
compile-k8s-ebpf:
COPY +vendor/files ./
RUN go build -mod=vendor -o bin/accounts ./goakt-actors-cluster/k8s-ebpf
SAVE ARTIFACT bin/accounts /accounts
k8s-ebpf-image:
FROM alpine:3.21
WORKDIR /app
COPY +compile-k8s-ebpf/accounts ./accounts
RUN chmod +x ./accounts
EXPOSE 50051
EXPOSE 50052
EXPOSE 3322
EXPOSE 3320
ENTRYPOINT ["./accounts"]
SAVE IMAGE accounts:dev-k8s-ebpf
compile-dnssd:
COPY +vendor/files ./
RUN go build -mod=vendor -o bin/accounts ./goakt-actors-cluster/dnssd
SAVE ARTIFACT bin/accounts /accounts
dnssd-image:
FROM alpine:3.21
WORKDIR /app
COPY +compile-dnssd/accounts ./accounts
RUN chmod +x ./accounts
# expose the various ports in the container
EXPOSE 50051
EXPOSE 50052
EXPOSE 3322
EXPOSE 3320
EXPOSE 9092
ENTRYPOINT ["./accounts"]
SAVE IMAGE accounts:dev
compile-static:
COPY +vendor/files ./
RUN go build -mod=vendor -o bin/accounts ./goakt-actors-cluster/static
SAVE ARTIFACT bin/accounts /accounts
static-image:
FROM alpine:3.21
WORKDIR /app
COPY +compile-static/accounts ./accounts
RUN chmod +x ./accounts
# expose the various ports in the container
EXPOSE 50051
EXPOSE 50052
EXPOSE 3322
EXPOSE 3320
EXPOSE 9092
ENTRYPOINT ["./accounts"]
SAVE IMAGE accounts:dev
compile-grains-dnssd:
COPY +vendor/files ./
RUN go build -mod=vendor -o bin/accounts ./goakt-grains-cluster/grains-dnssd
SAVE ARTIFACT bin/accounts /accounts
dnssd-grains-image:
FROM alpine:3.21
WORKDIR /app
COPY +compile-grains-dnssd/accounts ./accounts
RUN chmod +x ./accounts
# expose the various ports in the container
EXPOSE 50051
EXPOSE 50052
EXPOSE 3322
EXPOSE 3320
EXPOSE 9092
ENTRYPOINT ["./accounts"]
SAVE IMAGE accounts-grains:dev
compile-dnssd-v2:
COPY +vendor/files ./
RUN go build -mod=vendor -o bin/accounts ./goakt-actors-cluster/dnssd-v2
SAVE ARTIFACT bin/accounts /accounts
dnssd-v2-image:
FROM alpine:3.21
WORKDIR /app
COPY +compile-dnssd-v2/accounts ./accounts
RUN chmod +x ./accounts
# expose the various ports in the container
EXPOSE 50051
EXPOSE 50052
EXPOSE 3322
EXPOSE 3320
EXPOSE 9092
ENTRYPOINT ["./accounts"]
SAVE IMAGE accounts:dev
compile-dynalloc:
COPY +vendor/files ./
RUN go build -mod=vendor -o bin/accounts ./goakt-actors-cluster/dynalloc
SAVE ARTIFACT bin/accounts /accounts
dynalloc-image:
FROM alpine:3.21
WORKDIR /app
COPY +compile-dynalloc/accounts ./accounts
RUN chmod +x ./accounts
# expose the various ports in the container
EXPOSE 50051
EXPOSE 50052
EXPOSE 3322
EXPOSE 3320
EXPOSE 9092
ENTRYPOINT ["./accounts"]
SAVE IMAGE accounts:dev-dynalloc