## @section Global configuration
## @param global.imageRegistry Global Docker image registry
## @param global.imagePullSecrets Global Docker image pull secrets
global:
  ## @param global.imageRegistry Global Docker image registry
  imageRegistry: ""
  ## E.g.
  ## imagePullSecrets:
  ##   - myRegistryKeySecretName
  ## @param global.imagePullSecrets Global Docker image pull secrets
  imagePullSecrets: []
  imageTag: "v2.7.1-rc0"
  gpuHookPath: /usr/local
  labels: {}
  annotations: {}
  managedNodeSelectorEnable: false
  managedNodeSelector:
    usage: "gpu"

nameOverride: ""
fullnameOverride: ""
namespaceOverride: ""

#Nvidia GPU Parameters
resourceName: "nvidia.com/gpu"
resourceMem: "nvidia.com/gpumem"
resourceMemPercentage: "nvidia.com/gpumem-percentage"
resourceCores: "nvidia.com/gpucores"
resourcePriority: "nvidia.com/priority"

#MLU Parameters
mluResourceName: "cambricon.com/vmlu"
mluResourceMem: "cambricon.com/mlu.smlu.vmemory"
mluResourceCores: "cambricon.com/mlu.smlu.vcore"

#Hygon DCU Parameters
dcuResourceName: "hygon.com/dcunum"
dcuResourceMem: "hygon.com/dcumem"
dcuResourceCores: "hygon.com/dcucores"

#Metax sGPU Parameters
metaxResourceName: "metax-tech.com/sgpu"
metaxResourceCore: "metax-tech.com/vcore"
metaxResourceMem: "metax-tech.com/vmemory"
metaxsGPUTopologyAware: "false"

#Enflame VGCU Parameters
enflameResourceNameVGCU: "enflame.com/vgcu"
enflameResourceNameVGCUPercentage: "enflame.com/vgcu-percentage"

#Kunlun XPU Parameters
kunlunResourceName: "kunlunxin.com/xpu"
kunlunResourceVCountName: "kunlunxin.com/vxpu"
kunlunResourceVMemoryName: "kunlunxin.com/vxpu-memory"

schedulerName: "hami-scheduler"

podSecurityPolicy:
  enabled: false

scheduler:
  # @param nodeName defines the node name and the nvidia-vgpu-scheduler-scheduler will schedule to the node.
  # if we install the nvidia-vgpu-scheduler-scheduler as default scheduler, we need to remove the k8s default
  # scheduler pod from the cluster first, we must specify node name to skip the schedule workflow.
  nodeName: ""
  #nodeLabelSelector:
  #  "gpu": "on"
  overwriteEnv: "false"
  defaultSchedulerPolicy:
    nodeSchedulerPolicy: binpack
    gpuSchedulerPolicy: spread
  metricsBindAddress: ":9395"
  # If set to false, When Pod.Spec.SchedulerName equals to the const DefaultSchedulerName in k8s.io/api/core/v1 package, webhook will not overwrite it
  forceOverwriteDefaultScheduler: true
  livenessProbe: false
  leaderElect: true
  # when leaderElect is true, replicas is available, otherwise replicas is 1.
  replicas: 1
  kubeScheduler:
    # @param enabled indicate whether to run kube-scheduler container in the scheduler pod, it's true by default.
    enabled: true
    ## @param image.registry kube scheduler image registry
    ## @param image.repository kube scheduler image repository
    ## @param image.tag kube scheduler image tag (immutable tags are recommended)
    ## @param image.pullPolicy kube scheduler image pull policy
    ## @param image.pullSecrets Specify docker-registry secret names as an array
    image:
      registry: "registry.cn-hangzhou.aliyuncs.com"
      repository: "google_containers/kube-scheduler"
      tag: ""
      ## Specify a imagePullPolicy
      ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
      ## ref: https://kubernetes.io/docs/user-guide/images/#pre-pulling-images
      ##
      pullPolicy: IfNotPresent
      ## Optionally specify an array of imagePullSecrets.
      ## Secrets must be manually created in the namespace.
      ## Example:
      ## pullSecrets:
      ##   - myRegistryKeySecretName
      ##
      pullSecrets: []
    resources: {}
      # If you do want to specify resources, uncomment the following lines, adjust them as necessary.
      # and remove the curly braces after 'resources:'.
