<commit_before>//
// Copyright 2018 The Project Oak Authors
//
// 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 oak;

// An ApplicationConfiguration represents a unit of deployment in Oak.
//
// It defines a connectivity graph using unidirectional Channels between Nodes.
//
// The following constraints apply to the Application configuration:
// - at most one GrpcServerNode
// - at most one LogNode
message ApplicationConfiguration {
  repeated Node nodes = 1;
  repeated Channel channels = 2;
}

// A Node represents a unit of computation in Oak.
message Node {
  // The name of the Node. Must be unique within the Application.
  string node_name = 1;

  oneof node_type {
    LogNode log_node = 2;
    GrpcServerNode grpc_server_node = 3;
    WebAssemblyNode web_assembly_node = 4;
  }
}

// A pseudo-Node that corresponds to an external-facing gRPC server interface
// exposed by the Application. External clients can connect to the server and
// interact with the Application over gRPC.
//
// An Application that exposes an external gRPC server interface should
// therefore include a single GrpcServerNode, and should configure a pair of
// Channels (send + receive) between that Node and a WebAssemblyNode that
// handles the gRPC requests.
//
// This Node defines the following implicit Ports:
// - `request`: OUT port on which incoming requests are sent to a WebAssembly
//   processing Node
// - `response`: IN port on which outgoing responses are sent back by the
//   WebAssembly processing Node
message GrpcServerNode {
}

// A pseudo-Node that logs anything that is sent to it on the machine on which
// the Application is running.
//
// This Node is unsafe and only to be used for testing, since it leaks all the
// data that it handles.
//
// This Node defines the following implicit Ports:
// - `in`: IN port on which other Nodes send entries to log
message LogNode {
}

// A Node that runs the provided WebAssembly code.
message WebAssemblyNode {
  // The compiled code of the Oak Module to instantiate, in WebAssembly binary
  // format.
  // See https://webassembly.org/docs/binary-encoding/ .
  // TODO: Replace this with just a hash of the bytecode to instantiate, and
  // pass the actual bytecode to the Oak Manager in some other way.
  bytes module_bytes = 1;

  // The set of Ports available to the Node, which it can use to communicate
  // with other Nodes or with the System.
  // They may be of different types and specified in any order.
  repeated Port ports = 2;<commit_msg>Add StorageNode to application proto definition<commit_after>//
// Copyright 2018 The Project Oak Authors
//
// 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 oak;

// An ApplicationConfiguration represents a unit of deployment in Oak.
//
// It defines a connectivity graph using unidirectional Channels between Nodes.
//
// The following constraints apply to the Application configuration:
// - at most one GrpcServerNode
// - at most one LogNode
message ApplicationConfiguration {
  repeated Node nodes = 1;
  repeated Channel channels = 2;
}

// A Node represents a unit of computation in Oak.
message Node {
  // The name of the Node. Must be unique within the Application.
  string node_name = 1;

  oneof node_type {
    LogNode log_node = 2;
    GrpcServerNode grpc_server_node = 3;
    WebAssemblyNode web_assembly_node = 4;
    StorageNode storage_node = 5;
  }
}

// A pseudo-Node that corresponds to an external-facing gRPC server interface
// exposed by the Application. External clients can connect to the server and
// interact with the Application over gRPC.
//
// An Application that exposes an external gRPC server interface should
// therefore include a single GrpcServerNode, and should configure a pair of
// Channels (send + receive) between that Node and a WebAssemblyNode that
// handles the gRPC requests.
//
// This Node defines the following implicit Ports:
// - `request`: OUT port on which incoming requests are sent to a WebAssembly
//   processing Node
// - `response`: IN port on which outgoing responses are sent back by the
//   WebAssembly processing Node
message GrpcServerNode {
}

// A pseudo-Node that logs anything that is sent to it on the machine on which
// the Application is running.
//
// This Node is unsafe and only to be used for testing, since it leaks all the
// data that it handles.
//
// This Node defines the following implicit Ports:
// - `in`: IN port on which other Nodes send entries to log
message LogNode {
}

// A Node that runs the provided WebAssembly code.
message WebAssemblyNode {
  // The compiled code of the Oak Module to instantiate, in WebAssembly binary
  // format.
  // See https://webassembly.org/docs/binary-encoding/ .
  // TODO: Replace this with just a hash of the bytecode to instantiate, and
  // pass the actual bytecode to the Oak Manager in some other way.
  bytes module_bytes = 1;

  // The set of Ports available to the Node, which it can use to communicate
  // with other Nodes or with the System.
  // They may be of different types and specified in any order.
  repeated Port ports = 2;
}

// A pseudo-Node that accepts storage requests and forwards them to an
// external storage provider.
//
// This Node defines the following implicit Ports:
// - `request`: IN port on which outgoing storage requests are received.
// - `response`: OUT port on which inbound responses to storage requests are
// sent.
message StorageNode {
  // The address of the external storage provider.
  string address = 1;
{'fraction_non_alphanumeric': 0.07303712720632989, 'fraction_numerical': 0.005477784540474742, 'mean_word_length': 3.279296875, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6503918', 'n_tokens_mistral': 1708, 'n_tokens_neox': 1648, 'n_words': 900}