pytorch-deploy.yaml 501 B

123456789101112131415161718192021
  1. apiVersion: batch/v1
  2. kind: Job
  3. metadata:
  4. name: pytorch-cpu-simple
  5. namespace: default
  6. spec:
  7. template:
  8. spec:
  9. containers:
  10. - name: cpu-pytorch
  11. image: docker.io/mapler/pytorch-cpu:latest
  12. volumeMounts:
  13. - mountPath: /pyscript
  14. name: torch-job-volume
  15. command: ["bash","-c","python /pyscript/pytorchcpu-example.py"]
  16. restartPolicy: Never
  17. volumes:
  18. - name: torch-job-volume
  19. hostPath:
  20. path: /home/k8s/torch-example