Skip to content

Instantly share code, notes, and snippets.

@daddydrac
Created December 2, 2020 18:05
Show Gist options
  • Save daddydrac/063d055cdaf7d92455ee6d695ead8d0a to your computer and use it in GitHub Desktop.
Save daddydrac/063d055cdaf7d92455ee6d695ead8d0a to your computer and use it in GitHub Desktop.
AWS s3 volume mount point for dask/dask-rapids helm chart
{{ if .Values.jupyter.enabled -}}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "dask.fullname" . }}-jupyter-config
labels:
app: {{ template "dask.name" . }}
heritage: {{ .Release.Service | quote }}
release: {{ .Release.Name | quote }}
chart: {{ template "dask.chart" . }}
component: jupyter
data:
jupyter_notebook_config.py: |
c = get_config()
c.NotebookApp.password = '{{ .Values.jupyter.password }}'
from s3contents import S3ContentsManager
from hybridcontents import HybridContentsManager
from notebook.services.contents.largefilemanager import LargeFileManager
#from IPython.html.services.contents.filemanager import FileContentsManager
c.NotebookApp.contents_manager_class = HybridContentsManager
c.HybridContentsManager.manager_classes = {
# Associate the root directory with an S3ContentsManager.
# This manager will receive all requests that don"t fall under any of the
# other managers.
"": S3ContentsManager,
# Associate /directory with a LargeFileManager.
"local_directory": LargeFileManager,
}
c.HybridContentsManager.manager_kwargs = {
# Args for root S3ContentsManager.
"": {
"access_key_id": "{{ .Values.jupyter.access_key }}",
"secret_access_key": "{{ .Values.jupyter.secret_key }}",
"bucket": "{{ .Values.jupyter.s3_bucket }}",
"region_name": "{{ .Values.jupyter.region_name }}",
"endpoint_url": "{{ .Values.jupyter.endpoint_url }}",
},
"local_directory": {
"root_dir": "/rapids/notebooks",
},
}
{{ .Values.jupyter.extraConfig | nindent 4 }}
{{ end }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment