feat(jupyterhub): set postgres env-vars and add python packages
This commit is contained in:
@@ -70,7 +70,9 @@ RUN mamba install --yes \
|
||||
'aif360' \
|
||||
'airflow' \
|
||||
'chromadb' \
|
||||
'csvkit' \
|
||||
'dalex' \
|
||||
'datafusion' \
|
||||
'dbt' \
|
||||
'dlt' \
|
||||
'duckdb' \
|
||||
@@ -78,6 +80,7 @@ RUN mamba install --yes \
|
||||
'gitpython' \
|
||||
'grpcio-status' \
|
||||
'grpcio' \
|
||||
'hvac' \
|
||||
'keras' \
|
||||
'langchain' \
|
||||
'langchain-ai21' \
|
||||
@@ -112,6 +115,7 @@ RUN mamba install --yes \
|
||||
'pandas-profiling' \
|
||||
'pillow' \
|
||||
'polars' \
|
||||
'psycopg2' \
|
||||
'pyarrow' \
|
||||
'qdrant-client' \
|
||||
'rapidfuzz' \
|
||||
@@ -130,7 +134,6 @@ RUN pip install \
|
||||
agno \
|
||||
fastembed \
|
||||
feature-engine \
|
||||
hvac \
|
||||
jupyter-ai \
|
||||
jupyter-ai-magics[all] \
|
||||
kreuzberg \
|
||||
|
||||
@@ -70,7 +70,9 @@ RUN mamba install --yes \
|
||||
'aif360' \
|
||||
'airflow' \
|
||||
'chromadb' \
|
||||
'csvkit' \
|
||||
'dalex' \
|
||||
'datafusion' \
|
||||
'dbt' \
|
||||
'dlt' \
|
||||
'duckdb' \
|
||||
@@ -78,6 +80,7 @@ RUN mamba install --yes \
|
||||
'gitpython' \
|
||||
'grpcio-status' \
|
||||
'grpcio' \
|
||||
'hvac' \
|
||||
'keras' \
|
||||
'langchain' \
|
||||
'langchain-ai21' \
|
||||
@@ -112,6 +115,7 @@ RUN mamba install --yes \
|
||||
'pandas-profiling' \
|
||||
'pillow' \
|
||||
'polars' \
|
||||
'psycopg2' \
|
||||
'pyarrow' \
|
||||
'qdrant-client' \
|
||||
'rapidfuzz' \
|
||||
@@ -130,7 +134,6 @@ RUN pip install \
|
||||
agno \
|
||||
fastembed \
|
||||
feature-engine \
|
||||
hvac \
|
||||
jupyter-ai \
|
||||
jupyter-ai-magics[all] \
|
||||
kreuzberg \
|
||||
|
||||
@@ -49,6 +49,23 @@ hub:
|
||||
|
||||
c.Spawner.pre_spawn_hook = pre_spawn_hook
|
||||
{{- end }}
|
||||
02-postgres-integration: |
|
||||
from functools import wraps
|
||||
|
||||
# Store the original pre_spawn_hook if it exists
|
||||
original_hook = c.Spawner.pre_spawn_hook if hasattr(c.Spawner, 'pre_spawn_hook') else None
|
||||
|
||||
async def postgres_pre_spawn_hook(spawner):
|
||||
"""Add PostgreSQL connection information to notebook environment"""
|
||||
# Call the original hook first if it exists
|
||||
if original_hook:
|
||||
await original_hook(spawner)
|
||||
|
||||
# Add PostgreSQL configuration
|
||||
spawner.environment['POSTGRES_HOST'] = 'postgres-cluster-rw.postgres'
|
||||
spawner.environment['POSTGRES_PORT'] = '5432'
|
||||
|
||||
c.Spawner.pre_spawn_hook = postgres_pre_spawn_hook
|
||||
|
||||
podSecurityContext:
|
||||
fsGroup: {{ .Env.JUPYTER_FSGID }}
|
||||
@@ -74,16 +91,16 @@ singleuser:
|
||||
KEYCLOAK_HOST: "{{ .Env.KEYCLOAK_HOST }}"
|
||||
KEYCLOAK_REALM: "{{ .Env.KEYCLOAK_REALM }}"
|
||||
|
||||
lifecycleHooks:
|
||||
postStart:
|
||||
exec:
|
||||
command:
|
||||
- /bin/bash
|
||||
- -c
|
||||
- |
|
||||
# Install hvac for Vault integration
|
||||
pip install --quiet hvac requests
|
||||
echo "Vault integration ready"
|
||||
# lifecycleHooks:
|
||||
# postStart:
|
||||
# exec:
|
||||
# command:
|
||||
# - /bin/bash
|
||||
# - -c
|
||||
# - |
|
||||
# # Install hvac for Vault integration
|
||||
# mamba install hvac requests
|
||||
# echo "Vault integration ready"
|
||||
{{- end }}
|
||||
networkPolicy:
|
||||
egress:
|
||||
|
||||
@@ -5,7 +5,7 @@ export JUPYTERHUB_CHART_VERSION := env("JUPYTERHUB_CHART_VERSION", "4.2.0")
|
||||
export JUPYTERHUB_OIDC_CLIENT_ID := env("JUPYTERHUB_OIDC_CLIENT_ID", "jupyterhub")
|
||||
export JUPYTERHUB_NFS_PV_ENABLED := env("JUPYTERHUB_NFS_PV_ENABLED", "")
|
||||
export JUPYTERHUB_VAULT_INTEGRATION_ENABLED := env("JUPYTERHUB_VAULT_INTEGRATION_ENABLED", "")
|
||||
export JUPYTER_PYTHON_KERNEL_TAG := env("JUPYTER_PYTHON_KERNEL_TAG", "python-3.12-6")
|
||||
export JUPYTER_PYTHON_KERNEL_TAG := env("JUPYTER_PYTHON_KERNEL_TAG", "python-3.12-8")
|
||||
export KERNEL_IMAGE_BUUN_STACK_REPOSITORY := env("KERNEL_IMAGE_BUUN_STACK_REPOSITORY", "buun-stack-notebook")
|
||||
export KERNEL_IMAGE_BUUN_STACK_CUDA_REPOSITORY := env("KERNEL_IMAGE_BUUN_STACK_CUDA_REPOSITORY", "buun-stack-cuda-notebook")
|
||||
export JUPYTER_PROFILE_MINIMAL_ENABLED := env("JUPYTER_PROFILE_MINIMAL_ENABLED", "false")
|
||||
|
||||
Reference in New Issue
Block a user