apiVersion: v1
kind: Pod
metadata:
  name: mnist-training
  labels:
    app: mnist
    type: training
    framework: tensorflow
spec:
  restartPolicy: OnFailure
  containers:
  - name: mnist-training
    image: seedjeffwan/mnist_tensorflow_keras:1.13.1
    command:
      - "python"
      - "mnist.py"
      - "--model_export_path"
      - "s3://$S3_BUCKET/mnist/tf_saved_model"
      - "--model_summary_path"
      - "s3://$S3_BUCKET/mnist/tf_summary"
      - "--epochs"
      - "40"
    env:
      - name: AWS_REGION
        value: $AWS_REGION
      - name: AWS_ACCESS_KEY_ID
        valueFrom:
          secretKeyRef:
            name: aws-secret
            key: AWS_ACCESS_KEY_ID
      - name: AWS_SECRET_ACCESS_KEY
        valueFrom:
          secretKeyRef:
            name: aws-secret
            key: AWS_SECRET_ACCESS_KEY
