tf_trainer.yaml 1.4 KB
Newer Older
G
gongweibao 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
apiVersion: batch/v1
kind: Job
metadata:
  name: vgg16job-tf-trainer
spec:
  parallelism: 20
  completions: 20
  template:
    metadata:
      labels:
        tf-job-trainer: vgg16job-tf
    spec:
      imagePullSecrets:
      - name: job-registry-secret
      hostNetwork: true
      containers:
      - name: trainer
        image: "registry.baidu.com/paddlepaddle/fluid_benchmark_tf:vgg16"
        imagePullPolicy: Always
        command: ["tf_k8s", "start_tf"]
        ports:
        - name: jobport-30236
          containerPort: 30236
        env:
        - name: PORT
          value: "32036"
        - name: JOB_NAME
          value: vgg16job-tf
        - name: TF_JOB_NAME 
          value: "worker"
        - name: ENTRY
          value: "python vgg16_tf.py"
        - name: PSERVERS_NUM
          value: "10"
        - name: BATCH_SIZE
          value: "128"
        - name: TRAINERS_NUM
          value: "20"
        - name: TRAINER_PACKAGE
          value: "/workspace"
        - name: NUM_PASSES
          value: "1"
        - name: NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: "metadata.namespace"
        - name: POD_IP
          valueFrom:
            fieldRef:
              fieldPath: "status.podIP"
        resources:
          requests:
            memory: 40Gi
            cpu: 2
          limits:
            memory: 40Gi
            cpu: 2
      restartPolicy: Never