diff --git a/example/integrations/tensorflow/Dockerfile b/example/integrations/tensorflow/benchmark/Dockerfile similarity index 100% rename from example/integrations/tensorflow/Dockerfile rename to example/integrations/tensorflow/benchmark/Dockerfile diff --git a/example/integrations/tensorflow/tf-example.yaml b/example/integrations/tensorflow/benchmark/tf-example.yaml similarity index 100% rename from example/integrations/tensorflow/tf-example.yaml rename to example/integrations/tensorflow/benchmark/tf-example.yaml diff --git a/example/integrations/tensorflow/dist-mnist/tf-dist-mnist-example.yaml b/example/integrations/tensorflow/dist-mnist/tf-dist-mnist-example.yaml new file mode 100644 index 00000000000..121f6a4aec4 --- /dev/null +++ b/example/integrations/tensorflow/dist-mnist/tf-dist-mnist-example.yaml @@ -0,0 +1,57 @@ +apiVersion: batch.volcano.sh/v1alpha1 +kind: Job +metadata: + name: tensorflow-dist-mnist +spec: + minAvailable: 3 + schedulerName: volcano + plugins: + env: [] + svc: [] + policies: + - event: PodEvicted + action: RestartJob + tasks: + - replicas: 1 + name: ps + template: + spec: + containers: + - command: + - sh + - -c + - | + PS_HOST=`cat /etc/volcano/ps.host | sed 's/$/&:2222/g' | sed 's/^/"/;s/$/"/' | tr "\n" ","`; + WORKER_HOST=`cat /etc/volcano/worker.host | sed 's/$/&:2222/g' | sed 's/^/"/;s/$/"/' | tr "\n" ","`; + export TF_CONFIG={\"cluster\":{\"ps\":[${PS_HOST}],\"worker\":[${WORKER_HOST}]},\"task\":{\"type\":\"ps\",\"index\":${VK_TASK_INDEX}},\"environment\":\"cloud\"}; + python /var/tf_dist_mnist/dist_mnist.py + image: thanda/tf-operator-example:1.0 + name: tensorflow + ports: + - containerPort: 2222 + name: tfjob-port + resources: {} + restartPolicy: Never + - replicas: 2 + name: worker + policies: + - event: TaskCompleted + action: CompleteJob + template: + spec: + containers: + - command: + - sh + - -c + - | + PS_HOST=`cat /etc/volcano/ps.host | sed 's/$/&:2222/g' | sed 's/^/"/;s/$/"/' | tr "\n" ","`; + WORKER_HOST=`cat /etc/volcano/worker.host | sed 's/$/&:2222/g' | sed 's/^/"/;s/$/"/' | tr "\n" ","`; + export TF_CONFIG={\"cluster\":{\"ps\":[${PS_HOST}],\"worker\":[${WORKER_HOST}]},\"task\":{\"type\":\"worker\",\"index\":${VK_TASK_INDEX}},\"environment\":\"cloud\"}; + python /var/tf_dist_mnist/dist_mnist.py + image: thanda/tf-operator-example:1.0 + name: tensorflow + ports: + - containerPort: 2222 + name: tfjob-port + resources: {} + restartPolicy: Never \ No newline at end of file