#      limits:
#        cpu: 1000m
#        memory: 1000Mi
#      requests:
#        cpu: 100m
#        memory: 100Mi
    extraNewArgs:
      - --config=/config/config.yaml
      - -v=4
    extraArgs:
      - --policy-config-file=/config/config.json
      - -v=4
  extender:
    ## @param image.registry scheduler extender image registry
    ## @param image.repository scheduler extender image repository
    ## @param image.tag scheduler extender image tag (immutable tags are recommended)
    ## @param image.pullPolicy scheduler extender image pull policy
    ## @param image.pullSecrets Specify docker-registry secret names as an array
    image:
      registry: "ghcr.io"
      repository: "dynamia-ai/hami"
      tag: ""
      ## Specify a imagePullPolicy
      ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
      ## ref: https://kubernetes.io/docs/user-guide/images/#pre-pulling-images
      ##
      pullPolicy: IfNotPresent
      ## Optionally specify an array of imagePullSecrets.
      ## Secrets must be manually created in the namespace.
      ## Example:
      ## pullSecrets:
      ##   - myRegistryKeySecretName
      ##
      pullSecrets: []
    resources: {}
      # If you do want to specify resources, uncomment the following lines, adjust them as necessary,
      # and remove the curly braces after 'resources:'.
#      limits:
#        cpu: 1000m
#        memory: 1000Mi
#      requests:
#        cpu: 100m
#        memory: 100Mi
    extraArgs:
      - --debug
      - -v=4
  nodeLockExpire: "5m"
  podAnnotations: {}
  tolerations: []
  #serviceAccountName: "hami-vgpu-scheduler-sa"
  admissionWebhook:
    # If set to false, the admission webhook is not installed and any pods that should use HAMi must be
    # configured to use the right 'schedulerName' and other device-specific configurations.
    enabled: true
    customURL:
      enabled: false
      # must be an endpoint using https.
      # should generate host certs here
      host: 127.0.0.1 # hostname or ip, can be your node'IP if you want to use https://<nodeIP>:<schedulerPort>/<path>
      port: 31998
      path: /webhook
    whitelistNamespaces:
    # Specify the namespaces that the webhook will not be applied to.
      # - default
      # - kube-system
      # - istio-system
    reinvocationPolicy: Never
    failurePolicy: Ignore
  ## TLS Certificate Option 1: Use cert-manager to generate self-signed certificate.
  ## If enabled, always takes precedence over options 2.
  certManager:
    enabled: false
  ## TLS Certificate Option 2: Use kube-webhook-certgen to generate self-signed certificate.
  ## If true and certManager.enabled is false, Helm will automatically create a self-signed cert and secret for you.
  patch:
    enabled: true
    ## @param image.registry scheduler extender image registry
    ## @param image.repository scheduler extender image repository
    ## @param image.tag scheduler extender image tag (immutable tags are recommended)
    ## @param image.pullPolicy scheduler extender image pull policy
    ## @param image.pullSecrets Specify docker-registry secret names as an array
    image:
      registry: "docker.io"
      repository: "jettech/kube-webhook-certgen"
      tag: "v1.5.2"
      ## Specify a imagePullPolicy
      ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
      ## ref: https://kubernetes.io/docs/user-guide/images/#pre-pulling-images
      ##
      pullPolicy: IfNotPresent
      ## Optionally specify an array of imagePullSecrets.
      ## Secrets must be manually created in the namespace.
      ## Example:
      ## pullSecrets:
      ##   - myRegistryKeySecretName
      ##
      pullSecrets: []
    ## @param image.registry scheduler extender image registry
    ## @param image.repository scheduler extender image repository
    ## @param image.tag scheduler extender image tag (immutable tags are recommended)
    ## @param image.pullPolicy scheduler extender image pull policy
    ## @param image.pullSecrets Specify docker-registry secret names as an array
    imageNew: 
      registry: "docker.io"
      repository: "liangjw/kube-webhook-certgen"
      tag: "v1.1.1"
      ## Specify a imagePullPolicy
      ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
      ## ref: https://kubernetes.io/docs/user-guide/images/#pre-pulling-images
      ##
      pullPolicy: IfNotPresent
      ## Optionally specify an array of imagePullSecrets.
      ## Secrets must be manually created in the namespace.
      ## Example:
      ## pullSecrets:
      ##   - myRegistryKeySecretName
      ##
      pullSecrets: []
    priorityClassName: ""
    podAnnotations: {}
    nodeSelector: {}
    tolerations: []
    runAsUser: 2000
  service:
    type: NodePort  # Default type is NodePort, can be changed to ClusterIP
    httpPort: 443   # HTTP port
    schedulerPort: 31998  # NodePort for HTTP
    monitorPort: 31993    # Monitoring port
    monitorTargetPort: 9395
    httpTargetPort: 443
    labels: {}
    annotations: {}

