Skip to content

Commit

Permalink
[ENH] Add cache mounts to query and compactor services (#2919)
Browse files Browse the repository at this point in the history
## Description of changes
 - New functionality
- this adds a `/cache` volume mount to our query and compaction services
as well as a `CACHE_PATH` environment variable with the setting.

## Test plan
- `tilt up` -- verify that the `compaction-service` and `query-service`
pods come up with the expected k8s config.

- [x] (n/a) Tests pass locally with `pytest` for python, `yarn test` for
js, `cargo test` for rust

## Documentation Changes
n/a
  • Loading branch information
eculver authored Oct 14, 2024
1 parent 7b1882e commit f66222f
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 18 deletions.
18 changes: 14 additions & 4 deletions k8s/distributed-chroma/templates/compaction-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,31 @@ spec:
member-type: compaction-service
spec:
serviceAccountName: compaction-service-serviceaccount
{{if .Values.compactionService.configuration}}
volumes:
{{if .Values.compactionService.configuration}}
- name: compaction-service-config
configMap:
name: compaction-service-config
{{ end }}
{{ end }}
{{if .Values.compactionService.cache}}
- name: compaction-service-cache
hostPath:
path: {{ .Values.compactionService.cache.hostPath }}
type: DirectoryOrCreate
{{ end }}
containers:
- name: compaction-service
image: "{{ .Values.compactionService.image.repository }}:{{ .Values.compactionService.image.tag }}"
imagePullPolicy: IfNotPresent
{{if .Values.compactionService.configuration}}
volumeMounts:
{{if .Values.compactionService.configuration}}
- name: compaction-service-config
mountPath: /config/
{{ end }}
{{ end }}
{{if .Values.compactionService.cache}}
- name: compaction-service-cache
mountPath: {{ .Values.compactionService.cache.mountPath }}
{{ end }}
ports:
- containerPort: 50051
env:
Expand Down
18 changes: 14 additions & 4 deletions k8s/distributed-chroma/templates/query-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,31 @@ spec:
member-type: query-service
spec:
serviceAccountName: query-service-serviceaccount
{{if .Values.queryService.configuration}}
volumes:
{{if .Values.queryService.configuration}}
- name: query-service-config
configMap:
name: query-service-config
{{ end }}
{{ end }}
{{if .Values.queryService.cache}}
- name: query-service-cache
hostPath:
path: {{ .Values.queryService.cache.hostPath }}
type: DirectoryOrCreate
{{ end }}
containers:
- name: query-service
image: "{{ .Values.queryService.image.repository }}:{{ .Values.queryService.image.tag }}"
imagePullPolicy: IfNotPresent
{{if .Values.queryService.configuration}}
volumeMounts:
{{if .Values.queryService.configuration}}
- name: query-service-config
mountPath: /config/
{{ end }}
{{ end }}
{{if .Values.queryService.cache}}
- name: query-service-cache
mountPath: {{ .Values.queryService.cache.mountPath }}
{{ end }}
ports:
- containerPort: 50051
env:
Expand Down
27 changes: 17 additions & 10 deletions k8s/distributed-chroma/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@ frontendService:
logServiceHost: 'value: "logservice.chroma"'
logServicePort: 'value: "50051"'
otherEnvConfig: |
- name: CHROMA_OTEL_COLLECTION_ENDPOINT
value: "http://jaeger:4317"
- name: CHROMA_OTEL_GRANULARITY
value: all
- name: CHROMA_OTEL_COLLECTION_ENDPOINT
value: "http://jaeger:4317"
- name: CHROMA_OTEL_GRANULARITY
value: all
replicaCount: 2
sysdb:
image:
repository: 'local'
tag: 'sysdb'
replicaCount: 1
env:
- name: OPTL_TRACING_ENDPOINT
value: 'value: "jaeger:4317"'
- name: OPTL_TRACING_ENDPOINT
value: 'value: "jaeger:4317"'
resources:
limits:
cpu: '2000m'
Expand All @@ -56,10 +56,10 @@ logService:
repository: 'local'
tag: 'log-service'
env:
- name: OPTL_TRACING_ENDPOINT
value: 'value: "otel-collector:4317"'
- name: SYSDB_CONN
value: 'value: "sysdb.chroma:50051"'
- name: OPTL_TRACING_ENDPOINT
value: 'value: "otel-collector:4317"'
- name: SYSDB_CONN
value: 'value: "sysdb.chroma:50051"'
flags:
replicaCount: 1

Expand All @@ -68,12 +68,19 @@ queryService:
repository: 'local'
tag: 'query-service'
env:
cache:
hostPath: '/var/cache/chroma'
mountPath: '/cache/'


compactionService:
image:
repository: 'local'
tag: 'compaction-service'
env:
cache:
hostPath: '/var/cache/chroma'
mountPath: '/cache/'
replicaCount: 1

sysdbMigration:
Expand Down

0 comments on commit f66222f

Please sign in to comment.