diff --git a/services/backup/docker-server/contents/server/src/server.cpp b/services/backup/docker-server/contents/server/src/server.cpp index aa4441ec0..67b37868f 100644 --- a/services/backup/docker-server/contents/server/src/server.cpp +++ b/services/backup/docker-server/contents/server/src/server.cpp @@ -1,39 +1,39 @@ #include "BackupServiceImpl.h" #include #include #include #include namespace comm { namespace network { void RunServer() { std::string server_address = "0.0.0.0:50051"; BackupServiceImpl backupService; grpc::EnableDefaultHealthCheckService(true); grpc::ServerBuilder builder; // Listen on the given address without any authentication mechanism. builder.AddListeningPort(server_address, grpc::InsecureServerCredentials()); // Register "service" as the instance through which we'll communicate with // clients. In this case it corresponds to an *synchronous* service. builder.RegisterService(&backupService); // Finally assemble the server. std::unique_ptr server(builder.BuildAndStart()); - std::cout << "Server listening on " << server_address << std::endl; + std::cout << "Server listening" << std::endl; // Wait for the server to shutdown. Note that some other thread must be // responsible for shutting down the server for this call to ever return. server->Wait(); } } // namespace network } // namespace comm int main(int argc, char **argv) { comm::network::RunServer(); return 0; } diff --git a/services/package.json b/services/package.json index ff1973612..23296c6aa 100644 --- a/services/package.json +++ b/services/package.json @@ -1,14 +1,15 @@ { "name": "services", "version": "1.0.0", "private": true, "license": "BSD-3-Clause", "scripts": { "build-all": "docker-compose build", "build-base-image": "docker-compose build base", "build-tunnelbroker-base": "docker-compose build tunnelbroker-base", "run-tunnelbroker-server": "./scripts/run_server_image.sh tunnelbroker", "build-backup-base": "docker-compose build backup-base", - "run-backup-server": "./scripts/run_server_image.sh backup" + "run-backup-server": "./scripts/run_server_image.sh backup", + "run-all-services": "./scripts/run_all_services.sh" } } diff --git a/services/scripts/run_all_services.sh b/services/scripts/run_all_services.sh new file mode 100755 index 000000000..ffeaf4703 --- /dev/null +++ b/services/scripts/run_all_services.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +set -e + +. ./scripts/port_config.sh + +echo "tunnelbroker service will run at port ${COMM_SERVICES_PORT_TUNNELBROKER}" +echo "backup service will run at port ${COMM_SERVICES_PORT_BACKUP}" + + +docker-compose build tunnelbroker-server +docker-compose build backup-server + +docker-compose up diff --git a/services/tunnelbroker/docker-server/contents/server/src/server.cpp b/services/tunnelbroker/docker-server/contents/server/src/server.cpp index b3181d50b..c66cc5dbd 100644 --- a/services/tunnelbroker/docker-server/contents/server/src/server.cpp +++ b/services/tunnelbroker/docker-server/contents/server/src/server.cpp @@ -1,39 +1,39 @@ #include "TunnelBrokerServiceImpl.h" #include #include #include #include namespace comm { namespace network { void RunServer() { std::string server_address = "0.0.0.0:50051"; TunnelBrokerServiceImpl service; grpc::EnableDefaultHealthCheckService(true); grpc::ServerBuilder builder; // Listen on the given address without any authentication mechanism. builder.AddListeningPort(server_address, grpc::InsecureServerCredentials()); // Register "service" as the instance through which we'll communicate with // clients. In this case it corresponds to an *synchronous* service. builder.RegisterService(&service); // Finally assemble the server. std::unique_ptr server(builder.BuildAndStart()); - std::cout << "Server listening on " << server_address << std::endl; + std::cout << "Server listening" << std::endl; // Wait for the server to shutdown. Note that some other thread must be // responsible for shutting down the server for this call to ever return. server->Wait(); } } // namespace network } // namespace comm int main(int argc, char **argv) { comm::network::RunServer(); return 0; }