Skip to content
Snippets Groups Projects
Commit a30e9a85 authored by IsolatedSushi's avatar IsolatedSushi
Browse files

update Proto

parent 728f4d25
No related branches found
No related tags found
1 merge request!10Web socket streaming
......@@ -7,18 +7,16 @@ kind: Service
apiVersion: v1
metadata:
name: proveeservice
namespace: proveeSpace
namespace: proveespace
spec:
selector:
app: proveeapp
app: gateway
ports:
- protocol: "TCP"
# Port accessible inside cluster
port: 8084
# Port to forward to inside the pod
targetPort: 9998
# Port accessible outside cluster
nodePort: 30002
......@@ -27,7 +25,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: proveedeployment
namespace: proveeSpace
namespace: proveespace
spec:
selector:
matchLabels:
......@@ -39,8 +37,12 @@ spec:
app: proveeapp
spec:
containers:
- name: proveeapp
image: proveeapp
- name: gateway
image: gateway
ports:
- containerPort: 9998
- name: projector
image: projector
ports:
- containerPort: 9999
\ No newline at end of file
......@@ -4,6 +4,5 @@ RUN mkdir -p /app
COPY . /app
RUN cd /app && npm install --production
EXPOSE 9090
WORKDIR /app
ENTRYPOINT ["npm", "start"]
\ No newline at end of file
......@@ -25,7 +25,7 @@ service Projector {
// Obtains the Projection Points in 2D given the trainings values stored in a row format. Results are
// streamed rather than returned at once (e.g. in a response message with a
// repeated field).
rpc getProjectionPoints(TrainingSet) returns (stream Point) {}
rpc getProjectionPoints(stream TrainingSetRow) returns (stream Point) {}
// A server-to-client streaming RPC.
//
......
......@@ -4,6 +4,5 @@ RUN mkdir -p /app
COPY . /app
RUN cd /app && npm install --production
EXPOSE 9090
WORKDIR /app
ENTRYPOINT ["npm", "start"]
\ No newline at end of file
syntax = "proto3";
package provee;
import "google/protobuf/empty.proto";
option java_multiple_files = true;
option java_package = "nl.uuvig.provee";
option java_outer_classname = "ProveProjectorGRCP";
option objc_class_prefix = "PROVEE";
// Interface exported by the server.
service Projector {
// A simple RPC.
//
// Start the Projector calculation
rpc start(google.protobuf.Empty) returns (google.protobuf.Empty);
// Stop the Projector calculation
rpc stop(google.protobuf.Empty) returns (google.protobuf.Empty);
// A server-to-client streaming RPC.
//
// Obtains the Projection Points in 2D given the trainings values stored in a row format. Results are
// streamed rather than returned at once (e.g. in a response message with a
// repeated field).
rpc getProjectionPoints(TrainingSet) returns (stream Point) {}
// A server-to-client streaming RPC.
//
// Obtains the Projection Points in 2D given the trainings values stored in a row format. Results are
// streamed rather than returned at once (e.g. in a response message with a
// repeated field).
rpc getUpdates(google.protobuf.Empty) returns (stream Point) {}
// // A client-to-server streaming RPC.
// //
// // Accepts a stream of Points on a route being traversed, returning a
// // RouteSummary when traversal is completed.
// rpc RecordRoute(stream Point) returns (RouteSummary) {}
// // A Bidirectional streaming RPC.
// //
// // Accepts a stream of RouteNotes sent while a route is being traversed,
// // while receiving other RouteNotes (e.g. from other users).
// rpc RouteChat(stream RouteNote) returns (stream RouteNote) {}
}
// Points are represented as x-y pairs
message Point {
int32 id = 1;
int32 x = 2;
int32 y = 3;
}
// Needs description
message TrainingSet {
string modelid = 1;
repeated TrainingSetRow rows = 2;
}
// Needs documentation
message TrainingSetRow {
// The id of the row, e.g., row index.
string id = 1;
// The hd vector of the item.
repeated double hdvector = 2 [packed=true];
}
......@@ -67,8 +67,9 @@ function echoPoint(ws, dataRow) {
}
function getPointStream(ws) {
var trainingSet = {modelid:"",rows:null};
var stream = client.getProjectionPoints(trainingSet);
console.log("stream")
var trainingSetRow = {id:"",hdvector:null};
var stream = client.getProjectionPoints(trainingSetRow);
stream.on("data", (response) => {
sendDataStream(JSON.stringify(response),ws)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment