apiVersion: apps/v1
kind: Deployment
metadata:
  name: simple-inference
spec:
  replicas: 1
  selector:
    matchLabels:
      app: simple-inference
  template:
    metadata:
      annotations:
        k8s.v1.cni.cncf.io/networks: rdma-net
      labels:
        app: simple-inference
    spec:
      securityContext:
        runAsUser: 0
      containers:
      - name: mnist-inference
        image: graphcore/pytorch-tutorials:latest
        command:
          - "sleep"
          - "infinity"
        env:
          - name: IPUOF_VIPU_API_HOST
            value: "localhost"
          - name: IPUOF_VIPU_API_PORT
            value: "8090"
          - name: IPUOF_VIPU_API_PARTITION_ID
            value: "inference_partition"
        securityContext:
          capabilities:
            add: [ "IPC_LOCK" ]
        resources:
          limits:
            rdma/rdma_shared_device_a: 1
          requests:
            rdma/rdma_shared_device_a: 1
