• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/* Copyright 2016 The TensorFlow Authors. All Rights Reserved.
2
3Licensed under the Apache License, Version 2.0 (the "License");
4you may not use this file except in compliance with the License.
5You may obtain a copy of the License at
6
7    http://www.apache.org/licenses/LICENSE-2.0
8
9Unless required by applicable law or agreed to in writing, software
10distributed under the License is distributed on an "AS IS" BASIS,
11WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12See the License for the specific language governing permissions and
13limitations under the License.
14==============================================================================*/
15
16syntax = "proto3";
17
18package tensorflow;
19
20option cc_enable_arenas = true;
21option java_outer_classname = "ClusterProtos";
22option java_multiple_files = true;
23option java_package = "org.tensorflow.distruntime";
24option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto";
25
26// This file contains protos to be used when defining a TensorFlow
27// cluster.
28//
29// EXAMPLES
30// --------
31//
32// 1. A single-process cluster, containing "/job:local/task:0".
33//
34//    Cluster:
35//      job { name: 'local' tasks { key: 0 value: 'localhost:2222' } }
36//
37//    Server:
38//      cluster { $CLUSTER } job_name: 'local' task_index: 0
39//
40// 2. A two-process cluster, containing "/job:local/task:{0,1}".
41//
42//    Cluster:
43//      job { name: 'local' tasks { key: 0 value: 'localhost:2222' }
44//                          tasks { key: 1 value: 'localhost:2223' } }
45//
46//    Servers:
47//      cluster { $CLUSTER } job_name: 'local' task_index: 0
48//      cluster { $CLUSTER } job_name: 'local' task_index: 1
49//
50// 3. A two-job cluster, containing "/job:worker/task:{0,1,2}" and
51//    "/job:ps/task:{0,1}".
52//
53//    Cluster:
54//      job { name: 'worker' tasks { key: 0 value: 'worker1:2222' }
55//                           tasks { key: 1 value: 'worker2:2222' }
56//                           tasks { key: 2 value: 'worker3:2222' } }
57//      job { name: 'ps'     tasks { key: 0 value: 'ps0:2222' }
58//                           tasks { key: 1 value: 'ps1:2222' } }
59//
60//    Servers:
61//      cluster { $CLUSTER } job_name: 'worker' task_index: 0
62//      cluster { $CLUSTER } job_name: 'worker' task_index: 1
63//      cluster { $CLUSTER } job_name: 'worker' task_index: 2
64//      cluster { $CLUSTER } job_name: 'ps'     task_index: 0
65//      cluster { $CLUSTER } job_name: 'ps'     task_index: 1
66
67// Defines a single job in a TensorFlow cluster.
68message JobDef {
69  // The name of this job.
70  string name = 1;
71
72  // Mapping from task ID to "hostname:port" string.
73  //
74  // If the `name` field contains "worker", and the `tasks` map contains a
75  // mapping from 7 to "example.org:2222", then the device prefix
76  // "/job:worker/task:7" will be assigned to "example.org:2222".
77  map<int32, string> tasks = 2;
78}
79
80// Defines a TensorFlow cluster as a set of jobs.
81message ClusterDef {
82  // The jobs that comprise the cluster.
83  repeated JobDef job = 1;
84}
85