Skip to content

Commit

Permalink
Conversation cache path
Browse files Browse the repository at this point in the history
  • Loading branch information
frankyhollywood committed Aug 13, 2024
1 parent 1bf6b60 commit c9e069a
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 19 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.1
2.0.1-llm
1 change: 1 addition & 0 deletions charts/fairspace/templates/project/configmap-saturn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ data:
port: 8090
livenessPort: 8091
publicUrl: {{ template "fairspace.url" . }}
llmConversationCachePath: "/data/saturn/conversations"
jena:
metadataBaseIRI: http://{{ .Values.fairspace.ingress.domain }}/iri/
datasetPath: "/data/saturn/db"
Expand Down
35 changes: 18 additions & 17 deletions charts/fairspace/templates/project/stateful-set.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ spec:
{{- if has "ExtraStorage" .Values.fairspace.features }}
- name: extra-file-storage
mountPath: /data/saturn/extra-files
- name: llm-conversations
{{- end }}
{{- if has "LlmSearch" .Values.fairspace.features }}
- name: llm
mountPath: /data/saturn/conversations
{{- end }}
livenessProbe:
Expand Down Expand Up @@ -207,48 +209,47 @@ spec:
storageClassName: {{ .Values.saturn.persistence.files.storageClass | quote }}
{{- end }}
{{- end }}
{{- if has "ExtraStorage" .Values.fairspace.features }}
- metadata:
name: extra-file-storage
name: llm
labels:
app: saturn
{{- include "fairspace.labels" . | nindent 8 }}
{{- if index .Values "saturn" "persistence" "extra-file-storage" "annotations" }}
{{- if .Values.saturn.persistence.llm.annotations }}
annotations:
{{ toYaml index .Values "saturn" "persistence" "extra-file-storage" "annotations" | indent 8 }}
{{ toYaml .Values.saturn.persistence.llm.annotations | indent 8 }}
{{- end }}
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: {{ index .Values "saturn" "persistence" "extra-file-storage" "size" | quote }}
{{- if index .Values "saturn" "persistence" "extra-file-storage" "storageClass" }}
{{- if (eq "-" (index .Values "saturn" "persistence" "extra-file-storage" "storageClass")) }}
storage: {{ .Values.saturn.persistence.llm.size | quote }}
{{- if .Values.saturn.persistence.llm.storageClass }}
{{- if (eq "-" .Values.saturn.persistence.llm.storageClass) }}
storageClassName: ""
{{- else }}
storageClassName: {{ index .Values "saturn" "persistence" "extra-file-storage" "storageClass" | quote }}
storageClassName: {{ .Values.saturn.persistence.llm.storageClass | quote }}
{{- end }}
{{- end }}
{{- if has "LlmSearch" .Values.fairspace.features }}
{{- if has "ExtraStorage" .Values.fairspace.features }}
- metadata:
name: llm-conversations
name: extra-file-storage
labels:
app: saturn
{{- include "fairspace.labels" . | nindent 8 }}
{{- if index .Values "saturn" "persistence" "llm-conversations" "annotations" }}
{{- if index .Values "saturn" "persistence" "extra-file-storage" "annotations" }}
annotations:
{{ toYaml index .Values "saturn" "persistence" "llm-conversations" "annotations" | indent 8 }}
{{ toYaml index .Values "saturn" "persistence" "extra-file-storage" "annotations" | indent 8 }}
{{- end }}
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: {{ index .Values "saturn" "persistence" "llm-conversations" "size" | quote }}
{{- if index .Values "saturn" "persistence" "llm-conversations" "storageClass" }}
{{- if (eq "-" (index .Values "saturn" "persistence" "llm-conversations" "storageClass")) }}
storage: {{ index .Values "saturn" "persistence" "extra-file-storage" "size" | quote }}
{{- if index .Values "saturn" "persistence" "extra-file-storage" "storageClass" }}
{{- if (eq "-" (index .Values "saturn" "persistence" "extra-file-storage" "storageClass")) }}
storageClassName: ""
{{- else }}
storageClassName: {{ index .Values "saturn" "persistence" "llm-conversations" "storageClass" | quote }}
storageClassName: {{ index .Values "saturn" "persistence" "extra-file-storage" "storageClass" | quote }}
{{- end }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ public class Config {

public Search search = new Search();

public String llmConversationCachePath = "data/conversations";

public static class Jena {
public String metadataBaseIRI = "http://localhost/iri/";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@
import io.fairspace.saturn.services.BaseApp;

import static io.fairspace.saturn.auth.RequestContext.getAccessToken;
import static io.fairspace.saturn.config.ConfigLoader.CONFIG;

import static org.eclipse.jetty.http.MimeTypes.Type.APPLICATION_JSON;
import static spark.Spark.get;
import static spark.Spark.post;

@Log4j2
public class AiSearchApp extends BaseApp {
final String CACHE_DIR = "./data/conversations/";
final String CACHE_DIR = CONFIG.llmConversationCachePath;

public AiSearchApp(String basePath) {
super(basePath);
Expand Down

0 comments on commit c9e069a

Please sign in to comment.