devicePlugin:
  enabled: true
  gpuOperatorToolkitReady:
    enabled: false
    hostPath: "/run/nvidia/validations"
  ## @param image.registry devicePlugin image registry
  ## @param image.repository devicePlugin image repository
  ## @param image.tag devicePlugin image tag (immutable tags are recommended)
  ## @param image.pullPolicy devicePlugin image pull policy
  ## @param image.pullSecrets Specify docker-registry secret names as an array
  image:
    registry: "ghcr.io"
    repository: "dynamia-ai/hami"
    tag: ""
    ## Specify a imagePullPolicy
    ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
    ## ref: https://kubernetes.io/docs/user-guide/images/#pre-pulling-images
    ##
    pullPolicy: IfNotPresent
    ## Optionally specify an array of imagePullSecrets.
    ## Secrets must be manually created in the namespace.
    ## Example:
    ## pullSecrets:
    ##   - myRegistryKeySecretName
    ##
    pullSecrets: []
  monitor:
    ## @param image.registry monitor image registry
    ## @param image.repository monitor image repository
    ## @param image.tag monitor image tag (immutable tags are recommended)
    ## @param image.pullPolicy monitor image pull policy
    ## @param image.pullSecrets Specify docker-registry secret names as an array
    image:
      registry: "ghcr.io"
      repository: "dynamia-ai/hami"
      tag: ""
      ## Specify a imagePullPolicy
      ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
      ## ref: https://kubernetes.io/docs/user-guide/images/#pre-pulling-images
      ##
      pullPolicy: IfNotPresent
      ## Optionally specify an array of imagePullSecrets.
      ## Secrets must be manually created in the namespace.
      ## Example:
      ## pullSecrets:
      ##   - myRegistryKeySecretName
      ##
      pullSecrets: []
    ctrPath: /usr/local/vgpu/containers
    resyncInterval: "5m"
    extraArgs:
      - -v=4
    extraEnvs: {}
    resources: {}
      # If you do want to specify resources, uncomment the following lines, adjust them as necessary.
      # and remove the curly braces after 'resources:'.
#      limits:
#        cpu: 1000m
#        memory: 1000Mi
#      requests:
#        cpu: 100m
#        memory: 100Mi

  deviceSplitCount: 10
  deviceMemoryScaling: 1
  deviceCoreScaling: 1
  # Node configuration for device plugin, Priority: externalConfigName > config > default config
  nodeConfiguration:
    # If you want to use a custom config.json, you can set the content here.
    # If this is set, it will override the default config.json(An example is as follows).
    config: |
      {
        "nodeconfig": [
          {
            "name": "your-node-name",
            "operatingmode": "hami-core",
            "devicememoryscaling": 1,
            "devicesplitcount": 10,
            "migstrategy": "none",
            "filterdevices": {
              "uuid": [],
              "index": []
            }
          }
        ]
      }
    # If you want to use an existing ConfigMap, you can set the name here.
    # If this is set, the chart will not create the ConfigMap and will use the existing one.
    externalConfigName: ""
  # The runtime class name to be used by the device plugin, and added to the pod.spec.runtimeClassName of applications utilizing NVIDIA GPUs
  runtimeClassName: ""
  # Whether to create runtime class, name comes from runtimeClassName when it is set
  createRuntimeClass: false
  migStrategy: "none"
  disablecorelimit: "false"
  passDeviceSpecsEnabled: false
  deviceListStrategy: "envvar"
  nvidiaHookPath: null
  nvidiaDriverRoot: null
  gdrcopyEnabled: null
  gdsEnabled: null
  mofedEnabled: null

  extraArgs:
    - -v=4
  extraEnvs: {}
  service:
    type: NodePort  # Default type is NodePort, can be changed to ClusterIP
    httpPort: 31992
    labels: {}
    annotations: {}

  pluginPath: /var/lib/kubelet/device-plugins
  libPath: /usr/local/vgpu

  podAnnotations: {}
  nvidiaNodeSelector:
    gpu: "on"
  tolerations: []
  # The updateStrategy for DevicePlugin DaemonSet.
  # If you want to update the DaemonSet by manual, set type as "OnDelete".
  # We recommend use OnDelete update strategy because DevicePlugin pod restart will cause business pod restart, this behavior is destructive.
  # Otherwise, you can use RollingUpdate update strategy to rolling update DevicePlugin pod.
  updateStrategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 1

  resources: {}
    # If you do want to specify resources, uncomment the following lines, adjust them as necessary.
    # and remove the curly braces after 'resources:'.
