aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/protobuf/tensorflow_server.proto
blob: bc99ae96a3ef055f54f6590ba63f237207a40a2f (plain)
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/* Copyright 2016 The TensorFlow Authors. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/

syntax = "proto3";

import "tensorflow/core/protobuf/config.proto";

package tensorflow;
// option cc_enable_arenas = true;
option java_outer_classname = "ServerProtos";
option java_multiple_files = true;
option java_package = "org.tensorflow.distruntime";

// This file contains protos to be used when defining a TensorFlow
// cluster, and a server within that cluster.
//
// EXAMPLES
// --------
//
// 1. A single-process cluster, containing "/job:local/task:0".
//
//    Cluster:
//      job { name: 'local' tasks { key: 0 value: 'localhost:2222' } }
//
//    Server:
//      cluster { $CLUSTER } job_name: 'local' task_index: 0
//
// 2. A two-process cluster, containing "/job:local/task:{0,1}".
//
//    Cluster:
//      job { name: 'local' tasks { key: 0 value: 'localhost:2222' }
//                          tasks { key: 1 value: 'localhost:2223' } }
//
//    Servers:
//      cluster { $CLUSTER } job_name: 'local' task_index: 0
//      cluster { $CLUSTER } job_name: 'local' task_index: 1
//
// 3. A two-job cluster, containing "/job:worker/task:{0,1,2}" and
//    "/job:ps/task:{0,1}".
//
//    Cluster:
//      job { name: 'worker' tasks { key: 0 value: 'worker1:2222' }
//                           tasks { key: 1 value: 'worker2:2222' }
//                           tasks { key: 2 value: 'worker3:2222' } }
//      job { name: 'ps'     tasks { key: 0 value: 'ps0:2222' }
//                           tasks { key: 1 value: 'ps1:2222' } }
//
//    Servers:
//      cluster { $CLUSTER } job_name: 'worker' task_index: 0
//      cluster { $CLUSTER } job_name: 'worker' task_index: 1
//      cluster { $CLUSTER } job_name: 'worker' task_index: 2
//      cluster { $CLUSTER } job_name: 'ps'     task_index: 0
//      cluster { $CLUSTER } job_name: 'ps'     task_index: 1

// Defines a single job in a TensorFlow cluster.
message JobDef {
  // The name of this job.
  string name = 1;

  // Mapping from task ID to "hostname:port" string.
  //
  // If the `name` field contains "worker", and the `tasks` map contains a
  // mapping from 7 to "example.org:2222", then the device prefix
  // "/job:worker/task:7" will be assigned to "example.org:2222".
  //
  // NOTE(mrry): Currently, only a dense task ID space starting at 0 is
  // supported.
  map<int32, string> tasks = 2;
}

// Defines a TensorFlow cluster as a set of jobs.
message ClusterDef {
  // The jobs that comprise the cluster.
  repeated JobDef job = 1;
}

// Defines the configuration of a single TensorFlow server.
message ServerDef {
  // The cluster of which this server is a member.
  ClusterDef cluster = 1;

  // The name of the job of which this server is a member.
  //
  // NOTE(mrry): The `cluster` field must contain a `JobDef` with a `name` field
  // that matches this name.
  string job_name = 2;

  // The task index of this server in its job.
  //
  // NOTE: The `cluster` field must contain a `JobDef` with a matching `name`
  // and a mapping in its `tasks` field for this index.
  int32 task_index = 3;

  // The default configuration for sessions that run on this server.
  ConfigProto default_session_config = 4;

  // The protocol to be used by this server.
  //
  // Acceptable values include: "grpc".
  string protocol = 5;
}