apiVersion: graphcore.ai/v1alpha1
kind: IPUJob
metadata:
  name: mnist-training
spec:
  # jobInstances defines the number of job instances.
  # More than 1 job instance is usually useful for inference jobs only.
  jobInstances: 1
  # ipusPerJobInstance refers to the number of IPUs required per job instance.
  # A separate IPU partition of this size will be created by the IPU Operator
  # for each job instance.
  ipusPerJobInstance: "1"
  workers:
    template:
      spec:
        containers:
        - name: mnist-training
          image: graphcore/pytorch-tutorials:3.0.0
          workingDir: "/opt/tutorials/simple_applications/pytorch/mnist"
          command: ["bash"]
          args: ["-c", "pip3 install -r requirements.txt && python3 mnist_poptorch.py --epochs=1"]
        restartPolicy: Never
