diff --git a/services/blob/docker-server/contents/server/CMakeLists.txt b/services/blob/CMakeLists.txt 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 --- /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 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 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 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.h b/services/blob/dev/DevTools.h rename from services/blob/docker-server/contents/server/dev/DevTools.h rename to services/blob/dev/DevTools.h diff --git a/services/blob/docker-server/contents/server/dev/DevTools.cpp b/services/blob/dev/DevTools.cpp rename from services/blob/docker-server/contents/server/dev/DevTools.cpp rename to services/blob/dev/DevTools.cpp diff --git a/services/blob/docker-base/Dockerfile b/services/blob/docker-base/Dockerfile deleted file mode 100644 --- 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 --- 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 --- 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 --- 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 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 rename from services/blob/docker-server/contents/build_server.sh rename to services/blob/docker/build_server.sh --- a/services/blob/docker-server/contents/build_server.sh +++ b/services/blob/docker/build_server.sh @@ -5,8 +5,6 @@ # 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 @@ -21,7 +19,5 @@ 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 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 --- /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 --- /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.h b/services/blob/src/AwsS3Bucket.h 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/AwsS3Bucket.cpp b/services/blob/src/AwsS3Bucket.cpp 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 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/AwsTools.h b/services/blob/src/AwsTools.h 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/AwsTools.cpp b/services/blob/src/AwsTools.cpp 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/BlobServiceImpl.h b/services/blob/src/BlobServiceImpl.h 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/BlobServiceImpl.cpp b/services/blob/src/BlobServiceImpl.cpp 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/Constants.h b/services/blob/src/Constants.h 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.h b/services/blob/src/DatabaseEntities/BlobItem.h 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/BlobItem.cpp b/services/blob/src/DatabaseEntities/BlobItem.cpp 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/DatabaseEntitiesTools.h b/services/blob/src/DatabaseEntities/DatabaseEntitiesTools.h 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 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.h b/services/blob/src/DatabaseEntities/ReverseIndexItem.h 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/DatabaseEntities/ReverseIndexItem.cpp b/services/blob/src/DatabaseEntities/ReverseIndexItem.cpp 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/DatabaseManager.h b/services/blob/src/DatabaseManager.h 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/DatabaseManager.cpp b/services/blob/src/DatabaseManager.cpp 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 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/MultiPartUploader.h b/services/blob/src/MultiPartUploader.h 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/MultiPartUploader.cpp b/services/blob/src/MultiPartUploader.cpp 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 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/S3Path.h b/services/blob/src/S3Path.h 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/S3Path.cpp b/services/blob/src/S3Path.cpp 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/Tools.h b/services/blob/src/Tools.h 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/Tools.cpp b/services/blob/src/Tools.cpp 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/server.cpp b/services/blob/src/server.cpp 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 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 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 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.h b/services/blob/test/TestTools.h rename from services/blob/docker-server/contents/server/test/TestTools.h rename to services/blob/test/TestTools.h diff --git a/services/blob/docker-server/contents/server/test/TestTools.cpp b/services/blob/test/TestTools.cpp rename from services/blob/docker-server/contents/server/test/TestTools.cpp rename to services/blob/test/TestTools.cpp diff --git a/services/docker-compose.yml b/services/docker-compose.yml --- a/services/docker-compose.yml +++ b/services/docker-compose.yml @@ -33,15 +33,9 @@ - "${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}