apiVersion: v1
kind: Pod
metadata:
  name: wide-deep-large-ds-fp32-training # {"$openapi":"MODEL_NAME"}
spec:
  serviceAccountName: wide-deep-large-ds-fp32-training # {"$openapi":"MODEL_NAME"}
  securityContext:
    runAsUser: 0 # {"$openapi":"USER_ID"}
    runAsGroup: 0 # {"$openapi":"GROUP_ID"}
    fsGroup: 0 # {"$openapi":"FS_ID"}
  initContainers:
  - name: create-output-dir
    image: docker.io/intel/recommendation:tf-2.4.0-wide-deep-large-ds-fp32-training # {"$openapi":"IMAGE"}
    imagePullPolicy: IfNotPresent
    workingDir: /workspace/wide-deep-large-ds-fp32-training # {"$openapi":"MODEL_DIR"}
    command:
    - mkdir
    args: 
    - -p
    - $(OUTPUT_DIR)
    envFrom:
    - configMapRef:
        name: wide-deep-large-ds-fp32-training # {"$openapi":"MODEL_NAME"}
    volumeMounts:
    - name: pvc-path
      mountPath: /pvc # {"$openapi":"PVC_PATH"}
  - name: create-checkpoint-dir
    image: docker.io/intel/recommendation:tf-2.4.0-wide-deep-large-ds-fp32-training # {"$openapi":"IMAGE"}
    imagePullPolicy: IfNotPresent
    workingDir: /workspace/wide-deep-large-ds-fp32-training # {"$openapi":"MODEL_DIR"}
    command:
    - mkdir
    args: 
    - -p
    - $(CHECKPOINT_DIR)
    envFrom:
    - configMapRef:
        name: wide-deep-large-ds-fp32-training # {"$openapi":"MODEL_NAME"}
    volumeMounts:
    - name: pvc-path
      mountPath: /pvc # {"$openapi":"PVC_PATH"}
  containers:
  - name: single-node
    image: docker.io/intel/recommendation:tf-2.4.0-wide-deep-large-ds-fp32-training # {"$openapi":"IMAGE"}
    imagePullPolicy: IfNotPresent
    workingDir: /workspace/wide-deep-large-ds-fp32-training # {"$openapi":"MODEL_DIR"}
    command:
    - python
    args: # {"$openapi":"COMMAND"}
    - /workspace/wide-deep-large-ds-fp32-training/benchmarks/launch_benchmark.py # {"$openapi":"COMMAND"}
    - --model-name=wide_deep_large_ds
    - --precision=fp32
    - --mode=training
    - --framework=tensorflow
    - --batch-size=512
    - --data-location=$(DATASET_DIR)
    - --output-dir=$(OUTPUT_DIR)
    - --checkpoint=$(CHECKPOINT_DIR)
    envFrom:
    - configMapRef:
        name: wide-deep-large-ds-fp32-training # {"$openapi":"MODEL_NAME"}
    volumeMounts:
    - name: datasets
      mountPath: /datasets # {"$openapi":"DATASET_DIR"}
      readOnly: true
    - name: pvc-path
      mountPath: /pvc # {"$openapi":"PVC_PATH"}
  volumes:
  - name: datasets
    hostPath:
      path: /datasets # {"$openapi":"DATASET_DIR"}
  - name: pvc-path
    persistentVolumeClaim:
      claimName: workdisk # {"$openapi":"PVC_NAME"}
  restartPolicy: OnFailure
