Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions charts/jupyter-python/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 2.3.19
version: 2.3.20
dependencies:
- name: library-chart
version: 1.7.12
version: 1.7.13
repository: https://inseefrlab.github.io/helm-charts-interactive-services
1 change: 1 addition & 0 deletions charts/jupyter-python/templates/secret-assistant.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ include "library-chart.secretAssistantJupyter" . }}
30 changes: 30 additions & 0 deletions charts/jupyter-python/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ spec:
{{- include "library-chart.selectorLabels" . | nindent 8 }}
spec:
volumes:
- name: jupyter-local
emptyDir: {}
- name: home
{{- if (.Values.persistence).enabled }}
persistentVolumeClaim:
Expand Down Expand Up @@ -93,6 +95,11 @@ spec:
secret:
secretName: {{ include "library-chart.secretNameCacerts" . }}
{{- end }}
{{- if (.Values.userPreferences.aiAssistant).enabled }}
- name: secret-assistant
secret:
secretName: {{ include "library-chart.secretNameAssistantJupyter" . }}
{{- end }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
Expand All @@ -111,6 +118,10 @@ spec:
- -c
- |
echo 'initContainer make-secrets-writable is started';
{{ if (.Values.userPreferences.aiAssistant).enabled }}
mkdir /dest/jupyter-ai
cp /src/jupyter-ai/config.json /dest/jupyter-ai/config.json
{{- end }}
{{- if .Values.discovery.hive }}
mkdir /dest/hive;
cp /src/hive/hive-site.xml /dest/hive/hive-site.xml;
Expand All @@ -129,6 +140,10 @@ spec:
awk 'BEGIN {c=0;} /BEGIN CERT/{c++} { print > "/dest/cacerts/cert." c ".crt"}' < /tmp/ca.pem;
{{- end }}
volumeMounts:
{{- if (.Values.userPreferences.aiAssistant).enabled }}
- name: secret-assistant
mountPath: /src/jupyter-ai
{{- end }}
- name: config-files
mountPath: /dest
{{- if (.Values.certificates).cacerts }}
Expand Down Expand Up @@ -200,6 +215,14 @@ spec:
{{- end }}
- name: UV_CACHE_DIR
value: /home/{{ .Values.environment.user }}/work/.cache/uv
{{- if (.Values.userPreferences.aiAssistant).enabled }}
- name: OPENAI_API_KEY
value: {{ .Values.userPreferences.aiAssistant.apiKey }}
- name: OPENAI_BASE_URL
value: {{ .Values.userPreferences.aiAssistant.apiBase }}
- name: ENABLE_JUPYTER_AI_EXTENSION
value: "{{ .Values.userPreferences.aiAssistant.enabled }}"
{{- end }}
envFrom:
- secretRef:
name: {{ include "library-chart.secretNameToken" . }}
Expand Down Expand Up @@ -263,6 +286,13 @@ spec:
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- name: jupyter-local
mountPath: /home/{{ .Values.environment.user }}/.local/share/jupyter
{{ if (.Values.userPreferences.aiAssistant).enabled }}
- mountPath: /home/{{ .Values.environment.user }}/.local/share/jupyter/jupyter_ai
subPath: jupyter-ai
name: config-files
{{- end }}
- mountPath: /home/{{ .Values.environment.user }}/work
subPath: work
name: home
Expand Down
78 changes: 78 additions & 0 deletions charts/jupyter-python/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -915,6 +915,84 @@
"hidden": true,
"overwriteDefaultWith": "user.lang"
}
},
"aiAssistant":{
"title": "AI Assistant",
"type": "object",
"description": "Configure Jupyter-ai, an extension to use custom AI code assistants",
"x-onyxia": {
"overwriteSchemaWith": "aiAssistant-jupyter.json"
},
"properties": {
"enabled": {
"type": "boolean",
"default": false,
"hidden": true,
"x-onyxia": {
"overwriteDefaultWith": "user.profile.aiAssistant.enabled"
}
},
"model": {
"type": "string",
"default":"",
"hidden": {
"value": false,
"path": "enabled",
"isPathRelative": true
},
"x-onyxia": {
"overwriteDefaultWith": "user.profile.aiAssistant.model"
}
},
"modelProvider": {
"type": "string",
"default": "",
"hidden": {
"value": false,
"path": "enabled",
"isPathRelative": true
},
"x-onyxia": {
"overwriteDefaultWith": "user.profile.aiAssistant.modelProvider"
}
},
"embeddingsProvider": {
"type": "string",
"default": "",
"hidden": {
"value": false,
"path": "enabled",
"isPathRelative": true
},
"x-onyxia": {
"overwriteDefaultWith": "user.profile.aiAssistant.embeddingsProvider"
}
},
"apiBase":{
"type": "string",
"default": "",
"hidden": {
"value": false,
"path": "enabled",
"isPathRelative": true
},
"x-onyxia": {
"overwriteDefaultWith": "user.profile.aiAssistant.apiBase"
}
},
"apiKey":{
"type": "string",
"default": "",
"hidden": {
"value": false,
"path": "enabled",
"isPathRelative": true
},
"x-onyxia": {
"overwriteDefaultWith": "user.profile.aiAssistant.apiKey"
}
}
}
}
}
},
Expand Down
7 changes: 7 additions & 0 deletions charts/jupyter-python/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,13 @@ startupProbe:
userPreferences:
darkMode: false
language: "en"
aiAssistant:
enabled: false
modelProvider: ""
embeddingsProvider: ""
apiBase: ""
apiKey: ""
secretName: "" # Generated based on the service's name if empty or not set

openshiftSCC:
enabled: false
Expand Down
Loading