# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2020 Intel Corporation

apiVersion: batch/v1
kind: Job
metadata:
  name: openvino-benchmark-job
  labels:
    jobgroup: openvino-benchmark
spec:
  parallelism: 1
  template:
    metadata:
      labels:
        jobgroup: openvino-benchmark
    spec:
      restartPolicy: Never
      containers:
        - name: openvino-benchmark-job
          image: docker
          imagePullPolicy: IfNotPresent
          command: [ "/bin/sh" ]
          args: ["-c", "/usr/local/bin/docker run --rm --device-cgroup-rule='c 10:* rmw' --device-cgroup-rule='c 89:* rmw' --device-cgroup-rule='c 189:* rmw' --device-cgroup-rule='c 180:* rmw' -v /dev:/dev -v /var/tmp:/var/tmp openvino-benchmark:1.0 /do_benchmark.sh"]
          securityContext:
            readOnlyRootFilesystem: false
            privileged: true
          volumeMounts:
              - name: dockersock
                mountPath: /var/run/docker.sock
              - name: usrsrc
                mountPath: /usr/src
                readOnly: true
              - name: libmodules
                mountPath: /lib/modules
              - name: etcmodules
                mountPath: /etc/modules-load.d
              - name: vartmp
                mountPath: /var/tmp
      volumes:
          - name: dockersock
            hostPath:
                path: /var/run/docker.sock
          - name: usrsrc
            hostPath:
                path: /usr/src
          - name: libmodules
            hostPath:
                path: /lib/modules
          - name: etcmodules
            hostPath:
                path: /etc/modules-load.d
          - name: vartmp
            hostPath:
                path: /var/tmp
