-
Notifications
You must be signed in to change notification settings - Fork 3
/
Tiltfile
128 lines (114 loc) · 2.96 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
tilt_settings_file = "./tilt-settings.yaml"
settings = read_yaml(tilt_settings_file)
# Create the sbombastic namespace
# This is required since the helm() function doesn't support the create_namespace flag
load("ext://namespace", "namespace_create")
namespace_create("sbombastic")
controller_image = settings.get("controller").get("image")
storage_image = settings.get("storage").get("image")
worker_image = settings.get("worker").get("image")
yaml = helm(
"./helm",
name="sbombastic",
namespace="sbombastic",
set=[
"controller.image.repository=" + controller_image,
"storage.image.repository=" + storage_image,
"worker.image.repository=" + worker_image,
"controller.replicas=1",
"storage.replicas=1",
"worker.replicas=1"
]
)
k8s_yaml(yaml)
# Hot reloading containers
local_resource(
"controller_tilt",
"make controller",
deps=[
"go.mod",
"go.sum",
"cmd/controller",
"api",
"internal/controller",
],
)
entrypoint = ["/controller"]
dockerfile = "./hack/Dockerfile.controller.tilt"
load("ext://restart_process", "docker_build_with_restart")
docker_build_with_restart(
controller_image,
".",
dockerfile=dockerfile,
entrypoint=entrypoint,
# `only` here is important, otherwise, the container will get updated
# on _any_ file change.
only=[
"./bin/controller",
],
live_update=[
sync("./bin/controller", "/controller"),
],
)
local_resource(
"storage_tilt",
"make storage",
deps=[
"go.mod",
"go.sum",
"cmd/storage",
"api",
"internal/admission",
"internal/apiserver",
"internal/storage",
"pkg"
],
)
entrypoint = ["/storage"]
# We use a specific Dockerfile since tilt can't run on a scratch container.
dockerfile = "./hack/Dockerfile.storage.tilt"
load("ext://restart_process", "docker_build_with_restart")
docker_build_with_restart(
storage_image,
".",
dockerfile=dockerfile,
entrypoint=entrypoint,
# `only` here is important, otherwise, the container will get updated
# on _any_ file change.
only=[
"./bin/storage",
],
live_update=[
sync("./bin/storage", "/storage"),
],
)
local_resource(
"worker_tilt",
"make worker",
deps=[
"go.mod",
"go.sum",
"cmd/worker",
"api",
"internal/messaging",
"internal/handlers",
],
)
entrypoint = ["/worker"]
# We use a specific Dockerfile since tilt can't run on a scratch container.
dockerfile = "./hack/Dockerfile.worker.tilt"
load("ext://restart_process", "docker_build_with_restart")
docker_build_with_restart(
worker_image,
".",
dockerfile=dockerfile,
entrypoint=entrypoint,
# `only` here is important, otherwise, the container will get updated
# on _any_ file change.
only=[
"./bin/worker",
],
live_update=[
sync("./bin/worker", "/worker"),
],
)