forked from chroma-core/chroma
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tiltfile
148 lines (126 loc) · 4.47 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
137
138
139
140
141
142
143
144
145
146
147
148
update_settings(max_parallel_updates=6)
docker_build(
'local:postgres',
context='./k8s/test/postgres',
dockerfile='./k8s/test/postgres/Dockerfile'
)
docker_build(
'local:log-service',
'.',
only=['go/'],
dockerfile='./go/Dockerfile',
target='logservice'
)
docker_build(
'local:sysdb-migration',
'.',
only=['go/'],
dockerfile='./go/Dockerfile.migration',
target='sysdb-migration'
)
docker_build(
'local:logservice-migration',
'.',
only=['go/'],
dockerfile='./go/Dockerfile.migration',
target="logservice-migration"
)
docker_build(
'local:sysdb',
'.',
only=['go/', 'idl/'],
dockerfile='./go/Dockerfile',
target='sysdb'
)
docker_build(
'local:frontend-service',
'.',
only=['chromadb/', 'idl/', 'requirements.txt', 'bin/'],
dockerfile='./Dockerfile',
ignore=['**/*.pyc', 'chromadb/test/'],
)
docker_build(
'local:query-service',
'.',
only=["rust/", "idl/", "Cargo.toml", "Cargo.lock"],
dockerfile='./rust/worker/Dockerfile',
target='query_service'
)
docker_build(
'local:compaction-service',
'.',
only=["rust/", "idl/", "Cargo.toml", "Cargo.lock"],
dockerfile='./rust/worker/Dockerfile',
target='compaction_service'
)
k8s_resource(
objects=['chroma:Namespace'],
new_name='namespace',
labels=["infrastructure"],
)
k8s_yaml(
helm(
'k8s/distributed-chroma',
namespace='chroma',
values=[
'k8s/distributed-chroma/values.yaml'
]
)
)
k8s_yaml([
'k8s/test/postgres.yaml',
])
# Extra stuff to make debugging and testing easier
k8s_yaml([
'k8s/test/jaeger-service.yaml',
'k8s/test/jaeger.yaml',
'k8s/test/minio.yaml',
'k8s/test/test-memberlist-cr.yaml',
])
# Lots of things assume the cluster is in a basic state. Get it into a basic
# state before deploying anything else.
k8s_resource(
objects=[
'pod-watcher:Role',
'memberlists.chroma.cluster:CustomResourceDefinition',
'query-service-memberlist:MemberList',
'compaction-service-memberlist:MemberList',
'sysdb-serviceaccount:serviceaccount',
'sysdb-serviceaccount-rolebinding:RoleBinding',
'sysdb-query-service-memberlist-binding:clusterrolebinding',
'sysdb-compaction-service-memberlist-binding:clusterrolebinding',
'logservice-serviceaccount:serviceaccount',
'query-service-serviceaccount:serviceaccount',
'query-service-serviceaccount-rolebinding:RoleBinding',
'query-service-memberlist-readerwriter:ClusterRole',
'query-service-query-service-memberlist-binding:clusterrolebinding',
'query-service-memberlist-readerwriter-binding:clusterrolebinding',
'compaction-service-memberlist-readerwriter:ClusterRole',
'compaction-service-compaction-service-memberlist-binding:clusterrolebinding',
'compaction-service-memberlist-readerwriter-binding:clusterrolebinding',
'compaction-service-serviceaccount:serviceaccount',
'compaction-service-serviceaccount-rolebinding:RoleBinding',
'test-memberlist:MemberList',
'test-memberlist-reader:ClusterRole',
'test-memberlist-reader-binding:ClusterRoleBinding',
'lease-watcher:role',
'logservice-serviceaccount-rolebinding:rolebinding',
],
new_name='k8s_setup',
labels=["infrastructure"],
resource_deps=['namespace'],
)
# Production Chroma
k8s_resource('postgres', resource_deps=['k8s_setup', 'namespace'], labels=["infrastructure"], port_forwards='5432:5432')
# Jobs are suffixed with the image tag to ensure they are unique. In this context, the image tag is defined in k8s/distributed-chroma/values.yaml.
k8s_resource('sysdb-migration-sysdb-migration', resource_deps=['postgres', 'namespace'], labels=["infrastructure"])
k8s_resource('logservice-migration-logservice-migration', resource_deps=['postgres', 'namespace'], labels=["infrastructure"])
k8s_resource('logservice', resource_deps=['sysdb-migration-sysdb-migration'], labels=["chroma"], port_forwards='50052:50051')
k8s_resource('sysdb', resource_deps=['sysdb-migration-sysdb-migration'], labels=["chroma"], port_forwards='50051:50051')
k8s_resource('frontend-service', resource_deps=['sysdb', 'logservice'],labels=["chroma"], port_forwards='8000:8000')
k8s_resource('query-service', resource_deps=['sysdb'], labels=["chroma"], port_forwards='50053:50051')
k8s_resource('compaction-service', resource_deps=['sysdb'], labels=["chroma"])
# I have no idea why these need their own lines but the others don't.
k8s_resource('jaeger', resource_deps=['k8s_setup'], labels=["debug"])
# Local S3
k8s_resource('minio-deployment', resource_deps=['k8s_setup'], labels=["debug"], port_forwards='9000:9000')