apiVersion: config.k8s.io/v1alpha1
kind: Krmfile
openAPI:
  definitions:
    io.k8s.cli.substitutions.ANNOTATIONS_DIR:
      x-k8s-cli:
        substitution:
          name: ANNOTATIONS_DIR
          pattern: ${DATASET_DIR}/annotations
          values:
          - marker: ${DATASET_DIR}
            ref: '#/definitions/io.k8s.cli.setters.DATASET_DIR'
    io.k8s.cli.setters.DATASET_DIR:
      description: input dataset directory
      x-k8s-cli:
        setter:
          name: DATASET_DIR
          value: /datasets
          isSet: true
          required: true
          setBy: model-builder
    io.k8s.cli.setters.FS_ID:
      type: integer
      description: owner id of mounted volumes
      x-k8s-cli:
        setter:
          name: FS_ID
          value: "0"
          isSet: true
          setBy: model-builder
          required: true
    io.k8s.cli.setters.GROUP_ID:
      type: integer
      description: process group id
      x-k8s-cli:
        setter:
          name: GROUP_ID
          value: "0"
          isSet: true
          setBy: model-builder
          required: true
    io.k8s.cli.substitutions.GROUP_ID_VALUE:
      x-k8s-cli:
        substitution:
          name: GROUP_ID_VALUE
          pattern: "${GROUP_ID}"
          values:
          - marker: ${GROUP_ID}
            ref: '#/definitions/io.k8s.cli.setters.GROUP_ID'
    io.k8s.cli.setters.GROUP_NAME:
      description: process group name
      x-k8s-cli:
        setter:
          name: GROUP_NAME
          value: root
          isSet: true
          setBy: model-builder
          required: true
    io.k8s.cli.substitutions.IMAGE:
      description: image name
      x-k8s-cli:
        substitution:
          name: IMAGE
          pattern: ${REGISTRY}/intel/object-detection:${IMAGE_VERSION}-${MODEL_NAME}${IMAGE_SUFFIX}
          values:
          - marker: ${REGISTRY}
            ref: '#/definitions/io.k8s.cli.setters.REGISTRY'
          - marker: ${IMAGE_VERSION}
            ref: '#/definitions/io.k8s.cli.setters.IMAGE_VERSION'
          - marker: ${MODEL_NAME}
            ref: '#/definitions/io.k8s.cli.setters.MODEL_NAME'
          - marker: ${IMAGE_SUFFIX}
            ref: '#/definitions/io.k8s.cli.setters.IMAGE_SUFFIX'
    io.k8s.cli.setters.IMAGE_VERSION:
      description: image version
      x-k8s-cli:
        setter:
          name: IMAGE_VERSION
          value: tf-2.3.0-imz-2.2.0
          isSet: true
          setBy: model-builder
    io.k8s.cli.setters.PREPROCESS_IMAGE_VERSION:
      description: image version
      x-k8s-cli:
        setter:
          name: PREPROCESS_IMAGE_VERSION
          value: tf-1.15.2-imz-2.2.0
          isSet: true
          setBy: model-builder
    io.k8s.cli.setters.IMAGE_SUFFIX:
      description: appended to image name
      x-k8s-cli:
        setter:
          name: IMAGE_SUFFIX
          value: ""
          isSet: true
          setBy: model-builder
    io.k8s.cli.substitutions.MODEL_COMMAND:
      x-k8s-cli:
        substitution:
          name: MODEL_COMMAND
          pattern: ${MODEL_DIR}/quickstart/${MODEL_SCRIPT}
          values:
          - marker: ${MODEL_DIR}
            ref: '#/definitions/io.k8s.cli.setters.MODEL_DIR'
          - marker: ${MODEL_SCRIPT}
            ref: '#/definitions/io.k8s.cli.setters.MODEL_SCRIPT'
    io.k8s.cli.setters.MODEL_DIR:
      description: container model directory
      x-k8s-cli:
        setter:
          name: MODEL_DIR
          value: /workspace/rfcn-fp32-inference
          setBy: model-builder
    io.k8s.cli.setters.MODEL_NAME:
      description: name use-case
      x-k8s-cli:
        setter:
          name: MODEL_NAME
          value: rfcn-fp32-inference
          isSet: true
          setBy: model-builder
    io.k8s.cli.setters.MODEL_SCRIPT:
      description: model script name
      x-k8s-cli:
        setter:
          name: MODEL_SCRIPT
          value: fp32_accuracy.sh
          isSet: true
          setBy: model-builder
    io.k8s.cli.setters.NFS_PATH:
      description: nfs path
      x-k8s-cli:
        setter:
          name: NFS_PATH
          value: /nfs
          isSet: true
          required: true
          setBy: model-builder
    io.k8s.cli.setters.NFS_SERVER:
      description: nfs server
      x-k8s-cli:
        setter:
          name: NFS_SERVER
          value: 0.0.0.0
          isSet: true
          required: true
          setBy: model-builder
    io.k8s.cli.setters.OUTPUT_DIR:
      description: output dir basename
      x-k8s-cli:
        setter:
          name: OUTPUT_DIR
          value: output
          isSet: true
          required: true
          setBy: model-builder
    io.k8s.cli.substitutions.PREPROCESS_COMMAND:
      x-k8s-cli:
        substitution:
          name: PREPROCESS_COMMAND
          pattern: ${PREPROCESS_DIR}/scripts/${PREPROCESS_SCRIPT}
          values:
          - marker: ${PREPROCESS_DIR}
            ref: '#/definitions/io.k8s.cli.setters.PREPROCESS_DIR'
          - marker: ${PREPROCESS_SCRIPT}
            ref: '#/definitions/io.k8s.cli.setters.PREPROCESS_SCRIPT'
    io.k8s.cli.setters.PREPROCESS_DIR:
      description: container preprocess directory
      x-k8s-cli:
        setter:
          name: PREPROCESS_DIR
          value: /workspace/preprocess-coco-val
          setBy: model-builder
    io.k8s.cli.substitutions.PREPROCESS_IMAGE:
      description: image name
      x-k8s-cli:
        substitution:
          name: PREPROCESS_IMAGE
          pattern: ${REGISTRY}/intel/object-detection:${PREPROCESS_IMAGE_VERSION}-${PREPROCESS_NAME}
          values:
          - marker: ${REGISTRY}
            ref: '#/definitions/io.k8s.cli.setters.REGISTRY'
          - marker: ${PREPROCESS_IMAGE_VERSION}
            ref: '#/definitions/io.k8s.cli.setters.PREPROCESS_IMAGE_VERSION'
          - marker: ${PREPROCESS_NAME}
            ref: '#/definitions/io.k8s.cli.setters.PREPROCESS_NAME'
          - marker: ${IMAGE_SUFFIX}
            ref: '#/definitions/io.k8s.cli.setters.IMAGE_SUFFIX'
    io.k8s.cli.setters.PREPROCESS_NAME:
      description: preprocess image part
      x-k8s-cli:
        setter:
          name: PREPROCESS_NAME
          value: preprocess-coco-val
          isSet: true
          setBy: model-builder
    io.k8s.cli.setters.PREPROCESS_SCRIPT:
      description: preprocess script
      x-k8s-cli:
        setter:
          name: PREPROCESS_SCRIPT
          value: preprocess_coco_val.sh
          isSet: true
          setBy: model-builder
    io.k8s.cli.setters.REGISTRY:
      description: image location
      x-k8s-cli:
        setter:
          name: REGISTRY
          value: docker.io
          isSet: true
          setBy: model-builder
    io.k8s.cli.setters.USER_ID:
      type: integer
      description: process owner id
      x-k8s-cli:
        setter:
          name: USER_ID
          value: "0"
          isSet: true
          setBy: model-builder
          required: true
    io.k8s.cli.substitutions.USER_ID_VALUE:
      x-k8s-cli:
        substitution:
          name: USER_ID_VALUE
          pattern: "${USER_ID}"
          values:
          - marker: ${USER_ID}
            ref: '#/definitions/io.k8s.cli.setters.USER_ID'
    io.k8s.cli.setters.USER_NAME:
      description: process owner name
      x-k8s-cli:
        setter:
          name: USER_NAME
          value: root
          isSet: true
          setBy: model-builder
          required: true
    io.k8s.cli.substitutions.VAL_IMAGE_DIR:
      x-k8s-cli:
        substitution:
          name: VAL_IMAGE_DIR
          pattern: ${DATASET_DIR}/val2017
          values:
          - marker: ${DATASET_DIR}
            ref: '#/definitions/io.k8s.cli.setters.DATASET_DIR'
    io.k8s.cli.substitutions.OUTPUT_PATH:
      x-k8s-cli:
        substitution:
          name: OUTPUT_PATH
          pattern: ${PVC_PATH}/${USER_NAME}/${MODEL_NAME}/${OUTPUT_DIR}
          values:
          - marker: ${PVC_PATH}
            ref: '#/definitions/io.k8s.cli.setters.PVC_PATH'
          - marker: ${USER_NAME}
            ref: '#/definitions/io.k8s.cli.setters.USER_NAME'
          - marker: ${MODEL_NAME}
            ref: '#/definitions/io.k8s.cli.setters.MODEL_NAME'
          - marker: ${OUTPUT_DIR}
            ref: '#/definitions/io.k8s.cli.setters.OUTPUT_DIR'
    io.k8s.cli.setters.PVC_NAME:
      description: pvc name
      x-k8s-cli:
        setter:
          name: PVC_NAME
          value: workdisk
          isSet: true
          required: true
          setBy: model-builder
    io.k8s.cli.setters.PVC_PATH:
      description: pvc path
      x-k8s-cli:
        setter:
          name: PVC_PATH
          value: /pvc
          isSet: true
          required: true
          setBy: model-builder
