# This file can update the JupyterHub Helm chart's default configuration values.
#
# For reference see the configuration reference and default values, but make
# sure to refer to the Helm chart version of interest to you!
#
# Introduction to YAML:     https://www.youtube.com/watch?v=cdLNKUoMc6c
# Chart config reference:   https://zero-to-jupyterhub.readthedocs.io/en/stable/resources/reference.html
# Chart default values:     https://github.com/jupyterhub/zero-to-jupyterhub-k8s/blob/HEAD/jupyterhub/values.yaml
# Available chart versions: https://jupyterhub.github.io/helm-chart/
#

hub:
  config:
    CILogonOAuthenticator:
      client_id: $CILOGON_ID
      client_secret: $CILOGON_SECRET
      oauth_callback_url: https://csusb-hpc.nrp-nautilus.io/hub/oauth_callback
      username_claim: "email"
    JupyterHub:
      admin_access: true
      authenticator_class: cilogon
      admin_users: ["dvu@csusb.edu", "000065181@csusb.edu", "youngsu.kim@csusb.edu", "006501270@csusb.edu"]
      allowed_users:
        - 000065181@csusb.edu
        - 004793408@csusb.edu
        - 006501322@csusb.edu
        - 003574622@csusb.edu
        - 005795019@csusb.edu
        - 005061741@csusb.edu
        - 003087200@csusb.edu
        - 000030081@csusb.edu
        - dmishin@ucsd.edu
  initContainers:
    - name: git-clone-templates
      image: alpine/git
      args:
        - clone
        - --single-branch
        - --branch=main
        - --depth=1
        - --
        - https://gitlab.nrp-nautilus.io/youngsu_kim/csusb-jupyterhub-custom-templates.git
        - /etc/jupyterhub/custom
      securityContext:
        runAsUser: 0
      volumeMounts:
        - name: custom-templates
          mountPath: /etc/jupyterhub/custom
  extraVolumes:
    - name: custom-templates
      emptyDir: {}
  extraVolumeMounts:
    - name: custom-templates
      mountPath: /etc/jupyterhub/custom
  extraConfig:
    templates: |
      c.JupyterHub.template_paths = ['/etc/jupyterhub/custom']
  service:
    type: ClusterIP
    annotations: {}
    ports:
      nodePort: 
    loadBalancerIP:
  deploymentStrategy:
    type: Recreate
  db:
    type: sqlite-pvc
    pvc:
      accessModes:
        - ReadWriteOnce
      storage: 5Gi
      storageClassName: rook-ceph-block
  resources:
    limits:
      cpu: "2"
      memory: 4Gi
    requests:
      cpu: "2"
      memory: 4Gi
  networkPolicy:
    enabled: false
proxy:
  secretToken: '$SECRET_TOKEN'
  service:
    type: ClusterIP
  chp:
    resources:
      limits:
        cpu: "2"
        memory: 4Gi
      requests:
        cpu: "2"
        memory: 4Gi
singleuser:
  extraNodeAffinity:
    required:
      - matchExpressions:
        - 'key': 'topology.kubernetes.io/region'
          'operator': 'In'
          'values': ["us-west"]
  cloudMetadata:
    blockWithIptables: false
  networkPolicy:
    enabled: false
  storage:
    type: dynamic
    extraLabels: {}
    extraVolumes: []
    extraVolumeMounts: []
    capacity: 100Gi
    homeMountPath: /home/jovyan
    dynamic:
      storageClass: rook-ceph-block
      pvcNameTemplate: claim-{username}{servername}
      volumeNameTemplate: volume-{username}{servername}
      storageAccessModes: [ReadWriteOnce]
    extraVolumes:
      - name: csusb-hpc-share
        persistentVolumeClaim:
          claimName: csusb-hpc-share
      - name: mkshare-script
        configMap:
          name: mkshare-script
          defaultMode: 0777
    extraVolumeMounts:
      - name: csusb-hpc-share
        mountPath: /home/shared        
      - name: mkshare-script
        mountPath: /usr/local/bin/before-notebook.d/mkshare.sh
        subPath: mkshare.sh  
  image:
    name: localhost:30081/prp/jupyter-stack/prp
    tag: latest
  startTimeout: 600
  cpu:
    limit: 16
    guarantee: 16
  memory:
    limit: 128G
    guarantee: 128G
  extraResource:
    limits: {}
    guarantees: {}
  cmd: start-notebook.sh    
#  cmd: jupyterhub-singleuser    
  defaultUrl: "/lab"
  profileList:
  - display_name: Stack Minimal
    default: true    
    kubespawner_override:
      image_spec: localhost:30081/prp/jupyter-stack/minimal
  - display_name: Stack Minimal + Desktop GUI + Relion
    kubespawner_override:
      image_spec: localhost:30081/prp/jupyter-stack/relion-desktop
  - display_name: Stack All Spark
    kubespawner_override:
      image_spec: localhost:30081/prp/jupyter-stack/all-spark
      extra_resource_limits:
        nvidia.com/gpu: "2"
  - display_name: Stack Datascience
    kubespawner_override:
      image_spec: localhost:30081/prp/jupyter-stack/datascience
      extra_resource_limits:
        nvidia.com/gpu: "2"
  - display_name: Stack Tensorflow [2GPUs]
    kubespawner_override:
      image_spec: localhost:30081/prp/jupyter-stack/prp
      extra_resource_limits:
        nvidia.com/gpu: "2"
  - display_name: Stack Tensorflow [4GPUs]
    kubespawner_override:
      image_spec: localhost:30081/prp/jupyter-stack/prp
      extra_resource_limits:
        nvidia.com/gpu: "4"
  - display_name: Stack R-Studio [4.1.2]
    kubespawner_override:
      image_spec: gitlab-registry.nrp-nautilus.io/youngsu_kim/csusb-jupyter-stack/stack-rstudio:sr-r1
  - display_name: Stack R-Studio
    kubespawner_override:
      image_spec: localhost:30081/prp/jupyter-stack/r-studio
#      extra_resource_limits:
#        nvidia.com/gpu: "1"
  - display_name: Stack Pyspark [2GPUs]
    kubespawner_override:
      image_spec: localhost:30081/prp/jupyter-stack/pyspark
      extra_resource_limits:
        nvidia.com/gpu: "2"
  - display_name: Stack Pyspark [4GPUs]
    kubespawner_override:
      image_spec: localhost:30081/prp/jupyter-stack/pyspark
      extra_resource_limits:
        nvidia.com/gpu: "4"
  - display_name: Stack SageMath
    kubespawner_override:
      image_spec: gitlab-registry.nrp-nautilus.io/youngsu_kim/csusb-jupyter-stack/stack-sagemath:b353d66b
scheduling:
  userScheduler:
    enabled: false
# prePuller relates to the hook|continuous-image-puller DaemonsSets
prePuller:
  hook:
    enabled: false
  continuous:
    enabled: false

ingress:
  enabled: true
  annotations:
    kubernetes.io/ingress.class: haproxy
  hosts: ["csusb-hpc.nrp-nautilus.io"]
  pathSuffix: ''
  tls:
    - hosts:
      - csusb-hpc.nrp-nautilus.io

cull:
  enabled: false
  users: false
  removeNamedServers: false
  timeout: 3600
  every: 600
  concurrency: 10
  maxAge: 0
