• 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;
19option cc_enable_arenas = true;
20option java_outer_classname = "ClusterProtos";
21option java_multiple_files = true;
22option java_package = "org.tensorflow.distruntime";
23option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf";
24
25// This file contains protos to be used when defining a TensorFlow
26// cluster.
27//
28// EXAMPLES
29// --------
30//
31// 1. A single-process cluster, containing "/job:local/task:0".
32//
33//    Cluster:
34//      job { name: 'local' tasks { key: 0 value: 'localhost:2222' } }
35//
36//    Server:
37//      cluster { $CLUSTER } job_name: 'local' task_index: 0
38//
39// 2. A two-process cluster, containing "/job:local/task:{0,1}".
40//
41//    Cluster:
42//      job { name: 'local' tasks { key: 0 value: 'localhost:2222' }
43//                          tasks { key: 1 value: 'localhost:2223' } }
44//
45//    Servers:
46//      cluster { $CLUSTER } job_name: 'local' task_index: 0
47//      cluster { $CLUSTER } job_name: 'local' task_index: 1
48//
49// 3. A two-job cluster, containing "/job:worker/task:{0,1,2}" and
50//    "/job:ps/task:{0,1}".
51//
52//    Cluster:
53//      job { name: 'worker' tasks { key: 0 value: 'worker1:2222' }
54//                           tasks { key: 1 value: 'worker2:2222' }
55//                           tasks { key: 2 value: 'worker3:2222' } }
56//      job { name: 'ps'     tasks { key: 0 value: 'ps0:2222' }
57//                           tasks { key: 1 value: 'ps1:2222' } }
58//
59//    Servers:
60//      cluster { $CLUSTER } job_name: 'worker' task_index: 0
61//      cluster { $CLUSTER } job_name: 'worker' task_index: 1
62//      cluster { $CLUSTER } job_name: 'worker' task_index: 2
63//      cluster { $CLUSTER } job_name: 'ps'     task_index: 0
64//      cluster { $CLUSTER } job_name: 'ps'     task_index: 1
65
66// Defines a single job in a TensorFlow cluster.
67message JobDef {
68  // The name of this job.
69  string name = 1;
70
71  // Mapping from task ID to "hostname:port" string.
72  //
73  // If the `name` field contains "worker", and the `tasks` map contains a
74  // mapping from 7 to "example.org:2222", then the device prefix
75  // "/job:worker/task:7" will be assigned to "example.org:2222".
76  map<int32, string> tasks = 2;
77}
78
79// Defines a TensorFlow cluster as a set of jobs.
80message ClusterDef {
81  // The jobs that comprise the cluster.
82  repeated JobDef job = 1;
83}
84