diff --git a/docs/dev_services.md b/docs/dev_services.md --- a/docs/dev_services.md +++ b/docs/dev_services.md @@ -85,17 +85,17 @@ To start a certain service in the sandbox you can run the following command: ``` -yarn run-[service-name]-service-dev-mode +yarn run-[service-name]-service-in-sandbox ``` For example, for Tunnelbroker the command will look like this: ``` -yarn run-tunnelbroker-service-dev-mode +yarn run-tunnelbroker-service-in-sandbox ``` You can also run all services at once in the sandbox using the command below: ``` -yarn run-all-services-dev-mode +yarn run-all-services-in-sandbox ``` diff --git a/services/backup/Dockerfile b/services/backup/Dockerfile --- a/services/backup/Dockerfile +++ b/services/backup/Dockerfile @@ -5,10 +5,10 @@ rm -rf /var/lib/apt/lists/* ARG COMM_TEST_SERVICES -ARG COMM_SERVICES_DEV_MODE +ARG COMM_SERVICES_SANDBOX ENV COMM_TEST_SERVICES=${COMM_TEST_SERVICES} -ENV COMM_SERVICES_DEV_MODE=${COMM_SERVICES_DEV_MODE} +ENV COMM_SERVICES_SANDBOX=${COMM_SERVICES_SANDBOX} WORKDIR /transferred diff --git a/services/blob/Dockerfile b/services/blob/Dockerfile --- a/services/blob/Dockerfile +++ b/services/blob/Dockerfile @@ -5,10 +5,10 @@ rm -rf /var/lib/apt/lists/* ARG COMM_TEST_SERVICES -ARG COMM_SERVICES_DEV_MODE +ARG COMM_SERVICES_SANDBOX ENV COMM_TEST_SERVICES=${COMM_TEST_SERVICES} -ENV COMM_SERVICES_DEV_MODE=${COMM_SERVICES_DEV_MODE} +ENV COMM_SERVICES_SANDBOX=${COMM_SERVICES_SANDBOX} WORKDIR /transferred diff --git a/services/blob/src/S3Tools.cpp b/services/blob/src/S3Tools.cpp --- a/services/blob/src/S3Tools.cpp +++ b/services/blob/src/S3Tools.cpp @@ -32,7 +32,7 @@ std::unique_ptr getS3Client() { Aws::Client::ClientConfiguration config; config.region = AWS_REGION; - if (tools::isDevMode()) { + if (tools::isSandbox()) { config.endpointOverride = Aws::String("localstack:4566"); config.scheme = Aws::Http::Scheme::HTTP; return std::make_unique( diff --git a/services/docker-compose.yml b/services/docker-compose.yml --- a/services/docker-compose.yml +++ b/services/docker-compose.yml @@ -12,7 +12,7 @@ context: ../ args: - COMM_TEST_SERVICES=${COMM_TEST_SERVICES} - - COMM_SERVICES_DEV_MODE=${COMM_SERVICES_DEV_MODE} + - COMM_SERVICES_SANDBOX=${COMM_SERVICES_SANDBOX} image: commapp/tunnelbroker-server:0.2 ports: - "${COMM_SERVICES_PORT_TUNNELBROKER}:50051" @@ -30,7 +30,7 @@ context: ../ args: - COMM_TEST_SERVICES=${COMM_TEST_SERVICES} - - COMM_SERVICES_DEV_MODE=${COMM_SERVICES_DEV_MODE} + - COMM_SERVICES_SANDBOX=${COMM_SERVICES_SANDBOX} image: commapp/backup-server:0.1 ports: - "${COMM_SERVICES_PORT_BACKUP}:50051" @@ -45,7 +45,7 @@ context: ../ args: - COMM_TEST_SERVICES=${COMM_TEST_SERVICES} - - COMM_SERVICES_DEV_MODE=${COMM_SERVICES_DEV_MODE} + - COMM_SERVICES_SANDBOX=${COMM_SERVICES_SANDBOX} image: commapp/blob-server:0.1 ports: - "${COMM_SERVICES_PORT_BLOB}:50051" diff --git a/services/lib/src/DynamoDBTools.cpp b/services/lib/src/DynamoDBTools.cpp --- a/services/lib/src/DynamoDBTools.cpp +++ b/services/lib/src/DynamoDBTools.cpp @@ -9,7 +9,7 @@ std::unique_ptr getDynamoDBClient() { Aws::Client::ClientConfiguration config; config.region = AWS_REGION; - if (tools::isDevMode()) { + if (tools::isSandbox()) { config.endpointOverride = Aws::String("localstack:4566"); config.scheme = Aws::Http::Scheme::HTTP; } diff --git a/services/lib/src/GlobalTools.h b/services/lib/src/GlobalTools.h --- a/services/lib/src/GlobalTools.h +++ b/services/lib/src/GlobalTools.h @@ -15,7 +15,7 @@ std::string decorateTableName(const std::string &baseName); -bool isDevMode(); +bool isSandbox(); std::string generateUUID(); diff --git a/services/lib/src/GlobalTools.cpp b/services/lib/src/GlobalTools.cpp --- a/services/lib/src/GlobalTools.cpp +++ b/services/lib/src/GlobalTools.cpp @@ -34,8 +34,8 @@ return baseName + suffix; } -bool isDevMode() { - return hasEnvFlag("COMM_SERVICES_DEV_MODE"); +bool isSandbox() { + return hasEnvFlag("COMM_SERVICES_SANDBOX"); } std::string generateUUID() { diff --git a/services/package.json b/services/package.json --- a/services/package.json +++ b/services/package.json @@ -8,20 +8,22 @@ "build-base-image": "./scripts/build_base_image.sh", "run-tunnelbroker-service": "./scripts/run_server_image.sh tunnelbroker", "test-tunnelbroker-service": "./scripts/test_service.sh tunnelbroker", - "run-tunnelbroker-service-dev-mode": "COMM_SERVICES_DEV_MODE=1 ./scripts/run_server_image.sh tunnelbroker", - "test-tunnelbroker-service-dev-mode": "COMM_SERVICES_DEV_MODE=1 ./scripts/test_service.sh tunnelbroker", + "run-tunnelbroker-service-in-sandbox": "COMM_SERVICES_SANDBOX=1 ./scripts/run_server_image.sh tunnelbroker", + "test-tunnelbroker-service-in-sandbox": "COMM_SERVICES_SANDBOX=1 ./scripts/test_service.sh tunnelbroker", + "build-backup-base": "./scripts/build_base_image.sh && docker-compose build backup-base", "run-backup-service": "./scripts/run_server_image.sh backup", "test-backup-service": "./scripts/test_service.sh backup", - "run-backup-service-dev-mode": "COMM_SERVICES_DEV_MODE=1 ./scripts/run_server_image.sh backup", - "test-backup-service-dev-mode": "COMM_SERVICES_DEV_MODE=1 ./scripts/test_service.sh backup", + "run-backup-service-in-sandbox": "COMM_SERVICES_SANDBOX=1 ./scripts/run_server_image.sh backup", + "test-backup-service-in-sandbox": "COMM_SERVICES_SANDBOX=1 ./scripts/test_service.sh backup", + "build-blob-base": "./scripts/build_base_image.sh && docker-compose build blob-base", "run-blob-service": "./scripts/run_server_image.sh blob", "test-blob-service": "./scripts/test_service.sh blob", - "run-blob-service-dev-mode": "COMM_SERVICES_DEV_MODE=1 ./scripts/run_server_image.sh blob", - "test-blob-service-dev-mode": "COMM_SERVICES_DEV_MODE=1 ./scripts/test_service.sh blob", + "run-blob-service-in-sandbox": "COMM_SERVICES_SANDBOX=1 ./scripts/run_server_image.sh blob", + "test-blob-service-in-sandbox": "COMM_SERVICES_SANDBOX=1 ./scripts/test_service.sh blob", "run-all-services": "./scripts/run_all_services.sh", "test-all-services": "./scripts/test_all_services.sh", - "test-all-services-dev-mode": "COMM_SERVICES_DEV_MODE=1 ./scripts/test_all_services.sh", - "run-all-services-dev-mode": "COMM_SERVICES_DEV_MODE=1 ./scripts/run_all_services.sh", + "test-all-services-in-sandbox": "COMM_SERVICES_SANDBOX=1 ./scripts/test_all_services.sh", + "run-all-services-in-sandbox": "COMM_SERVICES_SANDBOX=1 ./scripts/run_all_services.sh", "init-local-cloud": "./scripts/init_local_cloud.sh" } -} +} \ No newline at end of file diff --git a/services/tunnelbroker/Dockerfile b/services/tunnelbroker/Dockerfile --- a/services/tunnelbroker/Dockerfile +++ b/services/tunnelbroker/Dockerfile @@ -16,10 +16,10 @@ RUN ./install_libuv.sh ARG COMM_TEST_SERVICES -ARG COMM_SERVICES_DEV_MODE +ARG COMM_SERVICES_SANDBOX ENV COMM_TEST_SERVICES=${COMM_TEST_SERVICES} -ENV COMM_SERVICES_DEV_MODE=${COMM_SERVICES_DEV_MODE} +ENV COMM_SERVICES_SANDBOX=${COMM_SERVICES_SANDBOX} WORKDIR /transferred diff --git a/services/tunnelbroker/src/server.cpp b/services/tunnelbroker/src/server.cpp --- a/services/tunnelbroker/src/server.cpp +++ b/services/tunnelbroker/src/server.cpp @@ -38,7 +38,7 @@ void InitLogging(const char *programName) { FLAGS_logtostderr = true; FLAGS_colorlogtostderr = true; - if (comm::network::tools::isDevMode()) { + if (comm::network::tools::isSandbox()) { // Log levels INFO, WARNING, ERROR, FATAL are 0, 1, 2, 3, respectively FLAGS_minloglevel = 0; } else { @@ -52,7 +52,7 @@ int main(int argc, char **argv) { comm::network::InitLogging(argv[0]); - if (comm::network::tools::isDevMode()) { + if (comm::network::tools::isSandbox()) { comm::network::config::ConfigManager::getInstance().load( comm::network::DEV_CONFIG_FILE_PATH); } else {