Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3703175
D5380.id17613.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
D5380.id17613.diff
View Options
diff --git a/services/tunnelbroker/CMakeLists.txt b/services/tunnelbroker/CMakeLists.txt
--- a/services/tunnelbroker/CMakeLists.txt
+++ b/services/tunnelbroker/CMakeLists.txt
@@ -14,14 +14,18 @@
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.14)
find_package(PkgConfig REQUIRED)
-
find_package(double-conversion REQUIRED)
find_package(Folly REQUIRED)
find_package(Protobuf CONFIG REQUIRED)
find_package(gRPC CONFIG REQUIRED)
-
-# Find AMQP-CPP installation
find_package(amqpcpp CONFIG REQUIRED)
+find_package(AWSSDK REQUIRED COMPONENTS core dynamodb)
+find_package(Boost 1.40
+ COMPONENTS program_options thread system context filesystem regex
+ REQUIRED
+)
+find_package(OpenSSL REQUIRED)
+find_package(glog)
# Find Cryptopp installation
pkg_check_modules(CRYPTOPP
@@ -37,15 +41,9 @@
libuv>=1.43
)
-if(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL "/transferred/tunnelbroker")
- # Inside the docker build contex
- set(_proto_path "grpc")
- set(_shared_path "../shared")
-else()
- # Inside repo
- set(_shared_path "../../shared")
- set(_proto_path "../../shared/protos")
-endif()
+set(_shared_path "../../shared")
+set(_proto_path "${_shared_path}/protos")
+set(_shared_cmake "${_shared_path}/cmake")
# Shared Comm protos
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/${_proto_path}
@@ -55,21 +53,13 @@
# Shared services code
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../lib/src
- ${CMAKE_CURRENT_BINARY_DIR}/common
+ ${CMAKE_CURRENT_BINARY_DIR}/lib/src
EXCLUDE_FROM_ALL
)
-find_package(AWSSDK REQUIRED COMPONENTS core dynamodb)
-find_package(Boost 1.40
- COMPONENTS program_options thread system context filesystem regex
- REQUIRED
-)
-find_package(OpenSSL REQUIRED)
-find_package(glog)
-
# Corrosion and CXX Rust integration
find_package(Corrosion REQUIRED)
-include(${_shared_path}/cmake/corrosion-cxx.cmake)
+include(${_shared_cmake}/corrosion-cxx.cmake)
add_library_rust(PATH rust-lib NAMESPACE rust)
file(GLOB_RECURSE SOURCE_CODE "./src/*.cpp")
@@ -102,8 +92,8 @@
${SOURCE_CODE}
)
-target_include_directories(tunnelbroker
- PUBLIC
+set(
+ INCLUDE_DIRS
${CMAKE_CURRENT_SOURCE_DIR}/src
${CMAKE_CURRENT_SOURCE_DIR}/src/Database
${CMAKE_CURRENT_SOURCE_DIR}/src/DeliveryBroker
@@ -112,6 +102,12 @@
${CMAKE_CURRENT_SOURCE_DIR}/src/Amqp
)
+target_include_directories(
+ tunnelbroker
+ PUBLIC
+ ${INCLUDE_DIRS}
+)
+
target_link_libraries(
tunnelbroker
@@ -147,14 +143,10 @@
GTest::gtest_main
)
- target_include_directories(runTests
+ target_include_directories(
+ runTests
PUBLIC
- ${CMAKE_CURRENT_SOURCE_DIR}/src
- ${CMAKE_CURRENT_SOURCE_DIR}/src/Database
- ${CMAKE_CURRENT_SOURCE_DIR}/src/DeliveryBroker
- ${CMAKE_CURRENT_SOURCE_DIR}/src/Service
- ${CMAKE_CURRENT_SOURCE_DIR}/src/Tools
- ${CMAKE_CURRENT_SOURCE_DIR}/src/Amqp
+ ${INCLUDE_DIRS}
)
include(GoogleTest)
diff --git a/services/tunnelbroker/Dockerfile b/services/tunnelbroker/Dockerfile
--- a/services/tunnelbroker/Dockerfile
+++ b/services/tunnelbroker/Dockerfile
@@ -1,27 +1,8 @@
FROM commapp/services-base:1.3.2
-ARG MAKE_JOBS=4
-ENV MAKEFLAGS="-j${MAKE_JOBS}"
-
-WORKDIR /transferred/scripts
-
-# Install Curl
-RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y curl
-
-# Install SDKs
-COPY services/tunnelbroker/docker/install_amqp_cpp.sh .
-RUN ./install_amqp_cpp.sh
-
-COPY services/tunnelbroker/docker/install_cryptopp.sh .
-RUN ./install_cryptopp.sh
-
-COPY services/tunnelbroker/docker/install_libuv.sh .
-RUN ./install_libuv.sh
-
-RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
-
-COPY services/lib/docker/install_corrosion.sh .
-RUN ./install_corrosion.sh
+RUN apt-get update && \
+ DEBIAN_FRONTEND=noninteractive apt-get install -y curl && \
+ rm -rf /var/lib/apt/lists/*
ARG COMM_TEST_SERVICES
ARG COMM_SERVICES_SANDBOX
@@ -29,18 +10,25 @@
ENV COMM_TEST_SERVICES=${COMM_TEST_SERVICES}
ENV COMM_SERVICES_SANDBOX=${COMM_SERVICES_SANDBOX}
-WORKDIR /transferred
-
-COPY services/lib/src/ lib/src/
-COPY shared/ shared/
+# Install Rust
+RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
-WORKDIR /transferred/tunnelbroker
+WORKDIR /transferred/services/tunnelbroker
-ADD shared/protos grpc
-COPY services/lib/cmake-components cmake-components
COPY services/lib/docker/ scripts/
-COPY services/tunnelbroker/docker/* docker/
-COPY services/tunnelbroker/ .
+COPY services/tunnelbroker/docker/ scripts/
+
+# Install SDKs
+RUN scripts/install_amqp_cpp.sh
+RUN scripts/install_cryptopp.sh
+RUN scripts/install_libuv.sh
+RUN scripts/install_corrosion.sh
+
+ADD shared/protos /transferred/shared/protos/
+ADD shared/cmake /transferred/shared/cmake/
+
+COPY services/tunnelbroker/ /transferred/services/tunnelbroker/
+COPY services/lib/src/ /transferred/services/lib/src/
RUN scripts/build_service.sh
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Jan 8, 7:48 PM (7 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2822464
Default Alt Text
D5380.id17613.diff (4 KB)
Attached To
Mode
D5380: [services] Tunnelbroker - Unifying paths in Docker according to the local repository
Attached
Detach File
Event Timeline
Log In to Comment