# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.

kubernetes {

  enabled = false
  enabled = ${?KUBERNETES_COMPUTING_UNIT_ENABLED}

  compute-unit-pool-name = "texera-workflow-computing-unit"
  compute-unit-pool-name = ${?KUBERNETES_COMPUTE_UNIT_POOL_NAME}

  compute-unit-pool-namespace = "texera-workflow-computing-unit-pool"
  compute-unit-pool-namespace = ${?KUBERNETES_COMPUTE_UNIT_POOL_NAMESPACE}

  compute-unit-service-name = "workflow-computing-unit-svc"
  compute-unit-service-name = ${?KUBERNETES_COMPUTE_UNIT_SERVICE_NAME}

  image-name = "bobbai/texera-workflow-computing-unit:dev"
  image-name = ${?KUBERNETES_IMAGE_NAME}

  image-pull-policy = "Always"
  image-pull-policy = ${?KUBERNETES_IMAGE_PULL_POLICY}

  port-num = 8085

  # Configuration on how many computing units one user can create
  max-num-of-running-computing-units-per-user = 10
  max-num-of-running-computing-units-per-user = ${?MAX_NUM_OF_RUNNING_COMPUTING_UNITS_PER_USER}

  computing-unit-cpu-limit-options = "1,2,4"
  computing-unit-cpu-limit-options = ${?KUBERNETES_COMPUTING_UNIT_CPU_LIMIT_OPTIONS}

  computing-unit-memory-limit-options = "1Gi,2Gi,4Gi"
  computing-unit-memory-limit-options = ${?KUBERNETES_COMPUTING_UNIT_MEMORY_LIMIT_OPTIONS}

  # GPU configuration
  computing-unit-gpu-limit-options = "0,1,2"
  computing-unit-gpu-limit-options = ${?KUBERNETES_COMPUTING_UNIT_GPU_LIMIT_OPTIONS}
  
  # GPU resource key used in Kubernetes (vendor-specific)
  computing-unit-gpu-resource-key = "nvidia.com/gpu"
  computing-unit-gpu-resource-key = ${?KUBERNETES_COMPUTING_UNIT_GPU_RESOURCE_KEY}
}