diff --git a/services/blob/docker-server/contents/server/CMakeLists.txt b/services/blob/CMakeLists.txt similarity index 100% rename from services/blob/docker-server/contents/server/CMakeLists.txt rename to services/blob/CMakeLists.txt diff --git a/services/blob/Dockerfile b/services/blob/Dockerfile new file mode 100644 index 000000000..f8d2afe60 --- /dev/null +++ b/services/blob/Dockerfile @@ -0,0 +1,21 @@ +FROM commapp/services-base:1.1 + +RUN apt-get update && \ + apt-get install -y uuid-dev && \ + rm -rf /var/lib/apt/lists/* + +WORKDIR /transferred + +COPY native/cpp/CommonCpp/grpc/protos/blob.proto protos/blob.proto +COPY services/blob/docker/ scripts/ +COPY services/blob/ . + +ARG COMM_SERVICES_DEV_MODE +ENV COMM_SERVICES_DEV_MODE=${COMM_SERVICES_DEV_MODE} + +ARG COMM_TEST_SERVICES +ENV COMM_TEST_SERVICES=${COMM_TEST_SERVICES} + +RUN scripts/build_server.sh + +CMD if [ "$COMM_TEST_SERVICES" -eq 1 ]; then scripts/run_tests.sh; else scripts/run_server.sh; fi diff --git a/services/blob/docker-server/contents/server/cmake-components/folly.cmake b/services/blob/cmake-components/folly.cmake similarity index 100% rename from services/blob/docker-server/contents/server/cmake-components/folly.cmake rename to services/blob/cmake-components/folly.cmake diff --git a/services/blob/docker-server/contents/server/cmake-components/grpc.cmake b/services/blob/cmake-components/grpc.cmake similarity index 100% rename from services/blob/docker-server/contents/server/cmake-components/grpc.cmake rename to services/blob/cmake-components/grpc.cmake diff --git a/services/blob/docker-server/contents/server/dev/DatabaseSimulator.h b/services/blob/dev/DatabaseSimulator.h similarity index 100% rename from services/blob/docker-server/contents/server/dev/DatabaseSimulator.h rename to services/blob/dev/DatabaseSimulator.h diff --git a/services/blob/docker-server/contents/server/dev/DevTools.cpp b/services/blob/dev/DevTools.cpp similarity index 100% rename from services/blob/docker-server/contents/server/dev/DevTools.cpp rename to services/blob/dev/DevTools.cpp diff --git a/services/blob/docker-server/contents/server/dev/DevTools.h b/services/blob/dev/DevTools.h similarity index 100% rename from services/blob/docker-server/contents/server/dev/DevTools.h rename to services/blob/dev/DevTools.h diff --git a/services/blob/docker-base/Dockerfile b/services/blob/docker-base/Dockerfile deleted file mode 100644 index 4a4b5a16d..000000000 --- a/services/blob/docker-base/Dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM commapp/services-base:1.1 - -ENV SHELL=/bin/bash - -RUN apt-get update && apt-get install -y uuid-dev && rm -rf /var/lib/apt/lists/* - -CMD /bin/bash diff --git a/services/blob/docker-server/Dockerfile b/services/blob/docker-server/Dockerfile deleted file mode 100644 index a0b3eab1a..000000000 --- a/services/blob/docker-server/Dockerfile +++ /dev/null @@ -1,16 +0,0 @@ -FROM commapp/blob-base:1.3 - -ARG COMM_SERVICES_DEV_MODE - -ENV SHELL=/bin/bash -ENV COMM_SERVICES_DEV_MODE=${COMM_SERVICES_DEV_MODE} - -COPY services/blob/docker-server/contents /transferred -COPY native/cpp/CommonCpp/grpc/protos/blob.proto /transferred/server/protos/blob.proto - -ARG COMM_TEST_SERVICES -ENV COMM_TEST_SERVICES=${COMM_TEST_SERVICES} - -RUN /transferred/build_server.sh - -CMD /transferred/run_server.sh diff --git a/services/blob/docker-server/contents/run_server.sh b/services/blob/docker-server/contents/run_server.sh deleted file mode 100755 index 6e51e5aee..000000000 --- a/services/blob/docker-server/contents/run_server.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -set -e - -if [ "$COMM_TEST_SERVICES" -eq 1 ]; then - /transferred/run_tests.sh - exit 0; -fi - -/transferred/server/cmake/build/bin/blob diff --git a/services/blob/docker-server/contents/run_tests.sh b/services/blob/docker-server/contents/run_tests.sh deleted file mode 100755 index 22e7a856a..000000000 --- a/services/blob/docker-server/contents/run_tests.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -set -e - -pushd transferred/server/cmake/build - -make test ARGS="-V" - -popd # transferred/server/cmake/build diff --git a/services/blob/docker-server/contents/server/build.sh b/services/blob/docker/build.sh similarity index 100% rename from services/blob/docker-server/contents/server/build.sh rename to services/blob/docker/build.sh diff --git a/services/blob/docker-server/contents/build_server.sh b/services/blob/docker/build_server.sh similarity index 83% rename from services/blob/docker-server/contents/build_server.sh rename to services/blob/docker/build_server.sh index b99faa771..9ed5c8706 100755 --- a/services/blob/docker-server/contents/build_server.sh +++ b/services/blob/docker/build_server.sh @@ -1,27 +1,23 @@ #!/bin/bash set -e # folly hack - https://github.com/facebook/folly/pull/1231 sed -i 's/#if __has_include()/#if __has_include()/g' /usr/lib/folly/folly/detail/Demangle.h -pushd /transferred/server - rm -rf lib mkdir lib pushd lib ln -s /usr/lib/folly ln -s /usr/lib/glog ln -s /usr/lib/double-conversion popd # lib rm -rf _generated mkdir _generated rm -rf cmake/build mkdir -p cmake/build -./generate.sh -./build.sh - -popd # /transferred/server +scripts/generate.sh +scripts/build.sh diff --git a/services/blob/docker-server/contents/server/generate.sh b/services/blob/docker/generate.sh similarity index 100% rename from services/blob/docker-server/contents/server/generate.sh rename to services/blob/docker/generate.sh diff --git a/services/blob/docker/run_server.sh b/services/blob/docker/run_server.sh new file mode 100755 index 000000000..4591797df --- /dev/null +++ b/services/blob/docker/run_server.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +set -e + +cmake/build/bin/blob diff --git a/services/blob/docker/run_tests.sh b/services/blob/docker/run_tests.sh new file mode 100755 index 000000000..1fae22919 --- /dev/null +++ b/services/blob/docker/run_tests.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +set -e + +pushd cmake/build +make test ARGS="-V" +popd # cmake/build diff --git a/services/blob/docker-server/contents/server/src/AwsS3Bucket.cpp b/services/blob/src/AwsS3Bucket.cpp similarity index 100% rename from services/blob/docker-server/contents/server/src/AwsS3Bucket.cpp rename to services/blob/src/AwsS3Bucket.cpp diff --git a/services/blob/docker-server/contents/server/src/AwsS3Bucket.dev.cpp b/services/blob/src/AwsS3Bucket.dev.cpp similarity index 100% rename from services/blob/docker-server/contents/server/src/AwsS3Bucket.dev.cpp rename to services/blob/src/AwsS3Bucket.dev.cpp diff --git a/services/blob/docker-server/contents/server/src/AwsS3Bucket.h b/services/blob/src/AwsS3Bucket.h similarity index 100% rename from services/blob/docker-server/contents/server/src/AwsS3Bucket.h rename to services/blob/src/AwsS3Bucket.h diff --git a/services/blob/docker-server/contents/server/src/AwsTools.cpp b/services/blob/src/AwsTools.cpp similarity index 100% rename from services/blob/docker-server/contents/server/src/AwsTools.cpp rename to services/blob/src/AwsTools.cpp diff --git a/services/blob/docker-server/contents/server/src/AwsTools.h b/services/blob/src/AwsTools.h similarity index 100% rename from services/blob/docker-server/contents/server/src/AwsTools.h rename to services/blob/src/AwsTools.h diff --git a/services/blob/docker-server/contents/server/src/BlobServiceImpl.cpp b/services/blob/src/BlobServiceImpl.cpp similarity index 100% rename from services/blob/docker-server/contents/server/src/BlobServiceImpl.cpp rename to services/blob/src/BlobServiceImpl.cpp diff --git a/services/blob/docker-server/contents/server/src/BlobServiceImpl.h b/services/blob/src/BlobServiceImpl.h similarity index 100% rename from services/blob/docker-server/contents/server/src/BlobServiceImpl.h rename to services/blob/src/BlobServiceImpl.h diff --git a/services/blob/docker-server/contents/server/src/Constants.h b/services/blob/src/Constants.h similarity index 100% rename from services/blob/docker-server/contents/server/src/Constants.h rename to services/blob/src/Constants.h diff --git a/services/blob/docker-server/contents/server/src/DatabaseEntities/BlobItem.cpp b/services/blob/src/DatabaseEntities/BlobItem.cpp similarity index 100% rename from services/blob/docker-server/contents/server/src/DatabaseEntities/BlobItem.cpp rename to services/blob/src/DatabaseEntities/BlobItem.cpp diff --git a/services/blob/docker-server/contents/server/src/DatabaseEntities/BlobItem.h b/services/blob/src/DatabaseEntities/BlobItem.h similarity index 100% rename from services/blob/docker-server/contents/server/src/DatabaseEntities/BlobItem.h rename to services/blob/src/DatabaseEntities/BlobItem.h diff --git a/services/blob/docker-server/contents/server/src/DatabaseEntities/DatabaseEntitiesTools.h b/services/blob/src/DatabaseEntities/DatabaseEntitiesTools.h similarity index 100% rename from services/blob/docker-server/contents/server/src/DatabaseEntities/DatabaseEntitiesTools.h rename to services/blob/src/DatabaseEntities/DatabaseEntitiesTools.h diff --git a/services/blob/docker-server/contents/server/src/DatabaseEntities/Item.h b/services/blob/src/DatabaseEntities/Item.h similarity index 100% rename from services/blob/docker-server/contents/server/src/DatabaseEntities/Item.h rename to services/blob/src/DatabaseEntities/Item.h diff --git a/services/blob/docker-server/contents/server/src/DatabaseEntities/ReverseIndexItem.cpp b/services/blob/src/DatabaseEntities/ReverseIndexItem.cpp similarity index 100% rename from services/blob/docker-server/contents/server/src/DatabaseEntities/ReverseIndexItem.cpp rename to services/blob/src/DatabaseEntities/ReverseIndexItem.cpp diff --git a/services/blob/docker-server/contents/server/src/DatabaseEntities/ReverseIndexItem.h b/services/blob/src/DatabaseEntities/ReverseIndexItem.h similarity index 100% rename from services/blob/docker-server/contents/server/src/DatabaseEntities/ReverseIndexItem.h rename to services/blob/src/DatabaseEntities/ReverseIndexItem.h diff --git a/services/blob/docker-server/contents/server/src/DatabaseManager.cpp b/services/blob/src/DatabaseManager.cpp similarity index 100% rename from services/blob/docker-server/contents/server/src/DatabaseManager.cpp rename to services/blob/src/DatabaseManager.cpp diff --git a/services/blob/docker-server/contents/server/src/DatabaseManager.dev.cpp b/services/blob/src/DatabaseManager.dev.cpp similarity index 100% rename from services/blob/docker-server/contents/server/src/DatabaseManager.dev.cpp rename to services/blob/src/DatabaseManager.dev.cpp diff --git a/services/blob/docker-server/contents/server/src/DatabaseManager.h b/services/blob/src/DatabaseManager.h similarity index 100% rename from services/blob/docker-server/contents/server/src/DatabaseManager.h rename to services/blob/src/DatabaseManager.h diff --git a/services/blob/docker-server/contents/server/src/MultiPartUploader.cpp b/services/blob/src/MultiPartUploader.cpp similarity index 100% rename from services/blob/docker-server/contents/server/src/MultiPartUploader.cpp rename to services/blob/src/MultiPartUploader.cpp diff --git a/services/blob/docker-server/contents/server/src/MultiPartUploader.dev.cpp b/services/blob/src/MultiPartUploader.dev.cpp similarity index 100% rename from services/blob/docker-server/contents/server/src/MultiPartUploader.dev.cpp rename to services/blob/src/MultiPartUploader.dev.cpp diff --git a/services/blob/docker-server/contents/server/src/MultiPartUploader.h b/services/blob/src/MultiPartUploader.h similarity index 100% rename from services/blob/docker-server/contents/server/src/MultiPartUploader.h rename to services/blob/src/MultiPartUploader.h diff --git a/services/blob/docker-server/contents/server/src/S3Path.cpp b/services/blob/src/S3Path.cpp similarity index 100% rename from services/blob/docker-server/contents/server/src/S3Path.cpp rename to services/blob/src/S3Path.cpp diff --git a/services/blob/docker-server/contents/server/src/S3Path.h b/services/blob/src/S3Path.h similarity index 100% rename from services/blob/docker-server/contents/server/src/S3Path.h rename to services/blob/src/S3Path.h diff --git a/services/blob/docker-server/contents/server/src/Tools.cpp b/services/blob/src/Tools.cpp similarity index 100% rename from services/blob/docker-server/contents/server/src/Tools.cpp rename to services/blob/src/Tools.cpp diff --git a/services/blob/docker-server/contents/server/src/Tools.h b/services/blob/src/Tools.h similarity index 100% rename from services/blob/docker-server/contents/server/src/Tools.h rename to services/blob/src/Tools.h diff --git a/services/blob/docker-server/contents/server/src/server.cpp b/services/blob/src/server.cpp similarity index 100% rename from services/blob/docker-server/contents/server/src/server.cpp rename to services/blob/src/server.cpp diff --git a/services/blob/docker-server/contents/server/test/DatabaseManagerTest.cpp b/services/blob/test/DatabaseManagerTest.cpp similarity index 100% rename from services/blob/docker-server/contents/server/test/DatabaseManagerTest.cpp rename to services/blob/test/DatabaseManagerTest.cpp diff --git a/services/blob/docker-server/contents/server/test/MultiPartUploadTest.cpp b/services/blob/test/MultiPartUploadTest.cpp similarity index 100% rename from services/blob/docker-server/contents/server/test/MultiPartUploadTest.cpp rename to services/blob/test/MultiPartUploadTest.cpp diff --git a/services/blob/docker-server/contents/server/test/StorageManagerTest.cpp b/services/blob/test/StorageManagerTest.cpp similarity index 100% rename from services/blob/docker-server/contents/server/test/StorageManagerTest.cpp rename to services/blob/test/StorageManagerTest.cpp diff --git a/services/blob/docker-server/contents/server/test/TestTools.cpp b/services/blob/test/TestTools.cpp similarity index 100% rename from services/blob/docker-server/contents/server/test/TestTools.cpp rename to services/blob/test/TestTools.cpp diff --git a/services/blob/docker-server/contents/server/test/TestTools.h b/services/blob/test/TestTools.h similarity index 100% rename from services/blob/docker-server/contents/server/test/TestTools.h rename to services/blob/test/TestTools.h diff --git a/services/docker-compose.yml b/services/docker-compose.yml index b314127bd..40cad1e88 100644 --- a/services/docker-compose.yml +++ b/services/docker-compose.yml @@ -1,54 +1,48 @@ version: "3.9" services: tunnelbroker-server: build: dockerfile: services/tunnelbroker/Dockerfile context: ../ args: - COMM_TEST_SERVICES=${COMM_TEST_SERVICES} image: commapp/tunnelbroker-server:0.2 container_name: tunnelbroker-server ports: - "${COMM_SERVICES_PORT_TUNNELBROKER}:50051" volumes: - $HOME/.aws/config:/root/.aws/config:ro - $HOME/.aws/credentials:/root/.aws/credentials:ro - ./tunnelbroker/tunnelbroker.ini:/root/tunnelbroker/tunnelbroker.ini:ro # backup backup-base: build: dockerfile: services/backup/docker-base/Dockerfile context: ../ image: commapp/backup-base:1.2 backup-server: build: dockerfile: services/backup/docker-server/Dockerfile context: ../ args: - COMM_TEST_SERVICES=${COMM_TEST_SERVICES} - COMM_SERVICES_DEV_MODE=${COMM_SERVICES_DEV_MODE} image: commapp/backup-server:0.1 container_name: backup-server ports: - "${COMM_SERVICES_PORT_BACKUP}:50051" volumes: - $HOME/.aws/credentials:/root/.aws/credentials:ro - # blob - blob-base: - build: - dockerfile: services/blob/docker-base/Dockerfile - context: ../ - image: commapp/blob-base:1.3 blob-server: build: - dockerfile: services/blob/docker-server/Dockerfile + dockerfile: services/blob/Dockerfile context: ../ args: - COMM_TEST_SERVICES=${COMM_TEST_SERVICES} - COMM_SERVICES_DEV_MODE=${COMM_SERVICES_DEV_MODE} image: commapp/blob-server:0.1 container_name: blob-server ports: - "${COMM_SERVICES_PORT_BLOB}:50051" volumes: - $HOME/.aws/credentials:/root/.aws/credentials:ro