apiVersion: template.openshift.io/v1
kind: Template
metadata:
  annotations:
    description: OpenVINO Model Server is a high performance model server from Intel
    tags: integration, isv,modelserving,intel,openvino
    labels:
      integration: modelserving
      provider: intel
      modelserver.type: openvino
  name: ovms-template
objects:
- apiVersion: intel.com/v1alpha1
  kind: ModelServer
  metadata:
    name: ${MODEL_SERVER_RESOURCE_NAME}
    namespace: ${MODEL_SERVER_NAMESPACE}
  spec:
    deployment_parameters:
      openshift_service_mesh: false
      replicas: 1
      resources:
        limits:
          cpu: ${CPUS}
          memory: ${MEMORY}
          xpu_device_quantity: "1"
        requests:
          cpu: ${CPUS}
          memory: ${MEMORY}
          xpu_device_quantity: "1"
    image_name: registry.connect.redhat.com/intel/openvino-model-server@sha256:f670aa3dc014b8786e554b8a3bb7e2e8475744d588e5e72d554660b74430a8c5
    models_repository:
      aws_access_key_id: ${AWS_ACCESS_KEY_ID}
      aws_region: ${AWS_DEFAULT_REGION}
      aws_secret_access_key: ${AWS_SECRET_ACCESS_KEY}
      azure_storage_connection_string: "${AZURE_CONNECTION_STRING}"
      gcp_creds_secret_name: "${GCP_CREDS_SECRET_NAME}"
      http_proxy: ""
      https_proxy: ""
      models_host_path: "${MODELS_HOST_PATH}"
      models_volume_claim: "${MODELS_VOLUME_CLAIM}"
      s3_compat_api_endpoint: "${AWS_S3_ENDPOINT}"
      storage_type: ${STORAGE_TYPE}
    models_settings:
      batch_size: "${BATCH_SIZE}"
      config_configmap_name: ""
      idle_sequence_cleanup: false
      is_stateful: false
      layout: ""
      low_latency_transformation: true
      max_sequence_number: 0
      model_config: ""
      model_name: ${MODEL_NAME}
      model_path: ${MODEL_PATH}
      model_version_policy: '{"latest": { "num_versions":1 }}'
      nireq: 0
      plugin_config: '{"CPU_THROUGHPUT_STREAMS":1}'
      shape: "${SHAPE}"
      single_model_mode: true
      target_device: CPU
    server_settings:
      file_system_poll_wait_seconds: 0
      grpc_workers: 1
      log_level: INFO
      rest_workers: 0
      sequence_cleaner_poll_wait_minutes: 0
    service_parameters:
      grpc_port: 8080
      rest_port: 8081
      service_type: ClusterIP
parameters:
  - description: Type of storage, enum of S3, Google, Azure, Local
    name: STORAGE_TYPE
    required: true
  - description: AWS Access Key ID
    name: AWS_ACCESS_KEY_ID
  - description: AWS Secret Access Key
    name: AWS_SECRET_ACCESS_KEY
  - description: AWS-Compatible S3 Endpoint for use with Ceph/etc
    name: AWS_S3_ENDPOINT
  - description: AWS Default Region
    name: AWS_DEFAULT_REGION
  - description: Azure Storage String
    name: AZURE_STORAGE_STRING
  - description: Secret name containing the GCP credentials
    name: GCP_CREDS_SECRET_NAME
  - description: Host path to mount the PVC under
    name: MODELS_HOST_PATH
  - description: Name of the PVC containing the models
    name: MODELS_VOLUME_CLAIM
# END STORAGE PARAMETERS
  - description: Model Path, including the storage prefix
    # Can't do this generically without some extra logic for local, since local wouldn't have ://
    name: MODEL_PATH
    required: true
  - description: Name of the model in the serving API
    name: MODEL_NAME
    required: true
  - description: Model inference batch size
    name: BATCH_SIZE
  - description: Input layer shape (will change the shape of the input layer if it differs)
    name: SHAPE
  - description: Name of the Model Server resource
    name: MODEL_SERVER_RESOURCE_NAME
  - description: Namespace to create the model server under
    name: MODEL_SERVER_NAMESPACE
  - description: Number of CPUs to allocate
    name: CPUS
  - description: Amount of memory to allocate
    name: MEMORY