/* 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";

package tensorflow.grpc;

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

option java_outer_classname = "WorkerServiceProtos";
option java_multiple_files = true;
option java_package = "org.tensorflow.distruntime";
option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto";

////////////////////////////////////////////////////////////////////////////////
//
// WorkerService defines a TensorFlow service that executes dataflow
// graphs on a set of local devices, on behalf of a MasterService.
//
// A worker service keeps track of multiple "registered graphs". Each
// registered graph is a subgraph of a client's graph, corresponding to
// only the nodes that should execute on this worker (and any
// additional nodes necessary for inter-process communication using
// the `RecvTensor` method).
//
////////////////////////////////////////////////////////////////////////////////

service WorkerService {
  // See worker.proto for details.
  rpc GetStatus(GetStatusRequest) returns (GetStatusResponse) {
    // [AUTOMATION]: Internal rpc option goes here.
  }

  // See worker.proto for details.
  rpc CreateWorkerSession(CreateWorkerSessionRequest)
      returns (CreateWorkerSessionResponse) {
    // [AUTOMATION]: Internal rpc option goes here.
  }

  // See worker.proto for details.
  rpc DeleteWorkerSession(DeleteWorkerSessionRequest)
      returns (DeleteWorkerSessionResponse) {
    // [AUTOMATION]: Internal rpc option goes here.
  }

  // See worker.proto for details.
  rpc RegisterGraph(RegisterGraphRequest) returns (RegisterGraphResponse) {
    // [AUTOMATION]: Internal rpc option goes here.
  }

  // See worker.proto for details.
  rpc DeregisterGraph(DeregisterGraphRequest)
      returns (DeregisterGraphResponse) {
    // [AUTOMATION]: Internal rpc option goes here.
  }

  // See worker.proto for details.
  rpc RunGraph(RunGraphRequest) returns (RunGraphResponse) {
    // [AUTOMATION]: Internal rpc option goes here.
  }

  // See worker.proto for details.
  rpc CleanupGraph(CleanupGraphRequest) returns (CleanupGraphResponse) {
    // [AUTOMATION]: Internal rpc option goes here.
  }

  // See worker.proto for details.
  rpc CleanupAll(CleanupAllRequest) returns (CleanupAllResponse) {
    // [AUTOMATION]: Internal rpc option goes here.
  }

  // See worker.proto for details.
  rpc RecvTensor(RecvTensorRequest) returns (RecvTensorResponse) {
    // RecvTensor Method
  }

  // See worker.proto for details.
  rpc MarkRecvFinished(MarkRecvFinishedRequest)
      returns (MarkRecvFinishedResponse) {
    // [AUTOMATION]: Internal rpc option goes here.
  }

  // See worker.proto for details.
  rpc Logging(LoggingRequest) returns (LoggingResponse) {
    // [AUTOMATION]: Internal rpc option goes here.
  }

  // See worker.proto for details.
  rpc Tracing(TracingRequest) returns (TracingResponse) {
    // [AUTOMATION]: Internal rpc option goes here.
  }

  // See worker.proto for details.
  rpc RecvBuf(RecvBufRequest) returns (RecvBufResponse) {
    // [AUTOMATION]: Internal rpc option goes here.
  }

  // See worker.proto for details.
  rpc GetStepSequence(GetStepSequenceRequest)
      returns (GetStepSequenceResponse) {
    // [AUTOMATION]: Internal rpc option goes here.
  }

  // See worker.proto for details.
  rpc CompleteGroup(CompleteGroupRequest) returns (CompleteGroupResponse) {
    // [AUTOMATION]: Internal rpc option goes here.
  }

  // See worker.proto for details.
  rpc CompleteInstance(CompleteInstanceRequest)
      returns (CompleteInstanceResponse) {
    // [AUTOMATION]: Internal rpc option goes here.
  }
}