#    limits:
#       cpu: 1000m
#       memory: 1000Mi
#    requests:
#      cpu: 100m
#      memory: 100Mi

mockDevicePlugin:
  enabled: false
  image:
    registry: "docker.io"
    repository: "projecthami/mock-device-plugin"
    tag: "0.1.0"
    ## Specify a imagePullPolicy
    ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
    ## ref: https://kubernetes.io/docs/user-guide/images/#pre-pulling-images
    ##
    pullPolicy: IfNotPresent
    ## Optionally specify an array of imagePullSecrets.
    ## Secrets must be manually created in the namespace.
    ## Example:
    ## pullSecrets:
    ##   - myRegistryKeySecretName
    ##
    pullSecrets: []
# If this option is enabled, the DRA will be installed and the scheduler extender will not be installed.
dra:
  enabled: false

# Configuration for the hami-dra subchart, which includes DRA drivers.
hami-dra:
  drivers:
    nvidia:
      enabled: true
      # If you are using gpu driver on host, you need to set this to false
      containerDriver: true
      image:
        repository: projecthami/k8s-dra-driver
        tag: "v0.0.1-dev"

devices:
  amd:
    customresources:
      - amd.com/gpu
      - amd.com/gpu-memory
  awsneuron:
    customresources:
      - aws.amazon.com/neuron
      - aws.amazon.com/neuroncore
  kunlun:
    enabled: true
    customresources:
      - kunlunxin.com/xpu
      - kunlunxin.com/vxpu
      - kunlunxin.com/vxpu-memory
  enflame:
    enabled: true
    customresources:
      - enflame.com/vgcu
      - enflame.com/vgcu-percentage
      - enflame.com/gcu
  mthreads:
    enabled: true
    customresources:
      - mthreads.com/vgpu
  nvidia:
    gpuCorePolicy: default
    libCudaLogLevel: 2
  ascend:
    enabled: false
    image: ""
    imagePullPolicy: IfNotPresent
    extraArgs: []
    nodeSelector:
      ascend: "on"
    tolerations: []
    customresources:
      - huawei.com/Ascend910A
      - huawei.com/Ascend910A-memory
      - huawei.com/Ascend910B2
      - huawei.com/Ascend910B2-memory
      - huawei.com/Ascend910B3
      - huawei.com/Ascend910B3-memory
      - huawei.com/Ascend910B4
      - huawei.com/Ascend910B4-memory
      - huawei.com/Ascend910B4-1
      - huawei.com/Ascend910B4-1-memory
      - huawei.com/Ascend310P
      - huawei.com/Ascend310P-memory
  iluvatar:
    enabled: false
    customresources:
      - iluvatar.ai/BI-V100-vgpu
      - iluvatar.ai/BI-V100.vCore
      - iluvatar.ai/BI-V100.vMem
      - iluvatar.ai/BI-V150-vgpu
      - iluvatar.ai/BI-V150.vCore
      - iluvatar.ai/BI-V150.vMem
      - iluvatar.ai/MR-V100-vgpu
      - iluvatar.ai/MR-V100.vCore
      - iluvatar.ai/MR-V100.vMem
      - iluvatar.ai/MR-V50-vgpu
      - iluvatar.ai/MR-V50.vCore
      - iluvatar.ai/MR-V50.vMem
